is app will help you public transportation in citys that makes easy to now what time will go and what time will stop this app is development level
- Method: POST
- Endpoint: /signup
- Description: Creates a new admin with the provided name, email, and password in the request body.
- Response:
- Status: 201 (Created)
- Body:
- message: "admin successfully created."
- admin: The newly created admin object
- Method: POST
- Endpoint: /login
- Description: Authenticates an admin with the provided email and password in the request body.
- Response:
- Status: 200 (OK)
- Body:
- message: "Login successful."
- token: A JSON Web Token (JWT) for authentication
- Method: POST
- Endpoint: /signup
- Description: Creates a new user with the provided name, email, and password in the request body.
- Response:
- Status: 201 (Created)
- Body:
- message: "user successfully created."
- user: The newly created user object
- Method: POST
- Endpoint: /login
- Description: Authenticates a user with the provided email and password in the request body.
- Response:
- Status: 200 (OK)
- Body:
- message: "Login successful."
- token: A JSON Web Token (JWT) for authentication
- Method: GET
- Endpoint: /
- Description: Retrieves all buses.
- Response:
- Status: 200 (OK)
- Body: An array of bus objects
- Method: GET
- Endpoint: /:id
- Description: Retrieves a bus by its ID.
- Response:
- Status: 200 (OK)
- Body: The bus object with the specified ID
- Method: POST
- Endpoint: /add
- Description: Creates a new bus with the provided number and capacity in the request body.
- Response:
- Status: 200 (OK)
- Body: The newly created bus object
- Method: PUT
- Endpoint: /update/:id
- Description: Updates a bus with the provided number and capacity in the request body, based on its ID.
- Response:
- Status: 200 (OK)
- Body: The updated bus object
- Method: DELETE
- Endpoint: /delete/:id
- Description: Deletes a bus with the specified ID.
- Response:
- Status: 200 (OK)
- Body:
- message: "Bus deleted successfully."
Route: POST /location/add
Request Body:
{
"name": "Location Name",
"latitude": 123.456,
"longitude": 987.654,
"routeId": 1
}
{
"id": 1,
"name": "Location Name",
"latitude": 123.456,
"longitude": 987.654,
"routeId": 1
}
Route: put /location/update/:id
Request Body:
{
"name": "New Location Name",
"latitude": 12.345,
"longitude": 98.765,
"routeId": 2
}
{
"id": 1,
"name": "New Location Name",
"latitude": 12.345,
"longitude": 98.765,
"routeId": 2
}
Route: delete /location/delete/:id
Request Body:
{
"message": "Location deleted successfully"
}
Route: get /routes
Request Body:
[
{
"id": 1,
"name": "Route 1"
},
{
"id": 2,
"name": "Route 2"
}
]
Route: get /routes/:id
Request Body:
{
"id": 1,
"name": "Route 1"
}
Route: post /routes/add
Request Body:
{
"name": "New Route"
}
{
"id": 3,
"name": "New Route"
}