Welcome to the repo for my backend API project 'Northcoders News' which is now hosted using Supabase and Render.
Find the hosted API here: https://be-nc-news-c6su.onrender.com/api
(Note: Please allow a minute or so for the data to be fetched when first using the API - after this initial waiting period it will function much more quickly.)
This API has been built to serve a Reddit-style web app called NC News which allows users to find, read, vote, and comment on news articles sorted by various topics.
Built using:
- Node.js v22.6.0
- Postgres 14.13
In order to clone and run this repo locally use the following steps:
- Navigate to the directory you want to clone the repo to:
cd <directory_name>
- Clone the repository
git clone https://github.com/bs-jenk/be-nc-news.git
- Install the dependencies
npm install
- Create .env files
You will need to create two .env files (".env.test" and ".env.developement") to allow the PGDATABASE envrionmental variable to be set to the correct database in the connection.js file.
In the .env.development file, write the following line of code:
PGDATABASE=nc_news
In the .env.test file write:
PGDATABASE=nc_news_test
- Create and seed the local databases
npm run setup-dbs
npm run seed
- Check everything is working correctly by running the test suites
npm run test
All tests should pass!
This portfolio project was created by Sam Jenkinson as part of a Digital Skills Bootcamp in Software Engineering provided by Northcoders