This is a full-stack blogging platform that allows users to register, log in, create, edit, delete, and search for blog posts. The backend is built with Node.js, Express.js, MongoDB, and Mongoose, while the frontend is developed using React.js.
- User authentication (register, login, logout) with JWT
- Secure password hashing using bcrypt
- CRUD operations for blog posts (create, update, delete, search)
- Image upload functionality using Multer
- Search functionality for blog posts by title, content, author, and tags
- Protected routes requiring authentication
- Node.js & Express.js - Backend framework
- MongoDB & Mongoose - Database
- JWT (JSON Web Tokens) - Authentication
- bcrypt - Password hashing
- Multer - File uploads
- CORS - Handling cross-origin requests
- React.js - UI framework
Ensure you have the following installed:
- Node.js & Yarn
- MongoDB (running locally or using a cloud service like MongoDB Atlas)
git clone git@github.com:reemghareeb25/WordFlow.git
cd WordFlowcd client && yarn install
cd ../server && yarn installCreate a .env file in the server directory and add the following:
JWT_SECRET=kfldkscmlsdcmkwklkekksnfuckthat
MONGODB_URI=mongodb+srv://blog:bloggy15@cluster0.gem8r.mongodb.net/?retryWrites=true&w=majority&appName=Cluster0
PORT=4000
Run both the backend and frontend with one command:
yarn startThis will start:
- Frontend (
client/) athttp://localhost:3000 - Backend (
server/) athttp://localhost:4000
If you want to start them separately:
nodemon server # Start backend only
yarn client # Start frontend only| Route | Method | Description |
|---|---|---|
/register |
POST | Register a new user |
/login |
POST | Login and get JWT token |
/profile |
GET | Get logged-in user profile |
/logout |
POST | Logout user |
| Route | Method | Description |
|---|---|---|
/post |
GET | Get all posts |
/post/:id |
GET | Get a single post by ID |
/post |
POST | Create a new post (requires authentication) |
/post/:id |
PUT | Update a post (requires authentication) |
/post/:id |
DELETE | Delete a post (requires authentication) |
/search?query=text |
GET | Search posts by keyword |
- Implement pagination for blog posts
- Improve UI/UX with better styling
- Add comments & likes functionality
- Improve security measures