Backend project for a board game review website - WORK IN PROGRESS
This project builds an API for the purpose of accessing application data programmatically. The intention is to mimic the building of a real world backend service (such as reddit) which should provide this information to the front end architecture.
The database is PSQL, and it is interacted with using node-postgres.
To view the currently available ENDPOINTS, please visit:
https://nc-games-xkym.onrender.com/api
(you may wish to use a JSON formatter extension to better view this data)
The frontend repo is here:
https://github.com/laumack/game-reviews-FRONTEND
This project is a work in progress. Future plans include:
- making use of Express routers to help breakdown the logic into subrouters
- adding the following further endpoints:
- GET /api/users/:username
- PATCH /api/comments/:comment_id
- POST /api/reviews
- GET /api/reviews (pagination)
- POST /api/categories
- DELETE /api/reviews/:review_id
- refactoring any code and ensuring that all files have been separated by their endpoint type
Fork this repo to get your own copy.
Then clone the repo (into your desired directory) by using:
$ git clone https://github.com/laumack/game-reviews-BACKEND.git
- Node: v20.3.0
- Postgres: v14.8
Install dependencies using:
$ npm install
To connect to the development and test databases you will need to create an .env.development file and an .env.test file.
Within the .env.development file, add the following code:
PGDATABASE=nc_games
Within the .env.test file, add the following code:
PGDATABASE=nc_games_test
There are two databases included with this project, one for the live development data, and a smaller one for test data.
To seed the databases, you will need to run:
$ npm run setup-dbs
$ npm run seed
The project was built using Test-Driven Development throughout, with Jest and Jest-Sorted. As a result, there are comprehensive tests included, which you can run by using:
$ npm test
This project was started when I was a student on a Northcoders Software Development Bootcamp. The initial template repo was provided by Northcoders.
MIT License
Copyright (c) 2023 Lauren Alexandra McIntyre
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.