A modern, minimal question-and-answer platform built with the MERN stack, designed for collaborative learning and structured knowledge sharing.
- User Authentication - Register, login with JWT
- Rich Text Editor - Full-featured editor with formatting, images, links
- Question & Answers - Post questions and answers with voting
- Tagging System - Organize questions with tags
- Notification System - Real-time notifications for interactions
- Responsive Design - Mobile-first design with TailwindCSS
- Role-based Access - Guest, User, and Admin roles
- Frontend: React 18, Vite, TailwindCSS, React Router
- Backend: Node.js, Express.js, MongoDB, Mongoose
- Authentication: JWT (JSON Web Tokens)
- File Upload: Multer
- Rich Text: React Quill
- Node.js (v16 or higher)
- MongoDB (local or MongoDB Atlas)
- npm or yarn
-
Navigate to the backend directory: ```bash cd backend ```
-
Install dependencies: ```bash npm install ```
-
Create a `.env` file in the backend directory with the following variables: ```env PORT=5000 MONGODB_URI=mongodb://localhost:27017/stackit JWT_SECRET=your_super_secret_jwt_key_here_make_it_long_and_random NODE_ENV=development ```
-
Start the backend server: ```bash npm run dev ```
The backend will run on http://localhost:5000
-
Navigate to the frontend directory: ```bash cd frontend ```
-
Install dependencies: ```bash npm install ```
-
Create a `.env` file in the frontend directory with: ```env VITE_API_URL=http://localhost:5000/api ```
-
Start the frontend development server: ```bash npm run dev ```
The frontend will run on http://localhost:5173
- `PORT` - Server port (default: 5000)
- `MONGODB_URI` - MongoDB connection string
- `JWT_SECRET` - Secret key for JWT tokens
- `NODE_ENV` - Environment (development/production)
- `VITE_API_URL` - Backend API URL
- `POST /api/auth/register` - Register new user
- `POST /api/auth/login` - Login user
- `GET /api/questions` - Get all questions
- `POST /api/questions` - Create new question
- `GET /api/questions/:id` - Get question by ID
- `PUT /api/questions/:id` - Update question
- `DELETE /api/questions/:id` - Delete question
- `POST /api/answers` - Create new answer
- `PUT /api/answers/:id/vote` - Vote on answer
- `PUT /api/answers/:id/accept` - Accept answer
- `GET /api/users/profile` - Get user profile
- `PUT /api/users/profile` - Update user profile
- `GET /api/notifications` - Get user notifications
- `PUT /api/notifications/:id/read` - Mark notification as read
- Question listing with search and filters
- Rich text editor for questions and answers
- Voting system with upvote/downvote
- User authentication forms
- Notification dropdown
- Responsive navigation
- Users can browse questions as guests
- Registration required for posting questions/answers
- JWT tokens stored in localStorage
- Protected routes for authenticated users
- Role-based permissions (User/Admin)
- Mobile-first approach (using tailwind css)
- Responsive navigation
- Optimized for all screen sizes
- Touch-friendly interface
- Set production environment variables
- Build and deploy to your preferred platform (Heroku, Railway, etc.)
- Update `VITE_API_URL` to production backend URL
- Build the project: `npm run build`
- Deploy to Vercel, Netlify, or your preferred platform
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Open a Pull Request
This project is licensed under the MIT License.