Giter Club home page Giter Club logo

week7-restapi's Introduction

Holiday Destinations API

Looking to find your next perfect holiday destination? Then this API is for you

Table of content ๐Ÿ“œ

Installation

To install and view this app on your local machine follow the below steps:

Clone

Clone this repo into your desired folder on your local machine using git clone https://github.com/fac20/week7-AGIL.git

Set-up

  • Connect your local database with init.sql file

    • run:
    • psql to enter into the postgres terminal
    • CREATE USER myuser SUPERUSER PASSWORD 'mypassword'; to create a dedicated psql local user for the application
    • CREATE DATABASE test_database WITH OWNER myuser; to create a database
    • \connect test_database to connect to the correct db
    • \i db/init.sql to initialise and run the sql file
    • \dt to verify that you have actually initialised and run the db file
  • Set up environment variables for the json secret key, database_url and test_database_url(which is the local database)

    • Within a .env file create a the followig variables:
      • DATABASE_URL - with the remote heroku database url
      • TEST_DATABASE_URL(connection string) - utl in the format postgres://username:password@localhost:5432/database_name
      • SECRET- a secret key which will be used to create a jwt to be stored in cookies tab
  • Run:

    • npm install to install all dependencies
    • npm run dev to start the server using nodemon
    • npm test to run test locally

Please message if you have any questions.

https://agil-holidays.herokuapp.com/

Database schema

Screenshot 2020-08-28 at 12 43 55

User Stories

Core

As a user, I want to: submit information to your site for anyone to see

  • As a user, I want to: come back to your site later and see what I posted is still there
  • As a user, I want to: be the only person allowed to delete my stuff
  • As A user I want to be able to post something only when I'm logged in
  • As a user I wa t to see an error message if I haven't signed up before trying to log in

Core

  • As an API user, I want to: get a list of all available resources
  • As an API user, I want to: get all the information on a specific resource
  • As an API user, I want to: create a new resource
  • As an API user, I want to: update an existing resource
  • As an API user, I want to: delete an existing resource
  • As an API user, I want to: only be able to change an existing resource if I am authenticated to do so

Acceptance Criteria

  • An Express server that only returns JSON
  • A Postgres database to store the data
  • Endpoints for creating, reading, updating & deleting resources
  • Token-based authentication so only the owner of a resource can change it
  • Correct headers and response metadata
  • Error-handling to make it easy to use the API to build something
  • Tests for server routes and database access
  • Not process user input as SQL commands
  • Hidden environment variables (i.e. not on GitHub)

Stretch criteria

  • GitHub Actions CI setup to run your tests when you push

Team

  • Terry (Deployment)
  • Jess (Design)
  • Amber (Quality)
  • Khadija (Scrum facilitator)

Team spirit-pana

week7-restapi's People

Contributors

rungt avatar amberrignell avatar khadija-nur avatar jessica440 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.