Skip to content

sagu-odoo/6483-BilliPaul0005-StackIt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

19 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

StackIt

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]

๐Ÿš€ StackIt

A Modern Q&A Forum Platform
Built with React & Node.js for collaborative learning and knowledge sharing


๐Ÿš€ Ready to Launch StackIt?

# Navigate to project directory
cd StackIt

# Start the development server
npm run dev

โœจ Your StackIt application will be running at http://localhost:5173


React Node.js MongoDB Tailwind CSS


โœจ Features

๐Ÿ” Authentication & Roles

  • Guest: Browse questions and answers
  • User: Post, vote, and interact
  • Admin: Content moderation

๐Ÿ“ Rich Text Editor

  • Formatting: Bold, Italic, Underline, Strikethrough
  • Lists: Bullet points & numbered lists
  • Code: Syntax highlighting
  • Links: URL insertion
  • Quotes: Blockquote support

๐Ÿท๏ธ Smart Tagging

  • Multi-select tag input
  • Popular tags display
  • Tag-based filtering
  • Auto-suggestions

โฌ†๏ธ Voting System

  • Upvote/downvote questions & answers
  • Visual score indicators
  • Color-coded feedback
  • User vote tracking

โœ… Answer Management

  • Accept best answers
  • Visual acceptance indicators
  • Acceptance notifications

๐Ÿ”” Real-time Notifications

  • Bell icon with unread counter
  • Dropdown with recent activity
  • Types: answers, comments, mentions, votes
  • Mark as read functionality

๐Ÿ” Advanced Search

  • Full-text search
  • Tag-based filtering
  • Sort: Newest, Most Voted, Most Viewed
  • Real-time results

๐Ÿ› ๏ธ Tech Stack

Frontend

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

Backend

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

๐Ÿ“Š Database Schema

User

{
  name: String,
  email: String (unique),
  password: String (hashed),
  role: String (guest/user/admin),
  isPrivate: Boolean,
  createdAt: Date
}

Question

{
  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
}

Answer

{
  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
}

Notification

{
  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
}

๐Ÿš€ Quick Start

Prerequisites

  • Node.js (v18 or higher)
  • MongoDB (local or cloud)
  • npm or yarn

Installation

  1. Clone & Navigate

    git clone https://github.com/yourusername/StackIt.git
    cd StackIt
  2. Install Dependencies

    # Frontend
    cd Stackit
    npm install
    
    # Backend
    cd backend
    npm install
  3. 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
  4. Start Development Servers

    # Backend (from backend directory)
    npm run dev
    
    # Frontend (from Stackit directory)
    npm run dev
  5. Access Application


๐Ÿ“ Project Structure

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

๐Ÿ”Œ API Endpoints

Authentication

Method Endpoint Description
POST /api/auth/register User registration
POST /api/auth/login User login
GET /api/auth/profile Get user profile

Questions

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

Answers

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

Notifications

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

๐ŸŽจ UI Features

Modern Design

  • โœจ Clean, minimalist interface
  • ๐ŸŽจ Consistent color scheme
  • โšก Smooth animations
  • ๐ŸŽฏ Visual feedback

Responsive Layout

  • ๐Ÿ“ฑ Mobile-first design
  • ๐Ÿ”„ Flexible grid system
  • ๐Ÿ–ฑ๏ธ Touch-friendly elements
  • ๐Ÿ“ Adaptive navigation

Rich Text Editor

  • ๐ŸŽ›๏ธ WYSIWYG interface
  • โŒจ๏ธ Keyboard shortcuts
  • ๐Ÿ“‹ Clean paste handling
  • ๐Ÿ‘๏ธ Real-time preview

Notification System

  • ๐Ÿ”” Bell icon with counter
  • ๐Ÿ“‹ Dropdown interface
  • โฐ Time-based formatting
  • ๐Ÿ‘๏ธ Unread indicators

๐Ÿš€ Deployment

Frontend (Vercel/Netlify)

npm run build
# Deploy dist/ folder

Backend (Railway/Heroku)

# Set production env vars
NODE_ENV=production
MONGO_URI=your_production_uri
JWT_SECRET=your_production_secret

npm start

๐Ÿค Contributing

  1. ๐Ÿด Fork the repository
  2. ๐ŸŒฟ Create feature branch (git checkout -b feature/amazing)
  3. ๐Ÿ’พ Commit changes (git commit -m 'Add amazing feature')
  4. ๐Ÿ“ค Push to branch (git push origin feature/amazing)
  5. ๐Ÿ”„ Open Pull Request

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


๐Ÿ™ Acknowledgments

  • ๐ŸŽจ 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 ๐Ÿš€

GitHub stars GitHub forks GitHub issues

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages