Skip to content

letlabs-ndj/tripee

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

78 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spring Boot Microservices Application for Tripee

This project is a Spring Boot-based microservices architecture for our ridesharing application Tripee. The application is built using microservices to ensure modularity, scalability, and flexibility in deployment. Each service is self-contained with its own business logic and can communicate with other services.

Table of Contents


Overview

This application contains the following microservices:

  • Config Server: Centralized configuration management for all services.
  • Discovery Service: Service registry and discovery for efficient inter-service communication.
  • Account Service: Manages user accounts and authentication.
  • Ride Service: Handles ride management and tracking.
  • Expedition Service: Manages user expeditions.
  • Reservation Service: Manages user ride reservation.
  • Chat Service: Enables real-time messaging between users.
  • Notification Service: Sends notifications for events and updates.
  • API Gateway: Entry point for client requests, routing them to respective services.

Getting Started

These instructions will help you set up and run the application on your local machine for development and testing purposes.

Prerequisites

  • Java 17 or higher
  • Maven 3.8 or higher
  • Docker (for running containers)
  • Twilio Account (for OTP authentication, see below)

Running the Application

  1. Clone the Repository:

    git clone --recurse-submodules https://github.com/Lameute-Org/CGWEB-lameute-tripee.git
    cd spring-boot-backend/tripee/services
  2. Twilio Setup for OTP Authentication
    To enable OTP (One-Time Password) authentication, you’ll need a Twilio Account. Twilio provides a free trial account with limited features, including the ability to authenticate the phone number registered during the account creation. To set up Twilio for OTP, follow these steps:

    • Create a Twilio Account at Twilio's Website.

    • In your Twilio Console, find and copy the following credentials:

      • ACCOUNT SID: Your Twilio Account SID
      • AUTH TOKEN: Your Twilio Auth Token
    • Once your account is created, create a new verify service. You can follow the steps on Create verify service (Configure your otp to 4-digits). Find and copy the following credential:

      • SERVICE ID: Your Twilio Service SID for OTP messaging
    • Add all these credentials to the account-service.yml file located in the resources folder of the config-server. Set the properties as follows:

      twilio:
        account_sid: ${TWILIO_ACCOUNT_SID}
        auth_token: ${TWILIO_AUTH_TOKEN}
        service_id: ${TWILIO_SERVICE_ID}

    Note: Twilio's free account will limit OTP messages to the registered phone number until upgraded to a paid plan.

    Note: Follow the next steps in the order specified below.

  3. Start Docker Containers: Use docker-compose to run the necessary containers (database containers, Kafka, etc.) defined in the root docker-compose.yml file:

    docker-compose up -d
  4. Run Config Server: Navigate to the config-server directory and start the service:

    cd config-server
    mvn spring-boot:run
  5. Run Discovery Service: Navigate to the discovery-service directory and start the service:

    cd discovery-service
    mvn spring-boot:run
  6. Run Business Services: For each of the following services, navigate to the respective directory and execute the command to start the service:

    • Account Service:

      cd account-service
      mvn spring-boot:run
    • Ride Service:

      cd ride-service
      mvn spring-boot:run
    • Reservation Service:

      cd reservation-service
      mvn spring-boot:run
    • Expedition Service:

      cd expedition-service
      mvn spring-boot:run
  7. Run API Gateway: Finally, navigate to the api-gateway directory and start the gateway service:

    cd api-gateway
    mvn spring-boot:run

API Documentation

Each microservice is accessible through a base url and provides a Swagger documentation, accessible on the link provided on the table.

Microservice Base URL Swagger Documentation
Config Server http://localhost:8888 -
Discovery Service http://localhost:8761 -
Account Service http://localhost:8089/users Link
Ride Service http://localhost:8089/rides Link
Expedition Service http://localhost:8089/expeditions Link
Reservation Service http://localhost:8089/reservations Link
Chat Service http://localhost:8080/chat Link
Notification Service - -
API Gateway http://localhost:8089 -

Note: All external requests should be routed through the API Gateway on port 8089, except for the Chat Service, which is accessed directly on its specific port.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published