A full-stack blog application built with React + Vite on the frontend and Node.js + Express + MongoDB on the backend.
New-Blog-app/
├── client/ # React frontend (Vite)
│ ├── src/
│ │ ├── components/
│ │ │ ├── Navbar.jsx
│ │ │ ├── Footer.jsx
│ │ │ ├── HeroSection.jsx
│ │ │ ├── BlogCard.jsx
│ │ │ └── BlogList.jsx
│ │ ├── pages/
│ │ │ └── Home.jsx
│ │ ├── context/
│ │ ├── App.jsx
│ │ └── main.jsx
│ └── public/
└── server/ # Express + MongoDB backend
| Tool | Purpose |
|---|---|
| React 18 | UI library |
| Vite | Build tool & dev server |
| React Router DOM | Client-side routing |
| Tailwind CSS | Utility-first styling |
| ESLint | Code linting |
| Tool | Purpose |
|---|---|
| Node.js + Express 5 | REST API server |
| Mongoose | MongoDB ODM |
| CORS | Cross-origin request handling |
| dotenv | Environment variable management |
| nodemon | Dev auto-restart |
- Node.js >= 18
- MongoDB (local or MongoDB Atlas)
git clone https://github.com/AadityaBansal01/New-Blog-app.git
cd New-Blog-appcd server
npm installCreate a .env file in the server/ directory:
PORT=5000
MONGO_URI=your_mongodb_connection_stringStart the server:
# Development (with nodemon)
npm run dev
# Production
npm startServer runs at http://localhost:5000
cd client
npm installCreate a .env file in the client/ directory if needed:
VITE_API_URL=http://localhost:5000Start the dev server:
npm run devClient runs at http://localhost:5173
| Script | Description |
|---|---|
npm run dev |
Start Vite dev server |
npm run build |
Build for production |
npm run preview |
Preview production build |
npm run lint |
Run ESLint |
| Script | Description |
|---|---|
npm run dev |
Start with nodemon |
npm start |
Start without nodemon |
- Browse blog posts on the home page
- Responsive layout with Navbar and Footer
- Hero section for featured content
- Blog card grid with list view
- REST API backend with MongoDB persistence
- Fork the repository
- Create a feature branch:
git checkout -b feature/your-feature - Commit your changes:
git commit -m 'Add your feature' - Push to the branch:
git push origin feature/your-feature - Open a Pull Request
This project is open source. See LICENSE for details.
Built by Aaditya Bansal