This application is a robust learning platform designed to provide training in various fields, including First Aid and Anatomy. The platform includes Android and web clients, enabling participants to enroll in courses, take quizzes, and earn certifications upon successful completion. Advanced features include Augmented Reality (AR) modules for interactive learning and Artificial Intelligence (AI) tools to provide feedback on CPR training using video analysis.
The platform is built on a microservices architecture and follows modern development and deployment practices, such as CI/CD pipelines, containerization, and observability.
- Prerequisites
- Architecture
- Functionalities
- Project Structure
- CI/CD Pipeline
- Docker Configuration
- Getting Started
- Deployment
- Monitoring and Logging
- Security Considerations
- Demo
- Contributors
- License
- Java JDK 11 or higher
- Node.js 14.x or higher
- Android Studio 4.x or higher
- Git
- Docker and Docker Compose
- Jenkins server (port 8080)
- SonarQube server (port 9000)
- Nexus Repository (ports 5001-5003)
- Docker Registry
- Ubuntu servers for test and production environments
The system consists of three main components:
- Web Client: A React-based frontend for both participants and administrators.
- Mobile Client: A native Android application tailored for participants.
- Backend Services: Microservices architecture to manage core functionalities like training content, quizzes, and certifications.
The CI/CD pipeline automates the build, testing, and deployment processes:
- Developer pushes code to GitHub.
- Jenkins triggers the build process.
- Maven builds the project and runs unit tests.
- SonarQube performs code analysis and quality checks.
- Docker images are built and pushed to the Docker registry.
- The application is deployed to test and production environments.
- Authentication: Secure login via Keycloak using JWT and OpenID Connect.
- Course Enrollment: Browse and enroll in courses categorized by topics.
- AR-Based Learning: Participate in interactive AR training sessions.
- AI-Powered Feedback: Receive AI-driven feedback on CPR training performance.
- Quiz and Certification: Take quizzes after training and earn certifications.
- Course Management: Create, update, and manage training courses.
- Participant Monitoring: Track participant progress and quiz results.
├── backend/
│ ├── microservices/
│ ├── config/
│ └── docker-compose-local.yml
└── Jenkinsfile
├── web-client/
│ ├── src/
│ └── Dockerfile
├── mobile-client/
├── app/
└── Dockerfile
-
Source Code Management:
- GitHub repository integration.
- Branch strategy: main and develop.
-
Build & Test:
- Maven build and unit testing.
- Integration testing.
-
Code Quality:
- SonarQube analysis (port 9000).
- Code coverage reports.
- Quality gates enforcement.
-
Artifact Management:
- Nexus Repository Manager for artifact storage.
- Docker image storage and version management.
-
Deployment:
The platform uses Docker Compose to manage its services:
- Keycloak: Authentication and user management.
- MySQL: Database for storing user data and training information.
- Backend Microservices: Handle course content, authentication, and notifications.
- Observability Stack: Includes Grafana, Prometheus, Loki, and Tempo.
A sample docker-compose.yml
file is included for local setup.
version: "3.8"
services:
mysql-participant:
image: docker.io/mysql:8.0
container_name: mysql-participant
environment:
- MYSQL_DATABASE=first_aid_participant_bd
- MYSQL_ROOT_PASSWORD=root
volumes:
- mysql_participant_data:/var/lib/mysql
ports:
- "3306:3306"
networks:
- app-network
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
interval: 30s
timeout: 10s
retries: 5
mysql-training:
image: docker.io/mysql:8.0
container_name: mysql-training
environment:
- MYSQL_DATABASE=first_aid_training_bd
- MYSQL_ROOT_PASSWORD=root
volumes:
- mysql_training_data:/var/lib/mysql
ports:
- "3307:3306"
networks:
- app-network
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
interval: 30s
timeout: 10s
retries: 5
phpmyadmin:
image: docker.io/phpmyadmin/phpmyadmin:latest
container_name: phpmyadmin-firstaid
ports:
- "8089:80"
networks:
- app-network
environment:
PMA_HOSTS: mysql-participant,mysql-training
PMA_PORTS: 3306,3306
config-service:
image: ${NEXUS_PRIVATE}/config-service:${VERSION:-latest}
container_name: config-service
ports:
- "9999:9999"
networks:
- app-network
depends_on:
discovery-service:
condition: service_healthy
environment:
- SPRING_PROFILES_ACTIVE=dev
- EUREKA_CLIENT_SERVICEURL_DEFAULTZONE=http://discovery-service:8761/eureka/
healthcheck:
test: [ "CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:9999/actuator/health" ]
interval: 30s
timeout: 10s
retries: 5
start_period: 60s
discovery-service:
image: ${NEXUS_PRIVATE}/discovery-service:${VERSION:-latest}
container_name: discovery-service
ports:
- "8761:8761"
networks:
- app-network
healthcheck:
test: [ "CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:8761/actuator/health" ]
interval: 30s
timeout: 10s
retries: 5
start_period: 60s
gateway-service:
image: ${NEXUS_PRIVATE}/gateway-service:${VERSION:-latest}
container_name: gateway-service
ports:
- "8888:8888"
networks:
- app-network
depends_on:
- discovery-service
environment:
- SPRING_PROFILES_ACTIVE=dev
- SPRING_CONFIG_IMPORT=optional:configserver:http://config-service:9999
- SPRING_CLOUD_CONFIG_URI=http://config-service:9999
- EUREKA_CLIENT_SERVICEURL_DEFAULTZONE=http://discovery-service:8761/eureka/
participant-service:
image: ${NEXUS_PRIVATE}/participant-service:${VERSION:-latest}
container_name: participant-service
ports:
- "8082:8082"
networks:
- app-network
depends_on:
mysql-participant:
condition: service_healthy
discovery-service:
condition: service_healthy
environment:
- SPRING_PROFILES_ACTIVE=dev
- SPRING_CONFIG_IMPORT=optional:configserver:http://config-service:9999
- SPRING_CLOUD_CONFIG_URI=http://config-service:9999
- EUREKA_CLIENT_SERVICEURL_DEFAULTZONE=http://discovery-service:8761/eureka/
training-service:
image: ${NEXUS_PRIVATE}/training-service:${VERSION:-latest}
container_name: training-service
ports:
- "8081:8081"
networks:
- app-network
depends_on:
mysql-training:
condition: service_healthy
discovery-service:
condition: service_healthy
environment:
- SPRING_PROFILES_ACTIVE=dev
- SPRING_CONFIG_IMPORT=optional:configserver:http://config-service:9999
- SPRING_CLOUD_CONFIG_URI=http://config-service:9999
- EUREKA_CLIENT_SERVICEURL_DEFAULTZONE=http://discovery-service:8761/eureka/
volumes:
mysql_participant_data:
mysql_training_data:
networks:
app-network:
driver: bridge
# Clone repository
git clone https://github.com/Mohammedaoudi/Coursey.git
# Navigate to backend directory
cd backend
# Start local environment
docker-compose -f docker-compose-local.yml up -d
# Navigate to web client directory
cd web
# Install dependencies
npm install
# Start development server
npm start
# Open project in Android Studio
# Configure gradle settings
# Build and run on emulator/device
- Server: 192.168.1.26
- Docker Configuration:
docker-compose.yml
- Deployment: Automated via Jenkins.
- Server: 192.168.1.66
- Docker Configuration:
docker-compose.prod.yml
- Deployment Process: Manual approval with rollback options.
# Local development deployment
docker-compose -f docker-compose-local.yml up -d
# Test environment deployment
docker stack deploy -c docker-compose.yml app_stack
# Production deployment
docker stack deploy -c docker-compose.yml app_stack
- Build Monitoring: Jenkins pipelines track build status.
- Code Quality Metrics: SonarQube for static analysis and quality gates.
- Container Logs: Managed via Loki and visualized in Grafana.
- Application-Level Logs: Managed via Tempo.
- HTTPS Enforcement: Ensures secure communication.
- JWT Authentication: Secures API endpoints.
- Docker Best Practices: Minimizes vulnerabilities.
- Network Segmentation: Isolates test and production environments.
A detailed video demonstration is available
WhatsApp.Video.2024-12-27.a.19.23.46_55bbf6c5.1.1.mp4
WhatsApp.Video.2024-12-27.a.19.24.19_d53ad2d6.1.mp4
- DAOUDI Mohammed
This project is licensed under the MIT License. See the LICENSE.md file for details.