Table of Contents
Final project for the API development course is a group assignment to build a review site that lists which businesses are located in various cities where visitors can read some information about the business. Our group chose to write about 10 museums in Sweden.
This is the tech stack used for this project:
The team that built this consisted of the following members.
To get a local copy up and running follow these simple example steps.
Go to DBeaver and sign in.
- Create a new database connection
- Choose SQLite as your database option
- Create a path by choosing the file museum.sqlite
Go to Postman and sign in.
-
Import the document from assets map (Museum REST API.postman_collection.json) Click here!
-
Open the collection Museum REST API
-
Use the following user logins to send requests in Postman
User Password Email Role ("admin", "password123", "admin@admin.com", "admin"),
("owner", "password123", "owner@owner.com", "owner"),
("user", "password123", "user@user.com", "user"),
("user2", "password123", "user2@user.com", "user")
Admin = Can access all requests.
Owner = Has the same access as admin except they can not handle users or delete reviews.
User = Can not delete cities, museums or users. Can only delete their own reviews and their own account. Can search for cities, museums and reviews but can't search for other users.
- When sending request for getAllMuseums you can use queries limit and city to find museums in a particular city. Ex. https:localhost:3000/api/v1/museums/?city=Stockholm&limit=2
When sending request for getAllReviews you can use queries limit and museum to find reviews for a particular museum. Ex. https:localhost:3000/api/v1/reviews?museum=ABBA+Museet
The getAllCities query has a limit of 10 but can be changed when querying i Postman, however we only have three cities in our mock data.
- Clone the repo
git clone https://github.com/Stuuben/Museum-REST-API
- Install NPM packages for the backend
npm install
- Create .env file in the root directory and add the credentials
JWT_SECRET=secret PORT=3000