StackIt is a modern Question & Answer forum web application inspired by Stack Overflow. It allows users to ask programming questions, answer others, upvote, search, and more. An admin panel is included for user and content management.
- StackIt
- User registration and login
- Ask, answer, upvote, and search questions
- Rich text editor with image and emoji support
- Tagging system
- Responsive, modern UI (Tailwind CSS)
- Admin dashboard to manage users, questions, and answers
- Notification system
- Pagination and filtering
- Secure password storage (if implemented)
- MongoDB backend
StackIt/
├── backend/
│ ├── app.py # Flask backend
│ ├── requirements.txt # Python dependencies
│ └── templates/
│ ├── admin.html # Admin dashboard
│ └── ... # (other templates if any)
├── css/
│ └── styles.css # Custom styles
├── images/
│ └── layers.png # Logo and other images
├── js/
│ └── app.js # Frontend logic
├── index.html # Main frontend
├── .env # Environment variables (not committed)
└── README.md # This file
git clone https://github.com/ishansurdi/StackIt.git
cd StackIt/backendIt is recommended to use a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activatepip install -r requirements.txt- You need a running MongoDB instance (local or MongoDB Atlas).
- Create a
.envfile in thebackend/directory with your MongoDB URI:
MONGO_URI=mongodb://localhost:27017/stackit
# or for Atlas:
# MONGO_URI=mongodb+srv://<username>:<password>@cluster0.mongodb.net/stackit?retryWrites=true&w=majority
-
Environment Variables:
MONGO_URI— MongoDB connection string.- (Add more as needed, e.g.,
SECRET_KEYfor Flask sessions.)
-
Static Files:
- All static files (CSS, JS, images) are referenced with absolute paths (e.g.,
/css/styles.css,/images/layers.png).
- All static files (CSS, JS, images) are referenced with absolute paths (e.g.,
-
Start MongoDB
- If using local MongoDB, ensure the service is running.
- If using Atlas, ensure your cluster is active and IP whitelisted.
-
Start the Flask backend
cd backend
python app.py- By default, the app runs at http://localhost:5000.
- Access the application
- Main site: http://localhost:5000/
- Admin panel: http://localhost:5000/admin
-
Register an Account
- Click on the "Sign Up" or "Register" button.
- Fill in your username, email, and password.
- Submit the form to create your account.
-
Login
- Use your credentials to log in.
- You will be redirected to the home page.
-
Ask a Question
- Click "Ask Question".
- Fill in the title, description (with rich text, images, or emojis), and select relevant tags.
- Submit to post your question.
-
Browse & Search
- Use the search bar to find questions.
- Filter by newest, unanswered, or most voted.
-
Answer Questions
- Click on a question to view details.
- Use the answer editor to submit your answer.
-
Upvote & Interact
- Upvote helpful questions and answers.
- Get notifications for activity on your posts.
-
Access the Admin Panel
- Go to http://localhost:5000/admin or click the "Admin" button in the header.
-
View Users
- See a list of all registered users, their emails, and registration dates.
-
Monitor Content
- View all questions and answers posted by each user.
-
Remove Inappropriate Content
- Use the "Remove" button next to any question or answer to delete it from the platform.
-
User Management
- (Extend as needed: ban users, reset passwords, etc.)
Below are some of the main API endpoints. See
app.pyfor full details.
POST /register— Register a new userPOST /login— Login
GET /questions— List questions (with pagination)POST /questions— Ask a questionGET /questions/<id>— Get question detailsDELETE /questions/<id>— Delete a question (admin)
POST /questions/<id>/answers— Post an answerDELETE /answers/<id>— Delete an answer (admin)
GET /admin/users— List all users with their questions/answersDELETE /admin/questions/<id>— Remove a questionDELETE /admin/answers/<id>— Remove an answer
- UI:
- Edit
css/styles.cssand use Tailwind classes in HTML. - Change logo in
images/layers.png.
- Edit
- Backend:
- Add more routes or features in
backend/app.py.
- Add more routes or features in
- Database:
- Use MongoDB Compass or Atlas dashboard to view/edit data.
-
Static files not loading:
- Make sure you access the app via
http://localhost:5000/, not by opening HTML files directly. - Check your Flask static file routes.
- Make sure you access the app via
-
MongoDB connection errors:
- Ensure MongoDB is running and your
MONGO_URIis correct.
- Ensure MongoDB is running and your
-
CORS or fetch errors:
- Always run the app via Flask, not by double-clicking HTML files.
-
Port already in use:
- Change the port in
app.pyor stop the other process.
- Change the port in
-
Admin panel not working:
- Ensure you are accessing via Flask (
http://localhost:5000/admin), not by opening the HTML file directly.
- Ensure you are accessing via Flask (
Click here: watch on YouTube for a full walkthrough and demo of StackIt!
- Made By: Ishan Surdi
- UI Icons: Freepik - Flaticon
MIT License
Enjoy using StackIt! Contributions and feedback are welcome.