Skip to content

Stuuben/Museum-REST-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Museum-REST-API


Museums in Sweden

Table of Contents
  1. About The Project
  2. The Team
  3. Getting Started

About The Project

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.

Built With

This is the tech stack used for this project:

The Team

The team that built this consisted of the following members.

Adam Stuborn

Barbora Miklosovicova

Fannie Wallner

Getting Started

To get a local copy up and running follow these simple example steps.

DBeaver Setup

Go to DBeaver and sign in.

  1. Create a new database connection
  2. Choose SQLite as your database option
  3. Create a path by choosing the file museum.sqlite

Postman Setup

Go to Postman and sign in.

  1. Import the document from assets map (Museum REST API.postman_collection.json) Click here!

  2. Open the collection Museum REST API

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

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

Installation

  1. Clone the repo
    git clone https://github.com/Stuuben/Museum-REST-API
  2. Install NPM packages for the backend
    npm install
  3. Create .env file in the root directory and add the credentials
    JWT_SECRET=secret
    PORT=3000

Design

design

About

Grupparbete. Skapa ett REST API med SQLlite

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published