/SafeBike

SafeBike Rwanda backend implementation using Nodejs, Fastify, Postgres with TypeORM

Primary LanguageTypeScript

๐Ÿ๏ธ SafeBike Rwanda API ๐Ÿ“ฆ

Connect, Deliver, Thrive - A modern package delivery platform for Rwanda ๐Ÿ‡ท๐Ÿ‡ผ

๐Ÿ“‹ Overview

SafeBike is a revolutionary API that connects passengers who need to send packages with riders who can deliver them. Our platform enables fast, secure, and trackable deliveries across Rwanda with real-time updates and confirmations.

โœจ Features

  • ๐Ÿ‘ค User Management

    • Passenger registration and authentication
    • Rider registration and authentication
    • Profile management
  • ๐Ÿ“ฆ Package Management

    • Create package delivery requests
    • Track package status
    • Assign packages to riders
    • Confirm pickup and delivery
    • Recipient confirmation
  • ๐Ÿ”’ Security

    • JWT-based authentication
    • Role-based access control
    • Secure data storage
  • ๐Ÿ“Š API Documentation

    • Comprehensive Swagger documentation
    • Clear endpoint descriptions

๐Ÿ› ๏ธ Technologies

  • Backend: TypeScript, Node.js, Fastify
  • Database: PostgreSQL
  • ORM: TypeORM
  • Authentication: JWT
  • Documentation: Swagger/OpenAPI

๐Ÿš€ Installation

Prerequisites

  • Node.js (v14+)
  • PostgreSQL
  • Git

Setup Instructions

  1. Clone the repository
git clone https://github.com/your-username/safebike-rwanda.git
cd safebike-rwanda
  1. Install dependencies
npm install
  1. Set up environment variables

DB_HOST=localhost DB_PORT=5432 DB_USER=your_db_user DB_PASSWORD=your_db_password DB_NAME=safebike PORT=5000 JWT_SECRET=your_jwt_secret NODE_ENV=development

  1. Start the server

Development mode

npm run dev

Production mode

npm run build
npm start

๐Ÿ“ API Documentation

http://localhost:5000/api-docs

๐Ÿ”„ Workflow

  1. ๐Ÿ‘ค Passenger creates an account
  2. ๐Ÿ๏ธ Rider creates an account
  3. ๐Ÿ“ฆ Passenger creates a package delivery request
  4. ๐Ÿ” Rider accepts package delivery
  5. ๐Ÿšš Rider confirms pickup
  6. ๐Ÿ Rider marks delivery as completed
  7. โœ… Recipient confirms package receipt

๐Ÿงช Testing

Run tests


npm test

Run tests with coverage

npm run test:coverage

๐Ÿ“„ License This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ“ž Contact For any inquiries, please reach out to:

Email: niyokwizerwafabrice250@gmail.com Linkedin: NIYOKWIZERWA Fabrice Website:https://niyokwizerwa-fabrice.vercel.app