Hello, this is a the first app that I've made for backend applications for NC-NEWS.
-- https://nc-news-project-backend.onrender.com/api
This RESTful API provides a structured way to access application data, supporting full CRUD operations for managing articles, topics, users, and comments. It mimics the functionality of a real-world backend news platform, similar to services like Reddit, and is designed to supply data to frontend applications.
Key Features: CRUD Operations: Allows clients to create, read, update, and delete data related to articles, topics, users, and comments. Advanced Queries: Supports complex database queries, including sorting, ordering, limiting, and pagination through parametric endpoints. MVC Architecture: Developed using the Model-View-Controller (MVC) design pattern for clean, maintainable code. Test-Driven Development (TDD): The API is built with a focus on testing to ensure reliability and functionality. A live version of this API is hosted online. Follow the link below to explore detailed documentation, including the full list of available endpoints, example queries, and typical responses. Please allow a minute or two for the server to initialize on first access.
Hosted version of the project: Here
For Chrome users, recommend installing a JSON viewer extension to better format the API responses for easier readability.
- Node.js: Minimum version
v22.3.0
- Git installed locally
- PostgreSQL Minimum version
v16.4
-
Clone the repository: git clone https://https://github.com/Onuryilmaz24/nc-news-project.git
-
Install dependencies:
- Dependencies:
- Posgtres
- express -Dev Dependencies
- pg-format
- dotenv
- jest
- jest-sorted
- nodemon
- husky
- supertest
To get these running on your machine, run this command in your terminal:
npm install
-
Setup Database
- In order to setup test and development database you need to set up two
.env
files in root directory: - .env.test
- Inside this file you need to write:
PGDATABASE=nc_news_test
- Inside this file you need to write:
- .env.development
- Inside this file you need to write:
PGDATABASE=nc_news
- Inside this file you need to write:
- In order to setup test and development database you need to set up two
-
Set up the local database:
- Ensure PostgreSQL is running.
- Create a new database:
npm run setup-dbs
-
Seed the database:
npm run seed
- Start the server:
npm start
- Backend: Node.js, Express
- Database: PostgreSQL
- Testing: Jest, Supertest
- Deployment: Supabase, Render
Run the test suite with the following command:
npm test
"This project was created by Onur Yilmaz as part of the Digital Skills Bootcamp in Software Engineering course provided by NorthCoders."