How linhnguyen411/3dscene works
Main Components
• Frontend Application:
• The README shows that the frontend is accessible via http://localhost:8081/.
• Backend Application:
• The "backend" directory reveals a Python backend structured with clear separation into API endpoints (api/api_v1), CRUD operations, models, schemas, configuration, and even logs.
• Includes documentation via Swagger (http://localhost:8083/docs) and exposes endpoints for authentication, user/todo management, etc.
• Integration with Celery is evident (celery_app.py) to handle asynchronous tasks, with Flower accessible for monitoring these tasks.
• Reverse-Proxy Service:
• The "reverse-proxy" directory indicates the use of an nginx-based proxy container which likely manages and routes incoming requests to the proper frontend or backend containers.
• Supporting Services:
• MailHog is used for capturing and viewing emails sent by the application (visible on http://localhost:8085/).
• PGAdmin is provided to manage and inspect the database (likely a PostgreSQL instance) with its interface at http://localhost:8086/.
• Additionally, there are Docker-related files and docker-compose configurations that encapsulate the setup into separate containers.
Relationships and Interactions
• External Client/User Requests:
• They start at the reverse-proxy which then directs traffic to either the Frontend (React application) or the Backend (FastAPI API endpoints).
• Frontend – Backend Communication:
• The React frontend communicates with the backend through RESTful API calls to handle user authentication, data retrieval, and manipulation (todos, user profiles, etc.).
• Backend and Asynchronous Processing:
• The backend offloads tasks to Celery workers (managed by celery_app.py) which are monitored via Flower.
• Backend Email Service:
• The backend uses predefined email templates to send emails, with MailHog intercepting these mails for development and testing purposes.
• Database Interaction:
• The backend interacts with a database through its ORM layer and session management (indicated by the "db" subfolder). PGAdmin is available as an external viewer for the database contents.
Architectural Patterns & Design Principles
• Modular organization by separating concerns (frontend, backend, reverse proxy, testing, etc.).
• Containerization via Docker ensuring consistency across different environments.
• Use of API versioning (api_v1) within the backend promotes scalability and maintainability.
• Incorporation of asynchronous task handling (Celery) for long-running or background jobs.
• Clear separation between presentation (React) and business logic/data (backend) layers.