Problem Statement 2:- StackIt โ A Minimal Q&A Forum Platform
Team Details: Member 1 - Name - Vivek Kumar Jha(Leader) Email - [email protected]
Member 2 - Name - Sarthak Sahu Email - [email protected]
A Modern Q&A Forum Platform
Built with React & Node.js for collaborative learning and knowledge sharing
# Navigate to project directory
cd StackIt
# Start the development server
npm run dev
โจ Your StackIt application will be running at http://localhost:5173
- Guest: Browse questions and answers
- User: Post, vote, and interact
- Admin: Content moderation
- Formatting: Bold, Italic, Underline, Strikethrough
- Lists: Bullet points & numbered lists
- Code: Syntax highlighting
- Links: URL insertion
- Quotes: Blockquote support
- Multi-select tag input
- Popular tags display
- Tag-based filtering
- Auto-suggestions
- Upvote/downvote questions & answers
- Visual score indicators
- Color-coded feedback
- User vote tracking
- Accept best answers
- Visual acceptance indicators
- Acceptance notifications
- Bell icon with unread counter
- Dropdown with recent activity
- Types: answers, comments, mentions, votes
- Mark as read functionality
- Full-text search
- Tag-based filtering
- Sort: Newest, Most Voted, Most Viewed
- Real-time results
Technology | Version | Purpose |
---|---|---|
React | 19.1.0 | UI Framework |
Vite | 7.0.4 | Build Tool |
Tailwind CSS | 4.1.11 | Styling |
Lucide React | 0.525.0 | Icons |
Technology | Version | Purpose |
---|---|---|
Node.js | 18+ | Runtime |
Express.js | 5.1.0 | Web Framework |
MongoDB | 8.16.3 | Database |
JWT | 9.0.2 | Authentication |
bcryptjs | 3.0.2 | Password Hashing |
{
name: String,
email: String (unique),
password: String (hashed),
role: String (guest/user/admin),
isPrivate: Boolean,
createdAt: Date
}
{
title: String,
description: String (rich text),
tags: [String],
author: ObjectId (ref: User),
answers: [ObjectId] (ref: Answer),
upvotes: Number,
downvotes: Number,
views: Number,
isClosed: Boolean,
createdAt: Date,
updatedAt: Date
}
{
text: String (rich text),
upvotes: Number,
downvotes: Number,
accepted: Boolean,
author: ObjectId (ref: User),
question: ObjectId (ref: Question),
comments: [ObjectId] (ref: Comment),
createdAt: Date,
updatedAt: Date
}
{
type: String (answer/comment/mention/vote/accept),
recipient: ObjectId (ref: User),
sender: ObjectId (ref: User),
message: String,
read: Boolean,
link: String,
relatedQuestion: ObjectId (ref: Question),
relatedAnswer: ObjectId (ref: Answer),
relatedComment: ObjectId (ref: Comment),
createdAt: Date
}
- Node.js (v18 or higher)
- MongoDB (local or cloud)
- npm or yarn
-
Clone & Navigate
git clone https://github.com/yourusername/StackIt.git cd StackIt
-
Install Dependencies
# Frontend cd Stackit npm install # Backend cd backend npm install
-
Environment Setup
# Backend directory cd backend cp .env.example .env
Configure
.env
:MONGO_URI=mongodb://localhost:27017/stackit JWT_SECRET=your_jwt_secret_here PORT=5000 NODE_ENV=development
-
Start Development Servers
# Backend (from backend directory) npm run dev # Frontend (from Stackit directory) npm run dev
-
Access Application
- ๐ Frontend: http://localhost:5173
- ๐ Backend API: http://localhost:5000
StackIt/
โโโ ๐ฆ Stackit/ # Frontend
โ โโโ ๐จ src/
โ โ โโโ ๐งฉ components/
โ โ โ โโโ AskQuestionForm.jsx
โ โ โ โโโ NotificationDropdown.jsx
โ โ โ โโโ QuestionCard.jsx
โ โ โ โโโ RichTextEditor.jsx
โ โ โ โโโ SearchFilters.jsx
โ โ โ โโโ TagInput.jsx
โ โ โโโ ๐ช hooks/
โ โ โ โโโ useAuth.jsx
โ โ โ โโโ useNotifications.jsx
โ โ โ โโโ useQuestions.jsx
โ โ โโโ App.jsx
โ โ โโโ main.jsx
โ โโโ ๐ package.json
โ โโโ โ๏ธ vite.config.js
โโโ ๐ง backend/ # Backend
โ โโโ โ๏ธ config/
โ โ โโโ db.config.js
โ โ โโโ jwt.config.js
โ โโโ ๐ฎ controllers/
โ โ โโโ auth.controller.js
โ โ โโโ question.controller.js
โ โ โโโ answer.controller.js
โ โ โโโ comment.controller.js
โ โ โโโ notification.controller.js
โ โ โโโ upload.controller.js
โ โโโ ๐ก๏ธ middleware/
โ โ โโโ auth.middleware.js
โ โ โโโ error.middleware.js
โ โ โโโ upload.middleware.js
โ โโโ ๐ models/
โ โ โโโ User.js
โ โ โโโ Question.js
โ โ โโโ Answer.js
โ โ โโโ Comment.js
โ โ โโโ Notification.js
โ โโโ ๐ฃ๏ธ routes/
โ โ โโโ auth.route.js
โ โ โโโ question.route.js
โ โ โโโ answer.route.js
โ โ โโโ comment.route.js
โ โ โโโ notification.route.js
โ โ โโโ upload.route.js
โ โโโ server.js
โ โโโ package.json
โโโ ๐ README.md
Method | Endpoint | Description |
---|---|---|
POST |
/api/auth/register |
User registration |
POST |
/api/auth/login |
User login |
GET |
/api/auth/profile |
Get user profile |
Method | Endpoint | Description |
---|---|---|
GET |
/api/questions |
Get all questions |
POST |
/api/questions |
Create question |
GET |
/api/questions/:id |
Get specific question |
PUT |
/api/questions/:id |
Update question |
DELETE |
/api/questions/:id |
Delete question |
Method | Endpoint | Description |
---|---|---|
GET |
/api/answers |
Get answers |
POST |
/api/answers |
Create answer |
PUT |
/api/answers/:id |
Update answer |
DELETE |
/api/answers/:id |
Delete answer |
Method | Endpoint | Description |
---|---|---|
GET |
/api/notifications |
Get notifications |
PUT |
/api/notifications/:id/read |
Mark as read |
PUT |
/api/notifications/read-all |
Mark all as read |
- โจ Clean, minimalist interface
- ๐จ Consistent color scheme
- โก Smooth animations
- ๐ฏ Visual feedback
- ๐ฑ Mobile-first design
- ๐ Flexible grid system
- ๐ฑ๏ธ Touch-friendly elements
- ๐ Adaptive navigation
- ๐๏ธ WYSIWYG interface
- โจ๏ธ Keyboard shortcuts
- ๐ Clean paste handling
- ๐๏ธ Real-time preview
- ๐ Bell icon with counter
- ๐ Dropdown interface
- โฐ Time-based formatting
- ๐๏ธ Unread indicators
npm run build
# Deploy dist/ folder
# Set production env vars
NODE_ENV=production
MONGO_URI=your_production_uri
JWT_SECRET=your_production_secret
npm start
- ๐ด Fork the repository
- ๐ฟ Create feature branch (
git checkout -b feature/amazing
) - ๐พ Commit changes (
git commit -m 'Add amazing feature'
) - ๐ค Push to branch (
git push origin feature/amazing
) - ๐ Open Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- ๐จ Built with React and Node.js
- ๐จ Styled with Tailwind CSS
- ๐ฏ Icons from Lucide React
- ๐๏ธ Database powered by MongoDB
StackIt - Where questions find answers, and knowledge finds community ๐