Skip to content

Nboss21/authentication_backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

2 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ›ก๏ธ Authentication Backend API

This is a Node.js and Express.js backend project providing user authentication and CRUD (Create, Read, Update, Delete) functionality for posts. It uses MongoDB via Mongoose, JWT for secure user sessions, and follows a clean MVC architecture. Ideal for building a secure backend for web or mobile applications.


๐Ÿ“Œ Table of Contents

  • Features(#-features)
  • Tech Stack(#-tech-stack)
  • Setup Instructions(#-setup-instructions)
  • Environment Variables(#-environment-variables)
  • API Endpoints(#-api-endpoints)
  • Auth Routes(#auth-routes)
  • Post Routes(#post-routes)

๐Ÿš€ Features

โœ… User Registration & Login ๐Ÿ”’ Password hashing with bcrypt ๐Ÿ” Token-based authentication using JWT ๐Ÿ”„ CRUD operations for posts ๐Ÿงฑ Follows MVC architecture ๐ŸŒ RESTful API design ๐Ÿ“ฆ .env support for environment configs ๐Ÿ›ก๏ธ Protected routes for authenticated users only

๐Ÿ› ๏ธ Tech Stack

  • Node.js
  • Express.js
  • MongoDB + Mongoose
  • JWT for authentication
  • bcrypt for password hashing
  • dotenv for environment variables
  • Postman (for testing)

โš™๏ธ Setup Instructions

  1. Clone the repository

bash git clone https://github.com/Nboss21/authentication_backend.git cd authentication_backend

๐Ÿ”‘ Auth Routes (/auth)

Method Endpoint Description
POST /register Register a new user
POST /login Authenticate a user and return JWT

๐Ÿ“ Post Routes (/posts)

Method Endpoint Description
GET /all-post Get all posts
GET /post/:id Get a single post by ID
POST /create Create a new post
PUT /update/:id Update a post by ID
DELETE /delete/:id Delete a post by ID

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published