How isaacangyu/therapy-chatbot works
Main Components
• Backend Server:
• Directory clues: “therapy_chatbot” (contains asgi.py, wsgi.py, settings.py, urls.py) and “core” (Django models, views, migrations).
• Purpose: Supplies APIs, business logic, session management, and authentication features (e.g., forgot password functionality and future OAuth support).
• Frontend Client:
• Directory clues: “lib”, “android”, “ios”, “web”, “macos”, “linux”, “windows”.
• Purpose: Flutter-based UI that runs on multiple platforms (mobile, desktop, web). The “lib” directory shows separation into modules (login, journal, profile, breathing, etc.) and various widgets.
• API Configuration & Assets:
• “api” folder contains JSON configurations (for base URL, forgot password info, latest app version) to standardize API endpoints and versioning.
• Database Layer & Schema Management:
• “drift_schemas” (and corresponding “test/drift”) indicate that the application uses Drift (a Dart ORM for SQLite) to manage local persistence and DB migrations on the client side.
• DevOps / CI & Environment Setup:
• “.devcontainer”, “.github”, and “scripts” directories suggest containerized development (Docker), dependency checking, migration automation, and various startup scripts (backend/frontend/combined tests).
• Certificates & Security:
• “cert” folder includes test certificate files to support secure communications—likely for tests or encrypted operations.
• Documentation & Tooling:
• “docs” directory provides developer and project setup guidance.
• “tool” and configuration files (e.g., pubspec.yaml, requirements.txt) help manage dependencies and builds.
Relationships and Interactions
• The Flutter client operates across platforms (Android, iOS, Web, Desktop) with shared business logic contained in “lib”.
• Local data persistence within the Flutter client is managed by Drift, with migration scripts and schema files showing version changes.
• DevOps components (Docker config, CI scripts) are used to build, test, and deploy both client and backend.
• The “api” and “app_assets” directories are used to configure dynamic elements (such as base URLs and app version tracking) which integrate into both the mobile frontend and the backend server.
Architectural Patterns and Design Principles
• Separation of Concerns:
• Backend (Django) is isolated from the front-end (Flutter); the two communicate via clearly defined APIs.
• Multi-Platform Development:
• The Flutter client is organized to allow for code reuse across mobile, desktop, and web platforms.
• Schema Versioning & Migrations:
• Use of Drift for managing local database state on the client side.
• Environment Isolation:
• Use of Docker (.devcontainer) and CI/CD configurations (.github, scripts) ensures standardized development environments.
Relevant Technologies, Frameworks, and Libraries
• Django/Python for backend API services.
• Flutter (with Dart) for the client, including separation into UI, business logic, and common utilities.
• Drift for local SQLite database management in Flutter.
• DevOps tooling such as Docker, GitHub Actions/Dependabot, and various shell scripts.
• Standard mobile platform resources (Android/iOS specific folders) for platform-specific configurations.
• Use clear, descriptive labels for each major component, e.g., “Django Backend API”, “Flutter Client – Login Module”, “Local Persistence (Drift/SQLite)”, etc.
• Another for frontend components (e.g., green shades),
• And possibly a third for shared tools/dev-ops (e.g., orange or gray).
• Notes or call-outs for future features such as OAuth integration or email sending that indicate upcoming changes in the architecture.