A scalable, modular backend system for ride-hailing and logistics, built with NestJS and TypeScript. This monorepo contains multiple microservices, including logging, rider management, and a core Uber-like service, designed for extensibility and maintainability.
- Project Overview
- Monorepo Structure
- Services
- Getting Started
- Development
- Testing
- Docker & Deployment
- API Documentation
- Contributing
- License
This project is a monorepo for Uber-like backend services, leveraging NestJS for modularity and scalability. It is organized into separate applications for core services, logging, and rider management, each with its own domain logic and API endpoints.
uber-services/
├── apps/
│ ├── logging/
│ │ └── src/
│ │ ├── logging.controller.ts
│ │ ├── logging.service.ts
│ │ ├── rider-coordinates/
│ │ │ ├── rider-coordinates.controller.ts
│ │ │ ├── rider-coordinates.service.ts
│ │ │ ├── dto/
│ │ │ │ └── Create-Coordinates.dto.ts
│ │ │ └── schemas/
│ │ │ └── rider-coordinates.schema.ts
│ ├── rider/
│ │ └── src/
│ │ ├── rider.controller.ts
│ │ ├── rider.service.ts
│ └── uber-services/
│ └── src/
│ ├── app.controller.ts
│ ├── app.service.ts
│ └── main.ts
├── docker-compose.yml
├── package.json
├── tsconfig.json
├── README.md
└── ...
- Handles application and ride event logging.
- Includes a
rider-coordinates
module for tracking and storing rider locations.
- Manages rider profiles, registration, and related operations.
- Main entry point for ride-hailing logic, trip management, and orchestration.
-
Clone the repository:
git clone https://github.com/mrrmartin01/uber-services.git cd uber-services
-
Install dependencies:
yarn install
-
Configure environment variables:
- Copy
.env.example
to.env
in each service directory (if present) and update values as needed.
- Copy
Each service can be run independently for development:
# Example: Run the logging service
cd apps/
yarn start logging
# Example: Run the rider service
yarn start rider
# Example: Run the core Uber service
cd apps/uber-services
yarn start:dev
Or use Docker Compose to run all services:
docker-compose up --build
yarn start:dev
— Start a service in development mode (hot reload).yarn build
— Build the service for production.yarn test
— Run unit tests.yarn lint
— Lint the codebase.
Each service includes unit and e2e tests:
# From the root or inside a service directory
yarn run test
yarn run test:e2e
Test files are located in the test/
folders within each service.
- Use
docker-compose.yml
to orchestrate all services and dependencies (e.g., databases). - Build and run all services:
docker-compose up --build
- Stop services:
docker-compose down
- Each service exposes RESTful endpoints. See the respective controller files for details.
- For API testing, use the provided
rest.http
file or tools like Postman. - Consider integrating Swagger (NestJS supports it) for live API docs.
- Fork the repository and create your branch from
master
. - Follow the existing code style and naming conventions.
- Write clear commit messages and document your changes.
- Ensure all tests pass before submitting a pull request.
- For major changes, open an issue first to discuss your proposal.
This project is licensed under the MIT License. See LICENSE for details.
For questions or support, please open an issue or contact the maintainer at Theophilus Martin