Skip to content

Latest commit

 

History

History
47 lines (33 loc) · 1.47 KB

README.md

File metadata and controls

47 lines (33 loc) · 1.47 KB

Rotas - Backend

The backend for the Rotas project is responsible for managing bus routes and related data. The public transport data is generated by the generate_data directory.

Project Structure

The backend project is organized as follows:

  • src/core: Contains the core logic and entities for managing buses and routes.
  • src/data: Stores data files generated by the generate_data directory.
  • src/interfaces: Provides interfaces for controllers and repositories.
  • src/server.js: The main server file.

Data Generation

The public transport-related data, including information about bus stops, bus routes, and connections, is generated by the generate_data directory. To generate the data, follow the instructions in the generate_data directory's README.

Getting Started

  1. Clone the repository:
git clone https://github.com/JefferMarcelino/rotas.git
cd rotas/backend
  1. Install dependencies:
npm install
  1. Start the server (development):
npm run dev

The server will be up and running, and you can access the provided endpoints.

Endpoints

  • GET /health: Check the health of the service.
  • GET /buses: Retrieve a list of all buses.
  • GET /bus/:busId: Get details of a specific bus by its ID.
  • GET /stops: Get a list of all stops.
  • GET /stops/near: Find the nearest stop based on location data.
  • GET /stop/:stopId: Get details of a specific stop by its ID.
  • GET /path: Find routes and paths for bus journeys.