Skip to content

Latest commit

Β 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 

Repository files navigation

Secure Auth RBAC Fullstack Application

A scalable REST API with JWT Authentication, Role-Based Access Control (RBAC), and CRUD functionality, along with a basic frontend interface to interact with the APIs.


πŸš€ Tech Stack

Backend

  • Node.js
  • Express.js
  • MongoDB
  • JWT Authentication
  • Bcrypt (Password Hashing)

Frontend

  • React.js
  • Axios
  • Protected Routes using JWT

πŸ” Features Implemented

Authentication

  • User Registration
  • User Login
  • Password Hashing using bcrypt
  • JWT Token Generation & Verification

Role-Based Access Control (RBAC)

  • User role
  • Admin role
  • Protected routes based on role

CRUD Operations

  • Create, Read, Update, Delete for secondary entity (Tasks)
  • Proper HTTP status codes
  • Centralized error handling

Security

  • Secure JWT handling
  • Input validation
  • Protected API routes
  • Environment variable protection

πŸ“‚ Project Structure

auth-crud-api/ β”‚ β”œβ”€β”€ backend/ β”‚ β”œβ”€β”€ config/ β”‚ β”‚ β”œβ”€β”€ db.js β”‚ β”‚ └── token.js β”‚ β”‚ β”‚ β”œβ”€β”€ controllers/ β”‚ β”‚ └── auth.controller.js β”‚ β”‚ β”‚ β”œβ”€β”€ model/ β”‚ β”‚ └── user.model.js β”‚ β”‚ β”‚ β”œβ”€β”€ routes/ β”‚ β”‚ └── auth.route.js β”‚ β”‚ β”‚ β”œβ”€β”€ .env β”‚ β”œβ”€β”€ index.js β”‚ β”œβ”€β”€ package.json β”‚ └── package-lock.json β”‚ β”œβ”€β”€ frontend/ β”‚ β”œβ”€β”€ public/ β”‚ β”œβ”€β”€ node_modules/ β”‚ β”‚ β”‚ └── src/ β”‚ β”œβ”€β”€ assets/ β”‚ β”‚ β”‚ β”œβ”€β”€ Component/ β”‚ β”‚ └── Nav.jsx β”‚ β”‚ β”‚ β”œβ”€β”€ Context/ β”‚ β”‚ └── AuthContext.jsx β”‚ β”‚ β”‚ β”œβ”€β”€ pages/ β”‚ β”‚ β”œβ”€β”€ Home.jsx β”‚ β”‚ β”œβ”€β”€ Login.jsx β”‚ β”‚ └── SignUp.jsx β”‚ β”‚ β”‚ β”œβ”€β”€ App.jsx β”‚ β”œβ”€β”€ App.css β”‚ β”œβ”€β”€ index.css β”‚ └── main.jsx β”‚ β”œβ”€β”€ .gitignore └── README.md

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages