Skip to content

vicharanashala/cs35

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

223 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

AskSam β€” Samagama Collaborative FAQ Platform

NestJS React TypeScript MongoDB Socket.IO Tailwind CSS Vite TanStack Query React Router Node.js Mongoose JWT

A highly scalable, collaborative FAQ and Q&A platform built for Samagama students at the Vicharanashala Lab for Education Design, IIT Ropar.

πŸ“Œ Executive Summary

AskSam is a next-generation knowledge management portal engineered to prevent information loss in student communities. By leveraging automated moderation queues, verified answer tracking, and real-time community engagement, AskSam transforms chaotic forum discussions into a clean, canonical FAQ database.

The architecture is built for high availability, utilizing modern server-state management on the client and a robust, event-driven micro-service architecture on the backend.


πŸ—οΈ System Architecture

βš™οΈ Technical Topology

flowchart LR
    Client["React SPA (Frontend)"] -- "HTTP / WebSockets" --> API["NestJS Gateway (Backend)"]
    API -- "Read / Write" --> DB[("MongoDB Atlas")]
    API -. "Offline Fallback" .-> JSON["faqData.json"]
    
    style Client fill:#61DAFB,stroke:#333,stroke-width:2px,color:#000
    style API fill:#E0234E,stroke:#333,stroke-width:2px,color:#FFF
    style DB fill:#47A248,stroke:#333,stroke-width:2px,color:#FFF
    style JSON fill:#F7DF1E,stroke:#333,stroke-width:2px,color:#000
Loading

πŸ“‚ Project Structure

To maintain separation of concerns and scale efficiently, the monorepo is divided into specialized modules. Specific proprietary algorithms regarding FAQ promotion and AI moderation have been abstracted into black-box core modules.

🌍 Frontend Architecture (React / Vite)
frontend/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ assets/           # Static media, icons, and SVGs
β”‚   β”œβ”€β”€ components/       # Reusable UI components
β”‚   β”‚   β”œβ”€β”€ common/       # Buttons, Modals, Inputs
β”‚   β”‚   └── layout/       # Navbars, Sidebars, Footers
β”‚   β”œβ”€β”€ hooks/            # Custom React hooks (TanStack Query wrappers)
β”‚   β”œβ”€β”€ pages/            # View-level route components
β”‚   β”œβ”€β”€ router/           # React Router v7 configuration & lazy loading
β”‚   β”œβ”€β”€ services/         # API client & Socket.IO event listeners
β”‚   β”œβ”€β”€ store/            # Client-side state management context
β”‚   β”œβ”€β”€ styles/           # Tailwind CSS theme configuration (v4)
β”‚   β”œβ”€β”€ types/            # TypeScript interfaces and shared DTOs
β”‚   └── utils/            # Helper functions and formatters
β”œβ”€β”€ public/               # Raw static assets
β”œβ”€β”€ index.html            # Application entry point
β”œβ”€β”€ package.json          # Dependency definitions
└── vite.config.ts        # Vite build and proxy configurations
πŸ› οΈ Backend Architecture (NestJS)
backend/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ common/           # Shared guards, interceptors, and decorators
β”‚   β”œβ”€β”€ config/           # Environment variable validation schemas
β”‚   β”œβ”€β”€ core/             # πŸ”’ Proprietary Business Logic & Algorithms
β”‚   β”œβ”€β”€ modules/          # Feature-based domain modules
β”‚   β”‚   β”œβ”€β”€ auth/         # JWT generation and validation
β”‚   β”‚   β”œβ”€β”€ users/        # User profile and role management
β”‚   β”‚   β”œβ”€β”€ questions/    # Moderation queue and answer lifecycle
β”‚   β”‚   β”œβ”€β”€ faqs/         # Canonical FAQ generation handlers
β”‚   β”‚   └── search/       # Full-text indexing and query analytics
β”‚   β”œβ”€β”€ database/         # Mongoose schemas and connection factories
β”‚   β”œβ”€β”€ events/           # Socket.IO Gateway definitions
β”‚   β”œβ”€β”€ app.module.ts     # Root dependency injection container
β”‚   └── main.ts           # Server bootstrap and middleware setup
β”œβ”€β”€ scripts/              # Database seeding and migration utilities
β”œβ”€β”€ package.json          # Dependency definitions
└── tsconfig.json         # Strict TypeScript compiler options

✨ Platform Features

  • Knowledge Discovery: Lightning-fast full-text search indexing across verified FAQs and active open questions.
  • Intelligent Routing: A dynamic moderation queue that routes questions using an oldest-first algorithm.
  • Answer Verification Engine: Proprietary logic that allows authorized users to verify answers, seamlessly converting them into canonical database entries.
  • Reopen & Flagging Flow: A self-correcting community mechanism where verified answers can be challenged and sent back to the queue.
  • Real-Time WebSockets: Live data pushing via Socket.IO ensures clients are updated instantly without manual polling.
  • Role-Based Access Control (RBAC): Granular permissions ensuring only authorized admins can finalize canonical data.
  • Fault Tolerance: Built-in offline resilience that falls back to a localized JSON structure if the primary document store is temporarily unavailable.

πŸš€ Getting Started

Prerequisites

  • Node.js (v18 or higher)
  • MongoDB Server
  • npm (v9 or higher)

Environment Configuration

For security, create .env files in both directories based on these templates:

Backend Environment (backend/.env)
PORT=3000
MONGODB_URI=mongodb://localhost:27017/samagama
JWT_SECRET=your_secure_jwt_secret_key
# Core algorithmic services
GROQ_API_KEY=optional_key_for_advanced_moderation
Frontend Environment (frontend/.env)
VITE_API_URL=http://localhost:3000/api

Local Installation

  1. Clone the repository:

    git clone https://github.com/vicharanashala/cs35.git
    cd cs35
  2. Boot the API Server:

    cd backend
    npm install
    npm run start:dev
  3. Boot the Client Application:

    cd ../frontend
    npm install
    npm run dev

The application is now actively running at http://localhost:5173.


πŸ”Œ API Gateway (Core Endpoints)

The API is fully guarded. Protected routes demand a valid Bearer token within the Authorization header.

Domain Endpoint Method Action
Auth /api/auth/login POST Authenticate and issue JWT payload
FAQs /api/faqs GET Fetch canonical knowledge base
Queue /api/questions GET Query the active moderation queue
Ask /api/questions POST Dispatch a new question to the queue
Answer /api/questions/:id/answer PATCH Submit a community answer
Verify /api/questions/:id/convert-to-faq POST (Admin) Finalize and promote answer
Search /api/search/full GET Execute full-text index query

πŸ‘₯ Engineering Team

Developed and maintained by the 2026 cohort at the Vicharanashala internship program, IIT Ropar.

  • Mano Shruthi S
  • Pavan Kumar M
  • Dusi Keerthi Prasanna
  • Rashmi Risha J
  • Thivesha M. S
  • Dishi Gupta
  • Ambati Vedanandana
  • Divyadharshini S
  • Putta Sri Tejaswi
  • Akshaya Boggarapu

πŸ“œ License

This project is licensed under the MIT License.


Built for scalability. Designed for students.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors