Welcome to the documentation for the Northcoders News API!
We will be building an API for the purpose of accessing application data programmatically. The intention here is to mimic the building of a real world backend service (such as Reddit) which should provide this information to the front end architecture.
Below, you'll find instructions on setting up environment variables, creating databases, and familiarizing yourself with the project structure.
You can find the hosted version of this project here - https://be-nc-news.henryalderslade.com/api/articles
Before getting started, make sure you have the following installed on your machine:
Node.js npm (Node Package Manager) PostgreSQL
git clone https://github.com/heniscoding/be-nc-news
cd your-repo
Run the following command to install project dependencies:
npm install
This project uses environment variables to configure database connections. Follow these steps to set up the necessary environment variable files:
Database Configuration for development. Copy the following into your .env file
PGDATABASE=database_name
Database Configuration for test. Copy the following into your .env file
PGDATABASE=database_name_test
The project includes the following npm scripts:
To setup the databases run:
npm run setup-dbs
To seed the database run and test the development environment:
npm run seed
To test the app
npm run test
Node.js : v21.6.1 PostgreSQL: v14.10