Blogify is a full-featured blogging web application built using the MERN (without React) stack. It allows users to sign up, sign in, create blog posts with image uploads, and view their personalized content securely.
- π§βπ» User authentication with secure JWT-based session handling
- βοΈ Create, read, and view blog posts with cover image support
- πΈ Image uploads handled with Multer and stored locally
- π§ Dynamic UI rendering based on user login state
- π Clean MVC architecture with EJS templating
- π¨ Responsive Bootstrap 5 UI
| Layer | Technology |
|---|---|
| Backend | Node.js, Express.js |
| Frontend | EJS (Embedded JavaScript) templates |
| Database | MongoDB with Mongoose ODM |
| Authentication | JWT (JSON Web Tokens) via cookies |
| File Uploads | Multer |
| Styling | Bootstrap 5 |
Blog-App/
βββ middlewares/ # Custom Express middlewares
β βββ authentication.js # JWT authentication logic
βββ models/ # Mongoose schema models
β βββ blog.js # Blog schema
β βββ comments.js # Comment schema (optional)
β βββ user.js # User schema
βββ node_modules/ # Installed dependencies
βββ public/ # Static assets
β βββ images/ # Placeholder/static images
β βββ uploads/ # Uploaded blog cover images
βββ routes/ # Express route handlers
β βββ blog.js # Blog-related routes
β βββ user.js # User routes (signup/signin/logout)
βββ services/ # Logic services
β βββ authentication.js # Token generation/validation
βββ views/ # EJS templates
β βββ partials/ # Reusable partial templates
β β βββ head.ejs
β β βββ nav.ejs
β β βββ scripts.ejs
β βββ addBlog.ejs # Add new blog form
β βββ blog.ejs # Blog detail view
β βββ home.ejs # Home page with all blogs
β βββ signin.ejs # Login page
β βββ signup.ejs # Register page
βββ index.js # Main Express app
βββ package.json # Project dependencies
βββ package-lock.json # Locked versions of dependencies
βββ README.md # Project documentation
To run this project locally, follow these steps:
-
Clone the repository
git clone https://github.com/your-username/blogify.git cd blogify -
Install all Dependencies
npm install
- Ensure MongoDB is running locally
By default, the app connects to: mongodb://localhost:27017/blogify
-
Start the development server npm run dev
-
Visit the app in your browser