Skip to content
VikasbooleanPublic

About

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🔐 Full Stack Authentication & Dashboard App

A scalable full-stack web application with authentication, protected routes, and a user dashboard.
Built using React.js, Node.js, Express, and mySQL.


🚀 Features

🔑 Authentication

  • User Registration
  • User Login
  • Password Hashing using bcrypt
  • JWT-based authentication
  • Protected routes

📊 Dashboard

  • Fetch logged-in user profile
  • Secure API communication
  • Logout functionality

🛡 Security

  • Password hashing
  • JWT verification middleware
  • Protected backend routes
  • Error handling

🛠 Tech Stack

Frontend

  • React.js (Vite)
  • React Router DOM
  • Axios
  • Context API

Backend

  • Node.js
  • Express.js
  • mySQL
  • bcryptjs
  • jsonwebtoken

📁 Project Structure

assig/ │ ├── frontend/ # React Frontend └── backend/ # Express Backend


🖥 Backend Setup

cd backend npm install

Create a .env file inside backend/: PORT=5000 JWT_SECRET=your-super-secret-jwt-key-change-in-production DB_HOST=localhost DB_USER=root DB_PASSWORD= your_password DB_NAME=assig_db

Run backend: npm run dev

Backend runs at: http://localhost:5000


🌐 Frontend Setup

cd frontend npm install npm run dev

Frontend runs at: http://localhost:5173

Backend runs at: http://localhost:5000


🔌 API Endpoints

Authentication

Method Endpoint Description
POST /api/auth/register Register user
POST /api/auth/login Login user
GET /api/auth/profile Get logged-in user (Protected)

🔐 How Authentication Works

  1. User logs in
  2. Backend generates JWT
  3. JWT stored in localStorage
  4. Token sent in Authorization header
  5. Backend verifies token via middleware

📈 Scalability Considerations

  • Modular backend architecture (routes, controllers, middleware)
  • Context API for global state management
  • Easily extendable to add CRUD features (tasks/notes)
  • Can be deployed using:
    • Vercel (Frontend)
    • Render / Railway (Backend)
    • mySQL (Database)

📦 Future Improvements

  • Add Task CRUD system
  • Add Role-based authorization
  • Add Refresh Tokens
  • Add UI styling (TailwindCSS / Material UI)
  • Add Docker support

👨‍💻 Author

Vikas Mishra
Full Stack Developer

About

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages