How iath-dev/task-manager-rpy works
Project Type and Purpose
• This is a monorepo full-stack task-management application.
• Backend: RESTful API built with FastAPI, uses Alembic for migrations, exposes endpoints under /api/v1.
• Frontend: React+TypeScript single-page app (SPA) built with Vite, served (in production) behind Nginx.
• Containerized via Docker Compose for easy local/dev deployment.
High-Level Architecture Components
a. Docker-Compose Services
• frontend (React app served by Nginx)
• backend (FastAPI app)
• database (e.g. Postgres or SQLite; backend/test.db for local dev)
• optional: reverse-proxy or load-balancer in front of Nginx for scale
b. Frontend Logical Layers
• UI Components (Tasks, Comments, Users)
• State Management (Zustand stores: authStore, taskStore, sidebarStore)
• Data Layer (services: api.ts, taskService, commentService, userService)
• Routing & Layout (React Router loaders, protected/public routes, AppLayout)
c. Backend Logical Layers
• API Layer (routers in app/api/routes, grouped by domain: auth, users, tasks, comments, seed, health)
• Service Layer (business logic in app/services)
• Data Layer (SQLAlchemy models in app/db/models, session management in app/db/session)
• Core/Infrastructure (configuration, security, logging under app/core)
• Migrations (alembic/ Dir)
d. Database
• Entities: User, Task, Comment
• Relationships: one-to-many (User→Task, Task→Comment, User→Comment)
• Seed endpoint to prepopulate roles/users
Relationships & Data Flows
• Browser → (HTTP/HTTPS) → Nginx (serves built React assets)
• React SPA → (AJAX/fetch) → FastAPI /api/v1/* endpoints
• FastAPI → (ORM) → Database
• FastAPI → (Alembic) → Database schema migrations
• Cypress Tests → Frontend (component & E2E) or Backend (pytest)
Architectural Patterns & Principles
• Layered architecture (Presentation → Application → Domain → Infrastructure)
• Separation of concerns: API routers vs business services vs data models
• Containerized microservice style (each service in its own container, communicates over HTTP)
• Hexagonal touches: dependency injection via FastAPI deps.py
1. Sketch three primary blocks: Frontend, Backend, Database.
2. Inside Frontend, subdivide:
• UI Components
• Data Layer (services + hooks)
• State Store
3. Inside Backend, subdivide:
• API Routers (/routes/*.py)
• Service Layer (services/*.py)
• ORM Layer (db/models, db/session)
• Config & Security (core/)
• User’s Browser → Frontend (HTTP)
• Frontend → Backend (HTTP with JSON payloads)
• Backend → Database (ORM/SQL)
• (Side) Alembic migrations → Database