GithubHelp home page GithubHelp logo

geo-news-backend's Introduction

Geo-Beard News API

Project Overview

Summary

This project has been part of the Northcoders bootcamp, 16th May 2022 - 19th August 2022.

The purpose of this project has been to build an API in order to be able to access application data programmatically. The intention here was to mimic the building of a real world backend service (such as reddit) which will provide this information to the front end architecture.

The database used was PSQL, and interactions have been carried out using node-postgres.

Links

The following link will take you to the hosted version of this project:

https://geo-beard-news.herokuapp.com/api

The following link will take you to the creators github profile:

https://github.com/Geo-Beard

Set-up instructions

Install Node.js and Postgres

Ensure that you have Node.js and Postgres installed with these minimum requirements:

Node.js: v18.1.0
Postgres: 14.3

To check which version you currently have installed:

node --version
psql -V

Cloning the repo

In order to clone this repo use the following:

git clone https://github.com/Geo-Beard/geo-news-backend.git

If you would like to make changes to this repo yourself, fork the repo then clone it.

Create .env files

In order for you to run this repo locally you must create two .env files:

.env.test
.env.development

Inside each of the corresponding files write the following:

PGDATABASE=nc_news_test
PGDATABASE=nc_news

If you would like to deploy this via heroku you must also create:

.env.production

Inside of which write the following:

PGDATABASE=nc_news

Installing dependencies

The following dependencies must be installed using npm:

npm install dotenv
npm install express
npm install pg

If you would like to host this with heroku the following should be installed:

npm install -g heroku

Seeding local database

The following scripts should be run in order to seed the local databases:

npm run setup-dbs
npm run seed

Running tests

The following dev dependencies should be installed for testing:

npm install -D jest
npm install -D supertest
npm install -D jest-sorted
npm install pg-format

In order to run the testing suite run the following:

npm test app

Viewing dev database

If you would like to write test queries to the development database write your SQL queries in:

./db/__view-dev-db__/view-dev-data.sql

Then run the following script:

npm run view-dev-db

This will output the following:

view-dev-db.txt

geo-news-backend's People

Contributors

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

Watchers

 avatar

Forkers

phillee20

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.