How bader-idris/nuxt3-fullstack-portfolio works
Main Components
• Frontend: The “client” directory is your Nuxt 3 application. It contains pages (e.g., index, about, projects), components (both global and specific ones like SnakeGame), composables, plugins, configuration for internationalization (i18n), assets (CSS, SCSS, sounds, images, etc.), and more.
• Backend: The “server” directory consists of API routes (under “server/api/v1”), authentication logic (social logins, reset-password, verification, etc.), middleware, models (especially bridging Mongo and possibly other databases), utilities, and websocket support.
• Database & Data Stores: Look at the “server/models” folder (with MongoDB schema files) and configuration for Mongo, PostgreSQL (psql config), and Redis. These indicate a multi-database environment.
• Docker & Deployment Infrastructure: Notice several Docker-related files (e.g., a.prod-certbot.yml, b.dev.yml) and configurations for services like Nginx, Certbot (SSL renewal), and fail2ban for security.
• Mobile: The README also discusses setting up mobile environments with Capacitor. While there isn’t a separate “mobile” folder, configuration files (like capacitor.config.ts) and instructions for adding Android/iOS support indicate that mobile builds are integrated.
• External Services: The configuration hints at external integrations such as social authentication (Facebook, Google), email sending (using nodemailer utilities), and Certbot for SSL certificates.
Relationships & Interactions
• The Nuxt frontend communicates with the backend API services via REST endpoints defined in the “server/api/v1” directory.
• The backend API interacts with various databases (MongoDB, Postgres, Redis) as indicated by the separate configuration folders and model definitions.
• External authentication services (e.g., Facebook, Google) interact through dedicated endpoints and callback handlers.
• The Docker configuration ties together multiple containers for the client, server, Nginx reverse proxy, certificate management, and security (e.g., fail2ban).
• Mobile applications (built via Capacitor) will interface with the same backend APIs, and their assets are managed within the client’s assets and Capacitor configuration files.
Architectural Patterns & Design Principles
• Clear separation of concerns: The client (Nuxt 3) is completely decoupled from the server (API endpoints, business logic, data models), which enables independent scaling or modifications.
• MVC pattern on the backend: Organized APIs, middleware, models, and utilities indicate a pattern that separates data representation, business logic, and control logic.
• Containerization and orchestration: Docker files and configurations underscore a microservices or multi-container approach, ensuring that each part of the system (such as the server, Nginx reverse proxy, cron jobs for certificate renewal) can be deployed and managed independently.
• Internationalization: i18n directories show that localization is a first-class requirement in the design of the client interface.
• Extensibility: The modular folder structures allow for adding new features, components, or endpoints without disrupting the system.