This project was a solo back-end project of the Northcoders fullstack bootcamp, which utilises endpoints to retrieve data from a persistent data source. It is written in Javascript, using node.js, express and PostgreSQL. Full test driven development (TDD) was included which utilised jest.
The Heroku hosted version of this project can be viewed here
To view all endpoints click here
- Fork and clone this repository locally
- Run
npm install
to install all the required dependanciesAs the .env\* files are added to the gitignore, these files can not be accessed locally when cloned.
- To connect to the database locally create 2 new files in the root directory named:
- .env.development
- .env.test
- Within the new .env.development file you just created, connect the database by typing
PGDATABASE=<database_name>
in the file. Replace "database_name" withnc_news
- Insert the same command in the .env.test file to connect to the test database, but replace "database_name" with
nc_news_test
instead - Run
npm run setup-dbs
to create two databases, for developement and testing. - Run
npm run seed
to seed the development database - Run
npm run prepare
to setup husky. Husky will not allow any commits or git actions if any tests fail. - Run
npm test
to run the entire test suite ornpm test <file_path>
to run a specific testing file. - Run
npm test app.test.js
to automatically run and seed the test database. - Run
npm run seed:prod
for deployment of Heroku.
This project was developed using v18.4.0 of Node.js and 8.7.3 of Node Postgres.