Giter VIP home page Giter VIP logo

be-project-nc-news's Introduction

NC-News

Hosted version:

A hosted version of this project can be found here: https://craigs-nc-news.herokuapp.com/api

Project summary:

This project is a backend api allowing for interaction with a PostgreSQL database. The database consists of data relating primarily to news articles as well as users inerations with these articles such as posting comments and upvoting. It is designed so that users can access data regarding the articles, article topics, users and comments which can be retrieved using the numerous endpoints which allow for various ways of filtering and presenting the data.

Cloning this project:

This project caan be forked and cloned from here: https://github.com/ccccc170/BE-Project-NC-News

Minimum versions:

Ensure that these versions of Nodejs and PostgreSQL are installed to run this project:

  • node v18.2.0
  • postgres v12.11

Installing dependencies:

The follwoing dependencies should be installed in order to ensure this project can be used:

  • dotenv v16.0.0
  • express v4.18.1
  • pg v8.7.3
  • pg-format v1.0.4

Ensure the follwoing dev dependencies are installed for further development purposes:

  • husky v7.0.4,
  • jest v27.5.1
  • jest-extended v2.0.0
  • jest-sorted v1.0.14
  • supertest v6.2.4

Running the command npm i after cloning and opening the project should ensure that all dependencies are installed.

Creating .env files:

In order to run this project, environment variables must to added to .env files as follows:

  • You will need to create two .env files for your project: .env.test and .env.development.
  • Into each, add PGDATABASE=<database_name_here>, with the correct database name for that environment (see /db/setup.sql for the database names).
  • Double check that these .env files are .gitignored.

Seeding local databases:

Run the script npm run setup-dbs to create both the test and development databases. Run the script npm run seed to seed your working database (this will be either the development or test database depending on the value of NODE_ENV).

Running tests:

This project was created adhering to TDD. The __tests__ directory includes all of the tests that were written and checked to ensure the quality of this project within two files, app.test.js amd utils.test.js. These tests were written using the Jest testing framework for JavaScript and SuperTest. The project's tests make use of jest, jest-extended and jest-sorted as well as supertest. With the dev dependencies outlined above installed, the test suite can be run using the script npm test, follwed by a test file name to run one of the specific files. Adding .only to any test or describe block within the file will allow for specific tests to be run.

be-project-nc-news's People

Contributors

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

Watchers

 avatar

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.