Skip to content

Jim-Cognito/be-echo-chamber

Repository files navigation

James' Echo Chamber API project

Introduction

Hi! Welcome to my Echo Chamber API project!

The hosted version of this API can be found at https://be-echo-chamber.herokuapp.com/api

Project summary

This project is inspired by the popular discussion site Reddit, and aims to emulate it's back end, with implementation and consideration of the following:

  • Building RESTful APIs and data transfer.
  • Using a Node.js Web Server App.
  • PostGresSQL databases and Express servers.
  • MVC architecture.
  • Test Driven Development.
  • Error handling.

It is written using:

Minimum requirements for running this project

You will need to have the following packages installed to download and work with this project:

  • Node.js v16.8.0 - Install instructions Here
  • postGreSQL v12.8, server 10.18 - Install instructions Here
  • A code editor such as VSCode

Cloning and testing this project

  1. To get started, navigate to the directory of your choice and run this shell command in your terminal:
git clone https://github.com/JamesWall-hub/be-echo-chamber.git

You will be asked to enter your git login details and access token.

  1. Open the repo folder in your code editor of choice and run the following commands in the terminal:
npm install
npm install --dev

This will install all node packages required for normal running of the repo, including devDependencies such as the testing modules.

  1. To set up the development and testing databases run this command:
npm run setup-dbs

This will create the databases nc_news and nc_news_test in your local instance of PostgreSQL

  1. Next, you will need to create two .env files to ensure the right database is seeded when a development or test script is run. In the root directory of the repo, create the following two files:
  • .env.development:

    edit the file to add this single line:

PGDATABASE=nc_news
  • .env.test:

    edit the file to add this single line:

PGDATABASE=nc_news_test
  1. Once these files have been created, running the seed script will populate our development database! Run the following command:
npm run seed
  1. Run the following command to view the test suite located in __tests__/app.test.js:
npm test app

About

A back-end Express app inspired by Reddit and other discussion sites.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published