The API backend for Radio 2000. Created using Node.js with the Express framework. Deployed to the web using Vercel (check it out). Remote database made possible with Firestore.
- API endpoint for List of radio stations
- API endpoint for singular radio station
- API endpoint for obtaining details about a user
- Support the API with a database
- Implement the endpoints as either a REST API or a GraphQL API
- Mechanism or tool available for adding data into the database
- Introduce a migration tool for managing the database schema
- Ensure the steps are outlined for how to run the application
- Provide an openAPI or swaggerhub schema file explaining your API
- Unit test your application
- Add documentation
- Deployed online
- Project deployed to Vercel, accessible at https://radio-2000-back-end.vercel.app/
- Run
node .
ornode index.js
in the directory (Radio-2000-BackEnd folder) using terminal/command.
if running locally, you will see a response in terminal with the address the server is accessible from (default http://localhost:8080/). Click here if you want to use it online without having to run the server. On the landing page you can see the following available endpoints:
- /getAllStations
- /getStation/:name
- /getAllUsers
- /getUser/:name
- /setUser
/getAllStations
: Retrieves all station data from Firestore database/getStation/:name
: Retrieves single specified station data from Firestore database/getAllStations
: Retrieves all user data from Firestore database/getStation/:name
: Retrieves single specified user data from Firestore database/setUser
: To add data, use a API development tool like POSTMAN to pass data in the body as JSON with the endpoint request, for example:{ "name": "tom", "email": "[email protected]" }
- No guidlines currently set
/setUser
can be adapted to add other data, for example stations
- Local server has been tested and working on Windows 10, macOS 12.
- Vercel deployment tested on Windows (Chrome), macOS 12 (Safari) and iOS 16 (Safari)
- Unit testing required
- Node.js: Backend JavaScript server environment.
- Express: Node web framework for building web applications.
- Firebase/Firestore: Online database used to store stations and users.
- Vercel: Deploying the application online.
- POSTMAN: To test data.
- Deploying Express API to Vercel as serverless function: https://shadowsmith.com/how-to-deploy-an-express-api-to-vercel
- Accessing Firestore database and retrieving data: https://firebase.google.com/docs/firestore/query-data/get-data#node.js
- Data queries, requesting specific data from Firestore: https://cloud.google.com/firestore/docs/query-data/queries#array_membership