Giter Club home page Giter Club logo

nc-news-backend's Introduction

Lee's News - Back End API ๐Ÿ—ž

Portfolio Project - Back End


Built by: Lee Kirkham (2022 & 2023)


Back-End

Front-End (For this Back-End API)


Description

A 'News API' built with Node.js, an Express.js server and a PostgreSQL database.

All endpoints can be found in the endpoints.json file or going to https://lee-be-nc-news.onrender.com/api which lists all endpoints which can be interacted with.

There is a front-end app available for this API, which will allow you to interact with it, available at: https://fe-nc-news-app.netlify.app/


Setup Instructions

Installation requirements:

  • Node.js 17.x
  • Postgres 14.x

Cloning the repositry:

  • In your teminal CLI:
$ git clone https://github.com/leekli/nc-news-backend.git
$ cd nc-news

Installing dependencies:

  • Required dependencies will be pulled from the package.json file. In your teminal CLI:
$ npm install

Environment setup:

  • Once the repo has been cloned, you will need to create two .env files in the root folder: with the .env.test and .env.development file names in the root directory.

  • In each of these corresponding .env files you will need to add PGDATABASE=<database_name_here> to each file, pointing to the relevant database:

    .env.development database is nc_news

    .env.test database is nc_news_test

Database set-up and seeding:

  • Before using or testing the application, you will need to set the database up, and then seed it with the data:
$ npm run setup-dbs
$ npm run seed

Testing

  • Jest and Supertest is the framework used to test this application.

  • To run tests:

$ npm test

Docker

  • This repo can be ran in a Docker container, a compose.yaml & Dockerfile are included in the root folder. Run the following command:
$ docker compose up

Application dependencies:

  • npm 8.x
  • express 4.x
  • pg 8.x
  • pg-format 1.x
  • dotenv 14.x
  • nodemon 2.x

Developer only dependencies:

  • jest 27.x
  • jest-sorted 1.x
  • supertest 6.x

nc-news-backend's People

Contributors

anthonymedina avatar nc-paul-rogerson avatar p-copley avatar daviidbartlett avatar anatdean avatar dav3rid avatar alexander-cox avatar sssam-c avatar tomosim avatar isabelmaccabee avatar douglashellowell avatar liam310 avatar rogersop avatar antariess avatar bainesface avatar nicola-20 avatar

Stargazers

Roman avatar

Watchers

Lee ๆŽ avatar

Forkers

mejaz4

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.