Looking to find your next perfect holiday destination? Then this API is for you
To install and view this app on your local machine follow the below steps:
Clone this repo into your desired folder on your local machine using git clone https://github.com/fac20/week7-AGIL.git
-
Connect your local database with init.sql file
- run:
psql
to enter into the postgres terminalCREATE USER myuser SUPERUSER PASSWORD 'mypassword';
to create a dedicated psql local user for the applicationCREATE 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
- Within a .env file create a the followig variables:
-
Run:
npm install
to install all dependenciesnpm run dev
to start the server using nodemonnpm test
to run test locally
Please message if you have any questions.
https://agil-holidays.herokuapp.com/
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
- 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
- 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)
- GitHub Actions CI setup to run your tests when you push
- Terry (Deployment)
- Jess (Design)
- Amber (Quality)
- Khadija (Scrum facilitator)