Skip to content

Latest commit

 

History

43 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Node Revision 📦

A full-stack CRUD application built to learn and practice Node.js, Express.js, and MongoDB — with a React + Vite frontend styled using Tailwind CSS.


Tech Stack

Backend

  • Node.js + Express.js (v5)
  • MongoDB + Mongoose
  • bcrypt (password hashing)
  • dotenv, cors, nodemon

Frontend

  • React 18 + Vite
  • Tailwind CSS
  • Axios
  • React Router DOM

Features

  • User registration with hashed passwords
  • User login / logout
  • Protected routes (localStorage-based session)
  • Create, Read, Update, Delete posts
  • User profile page

Project Structure

Node_Revision/
├── backend/
│   └── src/
│       ├── config/
│       │   └── database.js
│       ├── controllers/
│       │   ├── user_controller.js
│       │   └── post_controller.js
│       ├── models/
│       │   ├── user_model.js
│       │   └── post_model.js
│       ├── routes/
│       │   ├── user_route.js
│       │   └── post_route.js
│       ├── app.js
│       └── index.js
├── frontend/
│   └── src/
│       ├── api/
│       │   └── axios.js
│       ├── components/
│       │   ├── Navbar.jsx
│       │   └── PostCard.jsx
│       ├── context/
│       │   └── AuthContext.jsx
│       ├── pages/
│       │   ├── Register.jsx
│       │   ├── Login.jsx
│       │   ├── Posts.jsx
│       │   └── Profile.jsx
│       ├── App.jsx
│       └── main.jsx
├── package.json
└── README.md

Getting Started

Prerequisites

  • Node.js v18+
  • MongoDB (local or Atlas)
  • npm or bun

1. Clone the repository

git clone https://github.com/morningstar004/Node_Revision.git
cd Node_Revision

2. Set up the backend

Create a .env file inside backend/:

PORT=4050
MONGO_URI=your_mongodb_connection_string

Install dependencies and start the backend:

npm install
npm run dev

The backend will run at http://localhost:4050

3. Set up the frontend

cd frontend
npm install
npm run dev

The frontend will run at http://localhost:5173


API Reference

Base URL: http://localhost:4050/api/v1

Users

Method Endpoint Description Body
POST /users/register Register a new user { username, email, password }
POST /users/login Login a user { email, password }
POST /users/logout Logout a user { email }

Posts

Method Endpoint Description Body
GET /posts Get all posts
POST /posts/create Create a new post { name, description, age }
PATCH /posts/update/:id Update a post { name, description, age }
DELETE /posts/delete/:id Delete a post

Notes

  • Passwords are hashed using bcrypt before being stored in MongoDB.
  • Authentication is session-less — the logged-in user object is stored in localStorage.
  • There is no JWT implementation; this project is intended for learning core backend concepts.

Author

Pranjal@morningstar004


License

ISC

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages