How nahiavazquez/globetrek works
Main Components
a. Frontend (User Interface)
• Represented by the “globetrek” directory.
• Built using React (with supporting files like package.json, public folder, and numerous components including login & registration flows).
• Interacts with the backend via the Gateway.
b. Gateway
• Found in the “gateway” directory.
• Acts as a central routing point (using FastAPI with uvicorn on port 8888 as per launch command).
• Routes API requests to the respective microservices.
c. Microservices (Backend):
• Microservice for User Management:
• Located in “backend”.
• Uses FastAPI to provide RESTful endpoints.
• Uses PostgreSQL (as per README mentions) for storage.
• Contains CRUD operations for users, authentication tokens, and schema definitions.
• Microservice for Itinerary and Destination Management:
• Found in “nodeAPI”.
• Created with Node.js (based on package.json, Dockerfile, and usage instructions).
• Uses MongoDB for itinerary and destination collections.
• Also integrates with Ollama (external service) for generating personalized itineraries.
d. External Dependencies and Infrastructure:
• Databases: PostgreSQL (for users) and MongoDB (for itineraries and destinations).
• Ollama: External AI model for custom itinerary generation.
• Docker & Docker Compose: Containers are used to deploy the various components.
• Additional tools like Python, NodeJS are noted in the README for local development.
Relationships and Interactions
• The Frontend sends requests to the Gateway.
• The Gateway then forwards these requests to the appropriate microservice:
• User requests are forwarded to the FastAPI-based user management service (backend).
• Itinerary and destination requests are sent to the Node.js service (nodeAPI).
• Each microservice accesses its corresponding database (e.g., PostgreSQL for users, MongoDB for itineraries/destinations).
• When a user requests a personalized itinerary, the backend interacts with the external Ollama service to process or generate itinerary details.
Architectural Patterns and Design Principles
• Microservices architecture: The separation of functionalities into distinct deployable services.
• API Gateway Pattern: The use of a gateway to abstract and route client requests to the correct microservice.
• Containerization: Use of Docker and related deployment files (Dockerfile in several directories, docker-compose.yaml) to ensure portability and environment consistency.
• Separation of concerns: Each service (backend, nodeAPI, gateway, and frontend) handles distinct responsibilities.
Relevant Technologies, Frameworks, and Libraries
• Backend: FastAPI (Python) and uvicorn; PostgreSQL.
• Itineraries/Destinations Service: Node.js, Express (likely from the use of package.json), and MongoDB.
• Frontend: React (with JavaScript/TypeScript components, yarn for package management).
• Docker: Containerization (with Dockerfiles and docker-compose setup).
• External Software: Ollama (for AI-based itinerary customization).
Specific Elements
• “Frontend (React)” for the UI.
• “API Gateway (FastAPI)” – label its role in routing.
• “User Service (FastAPI)” – label and note its dependency on PostgreSQL.
• “Itinerary & Destination Service (Node.js)” – note its dependency on MongoDB.
• “Ollama Service” – as an external service for generating personalized itineraries.
• Containers for each microservice (possibly encapsulated in Docker containers).
• Database servers vs. application services.
• Annotations for protocols or ports can be added (e.g., HTTP, port 8000 for user management, port 8888 for the gateway).