- Introduction
- Technology Stack
- Tools
- Architecture
- Quality Assurance
- Development Process
- Code Execution and Environment Setup
📖 Overview
This web application follows a Progressive Web App (PWA) model with a client-server architecture.
As a PWA, it offers a smooth experience in the browser, including offline capabilities, installability, and fast performance.
The client manages the user interface dynamically, while the server handles data processing, business logic, and persistence through RESTful APIs.
The application consists of three main components:
- Client: React + TypeScript + Vite PWA.
- Server: Ecosystem of Spring Boot Microservices (API, AI, Notification).
- Infrastructure: Apache Kafka (Event Bus) & PostgreSQL (Data).
This architecture allows scalability and maintainability by separating concerns between the client and server.
📝 Summary
Aspect Description Type Progressive Web App (PWA) with a client-server architecture (Microservices). Technologies React, React Router, TypeScript, Spring Boot, PostgreSQL, Apache Kafka. Tools Visual Studio Code, Git, Docker, Postman. Quality Assurance Unit testing (JUnit, Vitest), Integration testing (RestAssured), E2E testing (Playwright). Deployment TBD Development Process Iterative and incremental, Git version control, GitHub Actions for CI/CD.
🔧 Backend
🚀 Spring Boot
Java framework for building RESTful services with embedded server and production-ready features.
🔐 Spring Security
Framework for securing Spring Boot applications, providing authentication and authorization.
☕️ Java
Object-oriented programming language used for backend services.
📦 Maven
Build automation tool for managing dependencies and building Java projects.
🐘 PostgreSQL
Relational database management system known for its robustness and scalability.
📨 Apache Kafka
Distributed event streaming platform used for asynchronous communication between microservices.
⚛️ Frontend
⚛️ React
JavaScript library for building user interfaces, allowing the creation of dynamic and interactive web applications.
🔗 React Router
Declarative routing for React applications, enabling navigation and URL management.
🛠️ TypeScript
Language that extends JavaScript with static types, enhancing code quality and maintainability.
📦 Vite
Build tool that provides a fast development environment and optimized production builds for modern web applications.
🐳 DevOps
🐳 Docker
Containerization platform for packaging applications and their dependencies into portable containers.
🐳 Docker Compose
Tool for defining and running multi-container Docker applications.
🖥️ Visual Studio Code
IDE for code editing with support for TypeScript, Java, and Docker.
📦 Postman
API Rest Client for testing and interacting with RESTful APIs.
🔧 Git
Version control system for tracking changes in source code during software development.
📦 GitHub
Cloud-based repository hosting service for version control and collaboration.
🪐 System Architecture Overview
Here is a high-level overview of the main components and their relationships in the TripFlow application.
💈 Domain Model Overview
Here is a high-level overview of the main entities and their relationships in the TripFlow application.
🌐 API REST
You can find the complete API documentation generated with SpringDoc OpenAPI by following this link:
💻 Server Architecture Overview
The backend has evolved into a Microservices Architecture, splitting responsibilities into specialized services:
- API Service: Main entry point, handles user requests, authentication, and itinerary management.
- AI Service: Dedicated service for interacting with AI models.
- Notification Service: Manages real-time updates (WebSocket) and emails.
The services communicate asynchronously via Apache Kafka.
🌐 Client Architecture Overview
The frontend follows a component-based architecture pattern, organizing the UI into reusable components:
🧪 Types of Automated Tests
TripFlow implements different types of automated tests to ensure the reliability and correctness of the application:
- Unit Tests
- Backend: They test individual components like services or dependency classes in isolation using JUnit and Mockito.
- Frontend: They test React components, utility functions, and hooks in isolation using Vitest and React Testing Library.
- Integration Tests
- Backend: They test interactions between components (controllers, services, repositories) and the PostgreSQL database using Spring Boot Test and RestAssured.
- End-to-End (E2E) Tests
- They simulate complete user workflows across the frontend and backend using Playwright.
📊 Test Coverage Summary
Layer Coverage (%) Lines Covered Branches (%) Branches Covered Backend 81% 3,990 / 4,891 58% 118 / 283 Frontend 67% 3,415 / 5,083 87% 439 / 505 Overall 74% 7,405 / 9,974 71% 557 / 788
⚠️ Full detailed reports are available inindex.htmlfiles generated by JaCoCo (backend) and Vitest (frontend). In order to view them, open the files contained in thedocs/coveragedirectory with your web browser.
🚀 Overview
The application uses Dokploy, a self-hosted implementation of a PaaS (Platform as a Service), running on a dedicated VPS (Virtual Private Server). This approach provides a robust, production-ready environment similar to Vercel or Netlify but with full control over the infrastructure and significantly lower costs.
🛠️ Infrastructure Stack
🐳 Dokploy & Traefik
Dokploy simplifies the management of Docker containers and serves as a comprehensive dashboard for deployments. It utilizes Traefik under the hood as a powerful edge router and reverse proxy.
How it works:
- Traefik listens on ports 80 and 443 of the VPS.
- It automatically discovers running Docker containers via the Docker socket.
- Using labels defined in
docker-compose.dokploy.yaml, Traefik routes external traffic (e.g.,tripflow.cub1z.es) to the specific container within the internaldokploy-network.- This abstraction eliminates the need to expose ports like 8080 or 3000 to the public internet, enhancing security.
☁️ Cloudflare
Cloudflare is used for DNS management and DDOS protection. It points the application domains to the VPS IP address. It serves as the first entry point for traffic, providing caching and an additional security layer.
🔒 SSL Certificates (Let's Encrypt)
Dokploy integrates natively with Let's Encrypt. It automatically handles the challenge/response process to generate and renew SSL/TLS certificates for all deployed domains. This ensures that all connections are secure (HTTPS) without manual certificate management.
📦 Deployment Configuration
The production deployment is defined in the
docker/docker-compose.dokploy.yamlfile. This file is specifically tailored for the Dokploy environment.Key Configuration Files:
docker/docker-compose.dokploy.yaml: Defines services, networks, and Traefik labels..env: Located on the server in the deployment directory. Contains sensitive variables (DB passwords, API keys)..env.example: A reference template in the repository showing which variables are required.Deployment Workflow:
- Build & Push: The CI/CD pipeline (GitHub Actions) builds Docker images for all services and pushes them to DockerHub tagged as
:latest.- Trigger: Upon successful build, the pipeline uses the
benbristow/dokploy-deploy-actionto notify the Dokploy server via a secure webhook (if secrets are configured).- Pull & Deploy: Dokploy receives the signal, pulls the latest images from DockerHub, and executes
docker compose up -dusing thedocker/docker-compose.dokploy.yamlfile.- Routing: Traefik detects the new containers and instantly routes traffic to them, ensuring zero-downtime deployments.
🎯 Development Methodology
TripFlow follows an iterative and incremental development process based on Agile principles from the Agile Manifesto. The development approach incorporates selected best practices from Extreme Programming (XP) and Kanban methodologies.
XP Practices Implemented:
- Continuous integration with automated testing.
- Refactoring for code quality improvement.
- Simple design and clean code principles.
Kanban Elements:
- Visual workflow management through GitHub Projects.
- Work-in-progress (WIP) limits.
📋 Task Management
GitHub Projects
Project organization is managed through GitHub Projects, providing progress tracking and reporting dashboards. The project board is divided into columns representing different stages of the development process:
- 🎯 To Do: Prioritized tasks ready for development. Limited to 15 TODO tasks.
- ⚙️ In Progress: Currently being worked on. Limited to 5 tasks in progress.
- ✅ Done: Completed and deployed features. Tasks are moved here after finishing and merging.
🌿 Git Workflow & Branching Strategy
🔀 Branching Workflow
- Feature Development: Create
feat-*branches fromdevelop- Integration: Regular merges to
developbranch- Release: Periodic merges from
developtomain📊 Git Metrics
Metric Value Total Commits TBD Total Branches TBD Active Feature Branches TBD Contributors TBD Average Commits/Week TBD Code Review Coverage TBD
🔄 Continuous Integration CI
⚙️ GitHub Actions Workflows
The project implements automated CI pipelines using GitHub Actions with the following workflows:
1. Unit Tests Workflow (
ci-unit-tests.yaml):Triggers:
- Push to
main,develop, andfeat-*branches- Pull requests to
mainanddevelop- Manual workflow dispatch
- Path-based filtering for backend and frontend changes
Backend Unit Testing:
- ☕️ Java 21 with Temurin distribution setup
- 📦 Maven dependency caching for faster builds
- 🧪 Unit tests execution with
mvn test -Dgroups=unit- 🔐 Secure environment variables (JWT_SECRET, POSTGRES_PASSWORD)
Frontend Unit Testing:
- 🟢 Node.js 24 environment setup
- 📦 NPM dependency installation and caching
- 🧪 Vitest test execution with
npm run test --watch=false2. Integration Tests Workflow (
ci-integration-tests.yaml):Triggers:
- Push to
mainanddevelopbranches- Pull requests to
mainbranch- Backend code changes only (path filtering)
- Manual workflow dispatch
Backend Integration Testing:
- 🐘 PostgreSQL database integration testing
- 🧪 Integration tests with
mvn test -Dgroups=integration- 🔐 Environment-specific configuration
- 📊 Comprehensive test result reporting
3. End-to-End Tests Workflow (
ci-e2e-tests.yaml):Triggers:
- Push to
mainanddevelopbranches- Pull requests to
mainbranch- Backend, frontend, or E2E code changes (path filtering)
- Manual workflow dispatch
E2E Testing Pipeline:
- 🟢 Node.js LTS environment setup
- 🐳 Docker Compose for test environment orchestration
- 📦 E2E dependencies installation with
npm ci- 🎭 Playwright browser installation with dependencies
- ⏳ Health check waiting for services to be ready
- 🧪 Full E2E test suite execution with Playwright
- 🔗 Tests integration across frontend, backend, and database
🔄 Continuous Deployment CD
⚙️ GitHub Actions Workflows
The project implements automated CD pipelines using GitHub Actions with the following workflows:
1. Development Deployment Workflow (
cd-dev.yaml):Triggers:
- Push to
mainbranch- Automatic deployment on successful merge
Development Build Pipeline:
- 🔄 Reuses
cd-build.yamlworkflow withdevtag- 🐳 Builds and pushes Docker images to DockerHub
- 📦 Uses
docker-compose-dev.yamlfor configuration- 🏷️ Tags images as:
cub1z/tripflow-backend:devandcub1z/tripflow-frontend:dev- 📦 Publishes docker-compose as OCI artifact with
devtag2. Release Deployment Workflow (
cd-release.yaml):Triggers:
- GitHub Release publication (event:
published)- Manual release creation through GitHub UI
Release Build Pipeline:
- 🏷️ Three-stage deployment:
- Release Tag Job: Builds with specific version tag (e.g.,
0.1.0)- Latest Tag Job: Updates
latesttag to point to new release- Dokploy Trigger Job: Automatically deploys the new images to the Dokploy server
- 🔄 Build jobs reuse
cd-build.yamlworkflow- 🐳 Pushes images to DockerHub with version and latest tags
- 📦 Uses
docker-compose.yamlfor production configuration- � Automated & Conditional Deployment:
- The Dokploy trigger only runs if
DOKPLOY_URL,DOKPLOY_AUTH_TOKEN, andDOKPLOY_COMPOSE_IDsecrets are configured.- Uses
benbristow/dokploy-deploy-actionto notify the VPS to pull and restart the stack.3. Manual Deployment Workflow (
cd-manual.yaml):Triggers:
- Manual workflow dispatch from GitHub Actions UI
- Can be triggered from any branch at any commit
Manual Build Pipeline:
- 📋 Prepare Stage:
- Extracts branch name from
GITHUB_REF- Generates timestamp in format
YYYYMMDD-HHMM- Gets short commit SHA (7 characters)
- Creates dynamic tag:
<branch>-<timestamp>-<commit>- Updates
docker-compose-dev.yamlwith generated tag- 🏗️ Build Stage:
- Reuses
cd-build.yamlworkflow with dynamic tag- Example tag:
feat-maps-20250113-1430-a7b3c9d4. Build and Publish OCI Artifacts Workflow (
cd-build.yaml):Triggers:
- Reusable workflow called by other CD workflows
- Not directly triggered by events
Inputs:
tag(required): Docker image tag to usecompose_file(required): Path to docker-compose fileservices(required): JSON array of services to build paths (e.g.,["backend/api-service", "frontend"])Build and Publish Process:
- 🔐 Authenticates with DockerHub using secrets
- 🏗️ Matrix strategy builds multiple services in parallel
- 🏷️ Dynamic Naming:
- Computes image suffix from service path (e.g.,
backend/api-service→api-service)- Sanitizes names to lowercase and standard format
- 🐳 Build & Push:
- Context: Auto-detected (
./frontendor./backend)- Dockerfile:
./<service_path>/Dockerfile- Tag:
docker.io/cub1z/tripflow-<suffix>:<tag>- 📤 Publish Compose Artifact:
- Uses native
docker compose publish- Pushes to:
docker.io/cub1z/tripflow-compose:<tag>- Optimized: Only executed once per workflow run
📦 Release Management
🎯 Release Process
TripFlow follows a structured release process to ensure version consistency across all components and artifacts. Each release is tagged and published with corresponding Docker images and compose files.
📋 Pre-Release Checklist:
Before creating a release, ensure the following steps are completed:
- ✅ All tests passing (unit, integration, E2E)
- ✅ Code review completed and approved
- ✅ Documentation updated
- ✅ Changelog prepared with release notes
- ✅ Version numbers updated in configuration files
🔄 Version Update Workflow
Pre-Release Version Update:
Before creating a GitHub release, update version numbers in the following files:
# Backend (pom.xml) <version>0.1.0</version> # Frontend (package.json) "version": "0.1.0" # Docker Compose (docker/docker-compose.yaml) image: cub1z/tripflow-backend:0.1 image: cub1z/tripflow-frontend:0.1Post-Release Version Update:
After the release is created, immediately update versions for the next development cycle:
# Backend (pom.xml) <version>0.2.0-SNAPSHOT</version> # Frontend (package.json) "version": "0.2.0" # Docker Compose (docker/docker-compose.yaml) image: cub1z/tripflow-backend:0.2 image: cub1z/tripflow-frontend:0.2
🏷️ Creating a GitHub Release
- Navigate to the repository on GitHub
- Click on "Releases" → "Draft a new release"
- Create a new tag (e.g.,
0.1.0)- Set the release title (e.g.,
Release 0.1.0)- Add release notes describing changes, features, and fixes
- Publish the release
The automated CI/CD pipeline will:
- Build Docker images with the release tag
- Push images to DockerHub with version tag and
latesttag- Publish docker-compose.yaml as OCI artifact
🐳 Docker Artifacts
Docker Compose Files:
File Purpose Image Source docker-compose.yamlProduction deployment 0.1(Hub)docker-compose.dev.yamlDevelopment deployment dev(Hub)docker-compose.local.yamlLocal full stack dev build(Local)docker-compose.test.yamlE2E Testing environment build(Local)docker-compose.infra.yamlInfrastructure only (DB, Kafka) Official Images DockerHub Repository Structure:
cub1z/tripflow-api-service cub1z/tripflow-ai-service cub1z/tripflow-notification-service cub1z/tripflow-frontend ├── 0.1.0 (release version) ├── latest (points to latest release) └── dev (development/unstable) cub1z/tripflow-compose (OCI Artifact) └── contains docker-compose.yaml with service references
🚀 Deployment Artifacts
After a successful release, the following artifacts are available:
GitHub:
- Release tag with source code snapshot
- Release notes and changelog
- Downloadable source archives (zip/tar.gz)
DockerHub:
- API Service image:
cub1z/tripflow-api-service:tag- AI Service image:
cub1z/tripflow-ai-service:tag- Notification Service image:
cub1z/tripflow-notification-service:tag- Frontend image:
cub1z/tripflow-frontend:tag- Docker compose OCI artifact:
cub1z/tripflow-compose:tag- Latest tags updated to point to the new release
📊 Release History
Version Release Date Highlights 0.1.0 15 nov 2025 Initial MVP release with core functionality 0.2.0 08 feb 2026 Advanced features such as AI and notifications 1.0.0 TBD Production release with all features
📥 Clone and access the Repository You can clone the repository using the following command:
git clone https://github.com/codeurjc-students/2025-TripFlow.git TripFlow cd TripFlow
💻 Running the Application Locally (Without Docker)
To run TripFlow locally for development purposes, you need to set up the database, backend, and frontend separately.
📋 Prerequisites:
- Java 21 - Download JDK
- Node.js 24+ - Download Node.js
- PostgreSQL 15+ - Download PostgreSQL
- Apache Kafka - (If running locally without Docker)
- Maven 3.9+ - Included with the project (Maven Wrapper)
🐘 Step 1: Setup PostgreSQL Database
You can set up PostgreSQL using Docker like this:
docker run --name tripflow-postgres -e POSTGRES_USER=YOUR_USER -e POSTGRES_PASSWORD=YOUR_PASSWORD -e POSTGRES_DB=tripflow_db -p 5432:5432 -d postgres:latest
🛠️ Step 2: Configure Service Configuration
Each microservice has its own configuration file. You must ensure that the
application.propertiesin each service is configured correctly, especially for Database and Kafka connections.Configuration Files:
- API Service:
backend/api-service/src/main/resources/application.properties- AI Service:
backend/ai-service/src/main/resources/application.properties- Notification Service:
backend/notification-service/src/main/resources/application.propertiesEnsure the following settings match your local environment:
- Database:
spring.datasource.url,username,password- Kafka:
spring.kafka.bootstrap-servers- JWT Secret:
app.jwt.secret(ensure it's consistent across services)
☕ Step 3: Run the Backend Services
Since the backend consists of multiple microservices, the recommended way to run the application is using Docker Compose (see below).
If you wish to run services individually for development, you must first ensure PostgreSQL and Kafka are running. You can start these infrastructure services using:
docker compose -f docker/docker-compose.infra.yaml up -dThen, start each service:
# Linux / macOS # Terminal 1 cd backend/api-service && ../mvnw spring-boot:run # Terminal 2 cd backend/ai-service && ../mvnw spring-boot:run # Terminal 3 cd backend/notification-service && ../mvnw spring-boot:run# Windows # Terminal 1 cd backend/api-service ../mvnw.cmd spring-boot:run # Terminal 2 cd backend/ai-service ../mvnw.cmd spring-boot:run # Terminal 3 cd backend/notification-service ../mvnw.cmd spring-boot:run
⚛️ Step 4: Run the Frontend
Navigate to the
frontenddirectory and start the Vite development server:# Install dependencies (first time only) npm install # Start development server npm run devThe frontend will start on http://localhost:5173
🌐 Step 5: Access the Application
Once both services are running:
- Frontend: http://localhost:5173
- Backend API: http://localhost:8080/api
🐳 Running the app with Docker Compose
You can also run the entire application using Docker Compose.
📋 Prerequisites:
- Docker Desktop for Windows or MacOS - Download Docker Desktop
- Docker Engine for Linux - Install Docker Engine
🚀 Start the application using Docker Compose
Navigate to the
dockerdirectory and run the following command:docker compose -f docker-compose.dev.yaml up -dThis command will pull the necessary Docker images and start the services in detached mode.
🪧 Postman Usage
If you want to test the backend API endpoints, you can use Postman. Import the provided Postman collection root directory
TripFlow.postman_collection.jsoninto Postman and start testing the API endpoints.If you don't have Postman installed, you can download it from here.
🧪 Running Tests
To run the following tests, we recommend having Docker Desktop installed and running for Windows or MacOS and Docker Engine for Linux.
Navigate to the
scriptsdirectory where you will find the test scripts for backend, frontend, and E2E tests.Here are the commands to run the different types of tests included in the project:
Backend Tests:
# For Linux and MacOS ./run-backend-test.sh # For Windows run-backend-test.cmdFrontend Tests:
# For Linux and MacOS ./run-frontend-test.sh # For Windows .\run-frontend-test.cmdE2E Tests:
# For Linux and MacOS ./run-e2e-test.sh # For Windows .\run-e2e-test.cmdBackend and Frontend test scripts will generate coverage reports in the
docs/coveragedirectory. You can open theindex.htmlfiles in your web browser to view the coverage reports.



