A lightweight social media platform built with Node.js (backend) and vanilla HTML/CSS/JavaScript (frontend).
This project is a mini social media application where users can:
- Create an account
- Log in / log out
- Create posts
- View posts from all users
- Like posts
- View comments
- Like comments
- View followers
- Manage their profile
The backend is built on Node.js and Express, while the frontend uses HTML, CSS, and JavaScript with no external frameworks—keeping it simple and lightweight.
- Node.js
- Express.js
- MongoDB + Mongoose
- JWT Authentication
- Bcrypt (password hashing)
- Joi for validation
- HTML5
- CSS3
- Vanilla JavaScript (Fetch API)
/backend
├── controllers
├── models
├── routes
├── middlewares
├── server.js
/frontend
├── pages
├── styles
├── scripts
├── index.html
- Registration
- Login
- JWT-based session authentication
- Password hashing with Bcrypt
- Create text/image posts
- Like and unlike posts
- View posts from all users
- Delete your posts
- Basic profile page
- Mobile-friendly layout
- Clean, minimal design
- Vanilla JavaScript interactions
- Responsive feed layout
git clone https://github.com/your-username/your-repo.git
cd your-repocd backend
npm install bcrypt cors cookie-parser nodemon helmet router nodemailerCreate a .env file inside the backend/ folder:
PORT=8000
MONGO_URI=your_mongodb_connection_string
JWT_SECRET=your_jwt_secret
npm startThe backend runs at:
http://localhost:5000
Just open frontend/index.html in a browser.
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/auth/signup |
Register new user |
| POST | /api/auth/signin |
Login user |
| Method | Endpoint | Description |
|---|---|---|
| POST | /create/posts |
Create a post |
| GET | /posts |
Get all posts |
| PATCH | /api/posts/:id/like |
Like/unlike a post |
| DELETE | /api/posts/:id |
Delete a post |
(Add images if you'd like later)
Contributions are welcome! Feel free to fork the project and submit a pull request.