Team Member 1 Name : Patel Dhruv Email : [email protected]
Team Member 2 Name : Jain Dhruv Email : [email protected]
Team Member 3 Name : Parth Patel Email : [email protected]
Team Member 4 Name : Prince Chaudhari Email : [email protected]
A modern Q&A platform built with React, TypeScript, Node.js
- Modern UI/UX: Clean, responsive design with dark mode support
- Real-time Notifications: Toast notifications for all user actions
- Dynamic Content: Questions, answers, comments, and tags are all dynamic
- Search & Filtering: Advanced search and filtering capabilities
- Pagination: Efficient pagination for large datasets
- Authentication: Secure login/register with JWT tokens
- Voting System: Upvote/downvote questions and answers
- Comment System: Add comments to answers
- Tag Management: Browse and filter by tags
- Error Handling: Comprehensive error handling with user-friendly messages
- RESTful API: Complete REST API with Swagger documentation
- Authentication: JWT-based authentication with refresh tokens
- Database: MongoDB with Mongoose ODM
- Validation: Comprehensive input validation
- Error Handling: Centralized error handling
- Notifications: Real-time notification system
- Voting System: Secure voting with duplicate prevention
- Search: Full-text search capabilities
- Pagination: Efficient pagination for all endpoints
- Node.js (v16 or higher)
- MongoDB (v4.4 or higher)
- npm or yarn
-
Clone the repository
git clone <repository-url> cd stackit
-
Install dependencies
# Install backend dependencies cd backend npm install # Install frontend dependencies cd ../frontend npm install
-
Environment Setup
# Copy environment file cd ../backend cp example.env .env
Edit
.env
file with your configuration:PORT=5000 MONGODB_URI=mongodb://localhost:27017/stackit JWT_SECRET=your-secret-key JWT_REFRESH_SECRET=your-refresh-secret-key NODE_ENV=development
-
Start the application
# Start backend (from backend directory) npm start # or for development npm run dev # Start frontend (from frontend directory) npm run dev
-
Access the application
- Frontend: http://localhost:5173
- Backend API: http://localhost:5000
- API Documentation: http://localhost:5000/api-docs
POST /api/auth/register
- Register new userPOST /api/auth/login
- Login userPOST /api/auth/logout
- Logout userGET /api/auth/verify
- Verify token
GET /api/questions
- Get all questions with filteringGET /api/questions/:id
- Get specific questionPOST /api/questions
- Create new questionPUT /api/questions/:id
- Update questionDELETE /api/questions/:id
- Delete questionPOST /api/questions/:id/vote
- Vote on question
GET /api/answers/:questionId
- Get answers for questionPOST /api/answers
- Create new answerPUT /api/answers/:id
- Update answerDELETE /api/answers/:id
- Delete answerPOST /api/answers/:id/vote
- Vote on answerPOST /api/answers/:id/comments
- Add comment to answer
GET /api/tags
- Get all tags with filteringGET /api/tags/:id
- Get specific tagGET /api/tags/name/:name
- Get tag by nameGET /api/tags/name/:name/questions
- Get questions by tag nameGET /api/tags/popular
- Get popular tags
GET /api/notifications
- Get user notificationsPUT /api/notifications/:id/read
- Mark notification as read
- Users can upvote/downvote questions and answers
- Prevents voting on own content
- Toggle votes (click again to remove vote)
- Real-time vote count updates
- Add comments to answers
- Comments show author and timestamp
- Real-time comment updates
- Browse all tags with search and filtering
- View questions by specific tag
- Tag colors for different categories
- Tag statistics (question count)
- Search questions by title and content
- Filter by tags
- Sort by newest, most voted, most viewed
- Pagination for all results
- Toast notifications for all actions
- Success, error, and info notifications
- Auto-dismiss after 5 seconds
- Comprehensive error messages
- Network error handling
- Backend connection error handling
- User-friendly error display
cd backend
npm run dev # Start with nodemon
npm test # Run tests
cd frontend
npm run dev # Start development server
npm run build # Build for production
npm run preview # Preview production build