A modern, full-stack blog application built with Node.js, Express, MongoDB, and EJS. This platform allows users to create, read, update, and delete blog posts, along with user authentication and authorization features.
-
User Authentication
- Secure user registration and login
- JWT-based authentication
- Password hashing with bcrypt
- Protected routes
-
Blog Management
- Create, read, update, and delete blog posts
- Rich text editing capabilities
- Responsive design for all devices
- Categorization and tagging system
-
User Experience
- Clean and intuitive interface
- Real-time form validation
- Responsive navigation
- Error handling and user feedback
-
Frontend:
- EJS (Embedded JavaScript templates)
- CSS3 for styling
- JavaScript (ES6+)
- Responsive design
-
Backend:
- Node.js
- Express.js
- MongoDB with Mongoose ODM
-
Authentication:
- JSON Web Tokens (JWT)
- bcrypt for password hashing
- Cookie-based sessions
-
Development Tools:
- Nodemon for development server
- Dotenv for environment variables
- CORS for cross-origin requests
- Node.js (v14 or higher)
- npm or yarn
- MongoDB (local or Atlas)
-
Clone the repository
git clone [your-repository-url] cd Blog-Project -
Install dependencies
npm install
-
Set up environment variables Create a
.envfile in the root directory with the following variables:PORT=3000 MONGODB_URI=your_mongodb_connection_string JWT_SECRET=your_jwt_secret_key CORS_ORIGIN=http://localhost:3000 -
Start the development server
npm run dev
-
Open in browser Visit
http://localhost:3000in your web browser
Blog-Project/
βββ public/ # Static files (CSS, JS, images)
β βββ styles/ # CSS files
β βββ js/ # Client-side JavaScript
βββ src/
β βββ controllers/ # Request handlers
β βββ db/ # Database connection
β βββ middleware/ # Custom middleware
β βββ models/ # Database models
β βββ routes/ # Route definitions
β βββ utils/ # Utility functions
βββ views/ # EJS templates
β βββ partials/ # Reusable components
β βββ pages/ # Main page templates
βββ .env # Environment variables
βββ app.js # Express app configuration
βββ index.js # Application entry point
βββ package.json # Project dependencies and scripts
npm run dev- Start the development server with nodemonnpm start- Start the production server
- Aditya Sai Prem - [Your GitHub Profile]