A full-stack web application where developers share, discover, and engage with technical knowledge.
The Developer Community Platform is a full-stack web application designed for developers to share technical knowledge through blog posts. Users can create, browse, update, and delete posts, organize content with tags, interact through likes and comments, and discover content using search, filtering, sorting, and pagination. The backend follows a layered architecture — controllers, services, middleware, and MongoDB — while the frontend is built with Next.js and React using reusable components and responsive design.
- User Registration & Login with JWT
- Password hashing with bcrypt
- Protected routes via Auth Middleware
- Ownership authorization on posts and comments
- Helmet security headers
- CORS support
- Centralized error handling
- Create, Read, Update, Delete posts
- Draft & Published status
- Tag support for categorization
- Author information embedded
- Edit history tracking
- Like / Unlike posts (duplicate prevention)
- Comment on posts
- Update & Delete own comments
- Comment ownership authorization
Feature
| Search -> GET /posts?search=node
| Filter by Tag ->GET /posts?tag=javascript
| Filter by Author -> GET /posts?author=userId
| Pagination -> GET /posts?page=1&limit=10
| Sorting ->GET /posts?sort=-createdAt
| Field Selection ->GET /posts?fields=title,author,tags
- Interactive Swagger UI at
/api-docs - Full OpenAPI spec
- Integration tests with Jest + Supertest
DeveloperCommunityPlatform/
│
├── frontend/ # Next.js + React
│ ├── components/
│ │ ├── Layout.js
│ │ ├── Navbar.js
│ │ ├── PostCard.js
│ │ ├── PostForm.js
│ │ ├── CommentCard.js
│ │ └── TagBadge.js
│ ├── pages/
│ │ ├── index.js # Home — all posts
│ │ ├── create.js # Create post
│ │ ├── post/[id].js # Single post
│ │ └── tag/[tag].js # Posts by tag
│ └── styles/
│
├── backend/ # Node.js + Express
│ ├── src/
│ │ ├── config/
│ │ │ └── database.js # MongoDB connection
│ │ ├── controllers/ # Business logic
│ │ ├── middlewares/ # Auth, validation, error handling
│ │ ├── models/ # Mongoose schemas
│ │ ├── routes/ # API route definitions
│ │ ├── services/ # Reusable service layer
│ │ ├── docs/ # Swagger/OpenAPI spec
│ │ └── app.js # Express app setup
│ ├── tests/ # Jest + Supertest tests
│ ├── server.js # Entry point
│ ├── package.json
│ └── .env # Environment variables (not committed)
│
├── README.md
└── .gitignore
- Node.js v18+
- MongoDB Atlas account (or local MongoDB)
- Git
git clone https://github.com/ACM-JUIT/Team-1-DeveloperCommunityPlatform-.git
cd Team-1-DeveloperCommunityPlatform-cd backend
npm installCreate a .env file inside the backend/ folder:
PORT=5000
MONGODB_URI=your_mongodb_connection_string
JWT_SECRET=your_secret_key
JWT_EXPIRES_IN=7d
⚠️ Never commit your.envfile. It is already listed in.gitignore.
Start the backend:
npm run devBackend runs at → http://localhost:5000
cd ../frontend
npm install
npm run devFrontend runs at → http://localhost:3000
Method Endpoint Description Auth Required
| POST -> /users/register Register a new user ❌
| POST -> /users/login Login and receive JWT ❌
Method Endpoint Description Auth Required
| GET -> /posts Get all posts (supports filters) ❌
| GET -> /posts/:id Get a single post ❌
| POST -> /posts Create a new post ✅
| PUT -> /posts/:id Update a post (owner only) ✅
| DELETE -> /posts/:id Delete a post (owner only) ✅
Method Endpoint Description Auth Required
| POST -> /posts/:id/like Like a post ✅
| DELETE -> /posts/:id/like Unlike a post ✅
Method Endpoint Description Auth Required
| POST -> /posts/:id/comments (Add a comment) ✅
| GET -> /posts/:id/comments (Get all comments on a post ) ❌
| PUT -> /comments/:commentId (Update a comment (owner only)) ✅
| DELETE-> /comments/:commentId (Delete a comment (owner only)) ✅
Method Endpoint Description
|GET -> /health (Server health status)
Interactive API docs are available via Swagger UI once the backend is running:
http://localhost:5000/api-docs
cd backend
npm testTests use Jest and Supertest for full integration coverage of all API endpoints.
Feature Implementation
| Password storage -> bcrypt hashing — plain text never stored
| Auth tokens -> JWT with expiry (JWT_EXPIRES_IN)
| Route protection -> Auth middleware on all write operations
| Ownership checks -> Users can only modify their own content
| HTTP headers -> Helmet middleware sets secure headers
| Input validation -> Request validation middleware on all routes
| ObjectId checks -> MongoDB ID format validated before DB queries
| Error handling -> Centralized middleware — no stack traces in responses
| Frontend -> Next.js, React.js, CSS Modules | Backend -> Node.js, Express.js | Database -> MongoDB, Mongoose ODM | Authentication -> JSON Web Token (JWT), bcrypt | Documentation -> Swagger UI, OpenAPI | Testing -> Jest, Supertest | Security -> Helmet, CORS
| Backend -> Rudra Pratap Singh | Frontend -> Namrta Thakur | Database & Models -> Mishthi Dutta
This project was built as part of an academic team project at Jaypee University of Information Technology (JUIT) under the ACM Student Chapter.