Live site: Herokuapp.com/
Scroll to the bottom of the README for installation instructions, if you would like to run our project locally!
As a member of Founders & Coders, I would like to securely access a site to share my funny jokes.
Thus, I should be able to:
- add my blog to a database where it will stored
- be able to log in if I have my username and password in the database
- see all jokes on the site
- be automatically logged in via a cookie once I've logged in once
- Ability to log in
- Ability to log out
- Account authentication against Heroku database of users with passwords
- Session cookie to be dropped on the user once they've succesfully logged in
- Ability for new users to register for an account
- Password encryption
- Script injection prevention
- See here for our architecture diagram
Here are the schema diagrams for the database:
Column | Type | Modifiers |
---|---|---|
id | integer | not null default |
body | character varying (600) | not null |
author_id | interger | not null |
Column | Type | Modifiers |
---|---|---|
id | integer | not null default |
username | character varying(100) | not null |
password | character varying(100) | not null |
-
Clone this repo and cd into it
-
git clone https://github.com/FAC10/week-7-LMAO
-
Run
npm install
to install all dependencies
-
Ensure PSQL is running. You will need to find PSQL in applications folder
-
Use your terminal and 'cd' into the project that contains the database build script
-
Open a new tab in your terminal (CMD+T) then run PSQL by typing 'psql;'
-
To create a database, type: 'CREATE DATABASE {databaseNameWithoutCurlys};'
-
Go into this database by typing: '\c {databaseNameWithoutCurlys};'
-
Run the build script to create your tables: '\i ./database/db_buildscript.sql;' (your route to the script may be different)
-
Test that your tables are there with '\l' to list all tables in this database
-
Create a
config.env
file in the root of the project -
Add the
DATABASE_URL
variable: DATABASE_URL = postgres://{usernameHereWithoutCurlys}@localhost:5432/{databaseNameWithoutCurlys}
-
Run
npm run startDev
to start the server using Nodemon (which will automatically restart Node when changes are detected in your files). -
Navigate to http://localhost:4000/ in your browser
-
Run
npm run test
to run the tests (this will take around 30 secs to complete) -
Run
npm run coverage
to check coverage (this will take around 30 secs to complete)