How ramanbhandari/vamoose works
Main Components
• Frontend Application:
• Located in the “frontend” directory.
• Built in Next.js using TypeScript, Tailwind CSS, and features a robust component structure (e.g., pages, layout, stores, utilities).
• Includes state management (via stores) for chat, trips, notifications, etc.
• Uses API clients (see the “frontend/utils/apiClient.ts”) and web sockets (socketClient.ts) for real-time interactions.
• Backend Server:
• Found in the “server” directory.
• Implements a REST API with multiple controllers handling endpoints for expenses, trips, invites, itinerary events, notifications, polls, etc.
• Organized using an MVC-like pattern: controllers, models, middleware, and services.
• Uses Prisma (see “server/prisma” and “schema.prisma”) for database interactions and migration scripts.
• Also includes a socket server (server/src/socketServer.ts) for real-time communication.
• Databases & Data Persistence:
• The database layer is abstracted through Prisma; you may have support for both relational (e.g., PostgreSQL) and NoSQL (as seen in “server/src/db/mongo.ts”) databases.
• Migrations and schema updates are tracked within the “server/prisma/migrations” folder.
• External Services & CI/CD:
• GitHub Actions workflows (in “.github/workflows”) are used for CI, security, deployment, and notifications.
• Docker-related files (Dockerfile and docker-compose.yml) indicate containerized deployment for both frontend and backend.
Relationships and Interactions
• The Frontend serves as the client interface (rendering pages, handling user interactions, and making API calls to the backend).
• Communication between the frontend and backend is done using REST APIs and WebSocket connections (for live chat, notifications, etc.).
• The backend exposes endpoints for each key feature (trip planning, expense splitting, itinerary management, location services, polls, and more) and leverages middleware for request validation and error handling.
• The backend interacts with one or more databases to persist user data, trip details, messages, etc.
• Load testing components and reports (present under “server/src/tests/load”) indicate that performance and scalability considerations have been taken into account.
• CI/CD pipelines (e.g., “deploy-frontend.yml”, “push_dockerhub.yml”) automate deployment of the containerized images.
Architectural Patterns and Key Design Principles
• Separation of Concerns: The clear divide between the frontend and backend, with dedicated API routes and controller logic.
• MVC Patterns on the Backend: Controllers, Models, and Middleware are separated to manage API logic and validations.
• Component-Based UI on the Frontend: The UI is built with reusable React components organized into directories (for chat, trips, navigation, etc.).
• Microservice-Like Modules: Although it is a monolith in terms of deployment, the backend is modular, with different controllers and services handling distinct features.
• Use of containers and CI/CD: Dockerfiles and GitHub Actions workflows help manage reproducible builds and automated testing.