Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,27 @@
# Contacts Snapshot starter project


## Dev Setup

1. Create your database: `createdb contacts_development`
1. Load your database with the schema: `npm run load_schema`
1. Install your dependencies: `npm install`
1. Run the server: `nodemon`


## Specifications

- Authentication
- [x] Create a signup page with a form (links to the login page)
- [x] Create a login page with a form (links to the signup page)
- [x] Redirect users who are not logged in to the login page (Make sure not logged in users can't see any of the pages or data other than the login and signup pages)
- [ ] Create a user table in the database
- [ ] When a user signs up, a new user row is created in the user table
- [ ] When a user logs in, their username and password are validated in the user table. If the username/password combo doesn't exist or is invalid, the user receives an error.
- [ ] Passwords are encrypted with `bcrypt`
- [ ] `express-session` is used to store sessions on the server
- [ ] `cookie-parser` is used to store cookies in the browser
- Authorization
- [ ] A user should have a `role` associated to it. The values are `admin` or `regular`.
- [ ] Only a user with an `admin` role should be able to create a new contact. If the logged in user is not an `admin`, going to the route `/contacts/new` should return a status code 403.
- [ ] Only a user with an `admin` role should be able to delete a contact. If the logged in user is not an `admin`, going to the route `/contacts/delete/:contactId` should return a status code 403. The delete links on the page should not be shown if the logged in user is not an `admin`.
Loading