Nexus Community is a full-stack blogging community app. Users can register, verify their email, log in, browse posts, create and edit blogs with image uploads, like posts, contact the team, and generate blog ideas from a topic prompt.
- Frontend: React, Vite, React Router, Axios, React Hot Toast
- Backend: Node.js, Express, MongoDB, Mongoose
- Auth: JWT, bcrypt
- Uploads: Multer with Cloudinary storage
- Email: Nodemailer with Gmail
- AI ideas: OpenAI Chat Completions API
NexusCommunity/
|-- backend/
| |-- config/ # MongoDB connection
| |-- controllers/ # Route handlers
| |-- middleware/ # Auth middleware
| |-- models/ # Mongoose models
| |-- routes/ # Express routers
| |-- uploads/ # Local uploaded assets / legacy uploads
| `-- index.js # Express app entry
`-- frontend/
|-- public/
`-- src/
|-- assets/
|-- components/
|-- context/
`-- pages/
- Blog listing with filters and like support
- Protected blog creation and edit page
- Image upload support through Cloudinary
- User registration and login
- Email verification flow
- Blog idea generator
- Contact page
- Persistent auth state using local storage
- Node.js
- npm
- MongoDB connection string
- Cloudinary account
- Gmail account or app password for Nodemailer
- OpenAI API key for the idea generator
cd backend
npm installCreate a .env file in backend/:
MONGO_URI=your_mongodb_connection_string
JWT_SECRET=your_jwt_secret
CLOUDINARY_CLOUD_NAME=your_cloudinary_cloud_name
CLOUDINARY_API_KEY=your_cloudinary_api_key
CLOUDINARY_API_SECRET=your_cloudinary_api_secret
EMAIL_USER=your_gmail_address
EMAIL_PASSWORD=your_gmail_app_password
OPENAI_API_KEY=your_openai_api_keyStart the backend:
npm run serverThe backend listens on:
http://localhost:5000
Note: the current backend script is "server": "nodemon server", while the app entry file in this repo is index.js. If the script does not start, update it to nodemon index.js or run:
npx nodemon index.jscd frontend
npm install
npm run devThe Vite dev server usually runs on:
http://localhost:5173
The frontend API base URL is currently hardcoded in frontend/src/context/StoreContext.jsx:
const url = `https://resoultpartnersbackend.onrender.com`For local backend development, change it to:
const url = 'http://localhost:5000'Also check frontend/src/pages/BlogIdeaGenerator/BlogIdeaGenerator.jsx, which currently posts to http://localhost:5001/api/idea/chatgpt. If your backend runs on port 5000, update that URL accordingly.
Base path: /api/blog
| Method | Endpoint | Description |
|---|---|---|
| GET | /blogs |
Get all blogs |
| POST | /create |
Create a blog with an uploaded image |
| POST | /update/:id |
Update a blog |
| POST | /getsingle/:id |
Get one blog by ID |
| POST | /like/:id |
Like a blog |
| POST | /remove/:id |
Delete a blog |
Base path: /api/user
| Method | Endpoint | Description |
|---|---|---|
| POST | /register |
Register a new user and send verification email |
| POST | /login |
Log in a user |
| GET | /users |
Get all users |
| GET | /verify?token=... |
Verify a user email |
Base path: /api/idea
| Method | Endpoint | Description |
|---|---|---|
| POST | /chatgpt |
Generate blog ideas for a topic |
Example body:
{
"topic": "web development"
}Backend:
npm run serverFrontend:
npm run dev
npm run build
npm run lint
npm run preview- Blog images are uploaded through Cloudinary using
multer-storage-cloudinary. - Users are stored in MongoDB with hashed passwords.
- Email verification links are generated by the backend with JWT.
- Some deployed URLs are hardcoded in the current codebase. Update them before running a fully local setup or deploying to a new host.