/Radio-2000-BackEnd

API endpoint backend for Radio 2000

Primary LanguageJavaScript

BackEnd task for Radio 2000

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.

Tasks:

  • 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

Running the application:

Online:

Local:

  • Run node . or node index.js in the directory (Radio-2000-BackEnd folder) using terminal/command.

Using the application:

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

Description of endpoints

  • /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": "tom@rad.com" }

Making changes/contributions:

  • No guidlines currently set
  • /setUser can be adapted to add other data, for example stations

Testing:

  • 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

Tools used:

  • 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.

Resources: