Chitter is a small Twitter clone that allows users to post messages to a public wall.
This app was created using Express and EJs. The database is managed with Postgres and uses the ORM Sequelize. Tests have been written and run using Cypress.
Fork this repo, avigate to your chosen directory and clone from your terminal
git clone git@github.com:hanna-98/chitter-challenge.gitInstall dependencies
npm install
Create a .env file and add these ennvironment variables:
# be sure not to include spaces
DATABASE='your database name'
DATABASE_USER='your postgres username'
DATABASE_PASSWORD='your postgres password if you have one'
SESSIONS_SECRET='choose a password for sessions'Create and migrate development and test databases
npx sequelize-cli db:create
npx sequelize-cli db:migrate
NODE_ENV=test npx sequelize-cli db:create
NODE_ENV=test npx sequelize-cli db:migrate
Start the Postgres server
pg_ctl -D /usr/local/var/postgres startTo run the app:
node app.js
# or
npx nodemon app.jsTo run the tests:
# start the app in the test environment
NODE_ENV=test npx nodemon app.js
# then open cypress
NODE_ENV=test npx cypress open
