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.
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 thegenerate_data
directory.src/interfaces
: Provides interfaces for controllers and repositories.src/server.js
: The main server file.
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.
- Clone the repository:
git clone https://github.com/JefferMarcelino/rotas.git
cd rotas/backend
- Install dependencies:
npm install
- Start the server (development):
npm run dev
The server will be up and running, and you can access the provided 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.