How shopnobanerjee/the-good-ads works
Project type and purpose
• This is a full-stack web application named “The GoodAds.”
• Frontend: a Next.js/React app styled with Tailwind CSS.
• Backend: a Python FastAPI service with SQLAlchemy models, Alembic migrations, and PostgreSQL.
• Deployed via Docker Compose.
High-Level Components
a. Frontend (Client)
• Next.js framework (pages/app router under client/app).
• UI components (header, navigation, buttons, etc.) under client/components.
• Tailwind CSS + PostCSS for styles.
b. Backend (Server)
• FastAPI entrypoint (server/app/main.py).
• API v1 endpoints (/api/v1/endpoints/*.py).
• CRUD layer (server/app/crud).
• Pydantic schemas (server/app/schemas).
• SQLAlchemy models (server/app/models).
• DB session & initialization (server/app/db).
• Alembic for migrations.
c. Database
• PostgreSQL container managed via Docker Compose.
d. Infrastructure
• Dockerfile & docker-compose.yml for multi-container orchestration.
Interactions & Data Flow
• Browser → (HTTPS) → Next.js server
• Next.js → (HTTP fetch) → FastAPI endpoints
• FastAPI → (SQLAlchemy) → PostgreSQL
• Alembic runs migrations on startup via Docker Compose
Key Architectural Patterns
• Layered architecture on the backend: routers → CRUD → models → DB.
• Component-based UI on the frontend.
• Infrastructure as code via Docker Compose.
• Separation of concerns between client and server.