How alhoyani/fbe works
Project type and purpose
• This is a full-stack web application for building, customizing, and ordering resumes/CVs.
• The backend is a Django-based REST API (accounts, home, order, payment, resume, templates_app). It uses Celery for background jobs (e.g., PDF generation, emails), Docker/Docker-Compose for local development, and standard Django configurations (ASGI, WSGI, settings).
• The frontend is a React + TypeScript single-page application (SPA) built with Vite, organized by pages, components, feature slices (Redux Toolkit), and context for auth/loading.
File structure
• Top-level:
• backend/ (Django entry points, settings, Celery)
• accounts/, home/, order/, payment/, resume/, templates_app/ (Django apps – models, serializers, views, URLs, tests)
• docker-compose.yml / docker-compose-dev.yml, Dockerfile(s)
• manage.py, requirements.txt
• src/ (React SPA – App.tsx, pages/, components/, features/, store, styles, config)
• package.json, tsconfig*.json, vite.config.ts
• Patterns:
• Backend: MVC + Django REST framework + Celery workers + message broker (likely Redis) + relational DB (Postgres/MySQL) + object storage (S3 or local)
• Frontend: component-based UI, Redux for global state, RTK Query/apiSlice for server calls, React Router for routing, Context for cross-cutting concerns
README
• Minimal (“# to-be-expert”) – lean on file structure for domain understanding.
Main components & interactions
a. User’s browser (React SPA)
b. CDN or Static-file host (serves index.html + bundle)
c. Frontend application (API client, UI components, routing)
d. API Gateway / Load balancer (NGINX or cloud LB)
e. Django REST API (Gunicorn/ASGI)
f. Relational Database (PostgreSQL/MySQL)
g. Message broker (Redis/RabbitMQ)
h. Celery workers (background tasks: PDF generation, email notifications)
i. Object storage (S3 or equivalent, for generated resumes and assets)
j. External payment gateway (Stripe/PayPal)
k. Email/SMS provider (SMTP, SendGrid, Twilio)
Relationships & data flows
• The browser loads the SPA → makes REST/JSON calls to /api/* endpoints.
• NGINX/Load Balancer routes requests to Django (Gunicorn or Uvicorn).
• Django handles auth (accounts service), resume CRUD, order placement, payment validation.
• DB persists users, resumes, orders.
• On order placement, Django enqueues tasks on the broker for Celery (e.g., resume PDF generation, sending confirmation emails).
• Celery workers consume tasks → read/write DB and object storage → notify users via email/SMS.
• The frontend polls or listens for task status via API or WebSocket (if implemented).
Architectural patterns & design principles
• Separation of concerns: UI vs. API vs. background processing
• MVC in Django, component hierarchy in React
• Redux Toolkit + RTK Query for global state & data fetching
• Docker Compose for local multi-container orchestration
• Twelve-factor app principles (config in env vars, stateless processes)