subh-cs / Rest-Blog-Backend

Home Page:https://zany-teal-boa-fez.cyclic.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Blog Web Application Backend Server

A backend server for a blog web application using MVC architecture and following basic system design principles.

Introduction

This is a backend server for a blog web application that follows MVC architecture and basic system design principles. It provides REST APIs for user registration, login and CRUD operations for blog posts. The routes are protected using authentication, with only authenticated users able to create, update and delete blog posts. The server retrieves information for 10 blog posts by default, with the ability to retrieve information for a specific page of blog posts.

Preview video link:

Watch on 1.5x Click Here

Functionalities

  • User registration and login
  • CRUD operations for blog posts
  • Pagination for retrieving blog posts

Api Routes

User Routes

  • POST /register: Registers a new user.
  • POST /login: Logs in an existing user.

Blog Routes

  • GET /: Retrieves information for 10 blog posts by default (public route).
  • GET /?page=2: Retrieves information for 10 blog posts of page 2 (public route).
  • POST /create: Creates a new blog post (private route, requires authentication).
  • PATCH /update?id=${id}: Updates an existing blog post (private route, requires authentication).
  • DELETE /delete?id=${id}: Deletes a blog post (private route, requires authentication).

Run Locally

Clone the project

  git clone https://github.com/subh-cs/Rest-Blog-Backend.git

Go to the project directory

  cd Rest-Blog-Backend

Install dependencies

  npm install

Start the server

  npm run dev

About

https://zany-teal-boa-fez.cyclic.app


Languages

Language:JavaScript 98.3%Language:Shell 1.7%