Skip to content

codinggita/caia_system_design_devisingh_rajput

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

255 Commits
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿš€ CAIA System Design Knowledge Base

๐Ÿ”— Important Links


๐Ÿ“Œ Project Overview

CAIA System Design Knowledge Base is a full-stack application designed to provide a centralized platform for learning, exploring, and analyzing system design concepts.

The system is built using a real-world dataset of system design prompts and detailed responses, enabling users to search, filter, and interact with high-quality architecture knowledge in a structured way.


๐ŸŽฏ Objectives

  • Build a scalable RESTful API system
  • Design schema based on real dataset structure
  • Implement advanced search & filtering
  • Provide analytics & trending insights
  • Enable user personalization (bookmarks, notes)
  • Follow clean architecture & PR practices

โ“ Problem Statement

System design preparation is often scattered across multiple platforms with:

  • โŒ No centralized knowledge base
  • โŒ Poor search and filtering
  • โŒ No structured categorization
  • โŒ No tracking of important concepts

๐Ÿ’ก Solution

This project solves the problem by creating a structured knowledge base system where users can:

  • Browse system design prompts
  • Read detailed explanations
  • Filter by category, concept, and type
  • Search across prompts and responses
  • Track trending and popular topics
  • Bookmark and save important content

๐Ÿง  Dataset Structure

The application is built on a structured JSON dataset:

{
  "prompt": "System design question",
  "response": "Detailed explanation",
  "metadata": {
    "category": "Foundations",
    "subcategory": "Scalability",
    "concept": "Horizontal vs vertical scaling",
    "question_type": "design",
    "generated_at": "2025-08-20T17:49:57.932316"
  }
}

๐Ÿ—„๏ธ Database Schema Design

The schema is designed directly based on dataset analysis:

{
  prompt: String,
  response: String,
  metadata: {
    category: String,
    subcategory: String,
    concept: String,
    question_type: String,
    generated_at: Date
  },
  views: Number,
  bookmarks: Number,
  isArchived: Boolean
}

โœ… Key Design Decisions

  • Used prompt instead of title
  • Stored full explanation in response
  • Nested metadata for structured filtering
  • Added views, bookmarks for analytics
  • Used indexing for fast search

๐Ÿ—๏ธ System Architecture

The project follows a modular layered architecture:

  • Frontend (React) โ†’ UI & user interaction
  • Backend (Express) โ†’ API handling
  • Database (MongoDB) โ†’ Data storage
  • Middleware Layer โ†’ Auth, logging, validation

โœจ Features

๐Ÿ”น Core Features

  • CRUD operations for concepts
  • Advanced search (prompt, response)
  • Filtering (category, concept, question type)
  • Pagination & sorting

๐Ÿ”น User Features

  • Authentication (JWT)
  • Bookmark concepts
  • Add personal notes
  • Vote on concepts

๐Ÿ”น Analytics

  • Trending concepts
  • Most viewed topics
  • Category distribution

๐Ÿ”น Advanced Features

  • Related concepts
  • Daily system design challenges
  • Personalized recommendations

โš™๏ธ API Overview

๐Ÿ“Œ Concepts

  • GET /api/v1/concepts
  • GET /api/v1/concepts/:id
  • POST /api/v1/concepts
  • DELETE /api/v1/concepts/:id

๐Ÿ” Search

  • GET /api/v1/search?q=keyword
  • GET /api/v1/search/title?q=keyword

๐Ÿ“Š Analytics

  • GET /api/v1/analytics/trending
  • GET /api/v1/analytics/views/top

๐Ÿ” Authentication

  • POST /api/v1/auth/register
  • POST /api/v1/auth/login

๐Ÿ› ๏ธ Tech Stack

๐Ÿ”ง Backend

  • Node.js
  • Express.js
  • MongoDB (Mongoose)

๐ŸŽจ Frontend

  • React.js
  • Tailwind CSS

๐Ÿ” Authentication

  • JWT (JSON Web Tokens)

๐Ÿ“‚ Project Structure

caia_system_design/
โ”‚
โ”œโ”€โ”€ backend/
โ”‚  โ”œโ”€โ”€ index.js                    # Entry point (loads src/app.js)
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ app.js                  # Express app setup & middleware
โ”‚   โ”œโ”€โ”€ config/                 # Configuration files (db.js, env.js)
โ”‚   โ”œโ”€โ”€ controllers/            # Route handlers for each feature
โ”‚   โ”œโ”€โ”€ middlewares/            # Custom middleware (auth, error handling, logging)
โ”‚   โ”œโ”€โ”€ models/                 # Mongoose schemas (User, Concept, Note, etc.)
โ”‚   โ”œโ”€โ”€ routes/                 # API route definitions
โ”‚   โ”œโ”€โ”€ scripts/                # Utility scripts (seed.js, etc.)
โ”‚   โ””โ”€โ”€ utils/                  # Helper functions (response, pagination, etc.)
โ”œโ”€โ”€ package.json
โ”œโ”€โ”€ .env                        # Environment variables (create from .env.example)
โ””โ”€โ”€ README.md

๐Ÿš€ Getting Started

1๏ธโƒฃ Clone Repository

git clone whttps://github.com/mann2007-ptl/caia_system_design_mann_patel.git

2๏ธโƒฃ Install Dependencies

cd backend
npm install

3๏ธโƒฃ Setup Environment Variables

Create .env file:

PORT=5000
MONGO_URI=your_mongodb_uri
JWT_SECRET=your_secret_key

4๏ธโƒฃ Run Server

npm run dev

๐Ÿ“ฅ Data Import Strategy

The dataset is imported using:

  • insertMany() for bulk insertion
  • JSON parsing and transformation
  • Metadata mapping to schema

๐Ÿงช Testing

  • API testing using Postman
  • CRUD validation
  • Search & filter testing
  • Error handling verification

๐Ÿ“ˆ Performance Optimizations

  • Indexed fields for fast search
  • Pagination for large datasets
  • Optimized MongoDB queries
  • Efficient filtering logic

โš ๏ธ Challenges Faced

  • Mapping complex dataset to schema
  • Designing scalable API structure
  • Implementing efficient search queries
  • Handling nested metadata filtering

๐Ÿ”ฎ Future Improvements

  • AI-based summarization
  • Voice search
  • Graph-based concept visualization
  • Recommendation engine

๐Ÿค Contribution

This project is part of an academic assignment. External contributions are not open.


๐Ÿ“œ License

Educational use only.


๐Ÿ‘จโ€๐Ÿ’ป Author

Your Name GitHub: https://github.com/devisingh2007


โญ Acknowledgment

This project is developed as part of the CGxSU Full Stack Assignment to demonstrate real-world system design and backend architecture skills.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages