Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

Β 

History

168 Commits

Folders and files

Repository files navigation

ArthShastra

An interactive economics learning platform built with React and Vite, featuring lessons, quizzes, and progress tracking powered by Firebase.

🌟 Tech Stack

  • Frontend: React 19, Vite
  • Routing: React Router v6
  • Styling: CSS with CSS Variables (dark theme with neon accents)
  • Icons: React Icons (FontAwesome)
  • Backend: Firebase (Authentication, Firestore)
  • Deployment: GitHub Pages

πŸ“Š Project Health Audit (Jan 2026)

Inline CSS Status

  • Total Inline Styles: ~902 instances.
  • Verdict: Manageable / Safe.
  • Assessment: While high, React handles inline styles efficiently. The visual "lag" concerns are unfounded at this scale. For future lessons, prefer lessons.css classes for complex layouts to keep code clean, but use inline styles for dynamic values (animations, charts) without fear.

πŸ—οΈ Scalability Strategy: "The Factory Model"

To reach the goal of 1 Lesson Per Day, we are shifting from "Hand-Crafted Components" to "Templated Content".

The Plan:

  1. Create Reusable Layouts: Instead of building <div> structures for every page, we will build generic components like <LessonPage>, <ConceptCard>, <InteractiveGraph>.
  2. Data-Driven Content: Future lessons can be defined in JSON/JS files, which the templates render automatically.
  3. Unified Styling: All new lessons will strictly use lessons.css classes, reducing decision fatigue.

🌳 The Ultra-Large Project Map

A detailed view of the current Microeconomics curriculum implementation.

ArthShastra/
β”œβ”€β”€ .github/
β”‚   └── workflows/
β”‚       └── (GitHub Action definitions)
β”‚
β”œβ”€β”€ .vscode/
β”‚   └── settings.json
β”‚
β”œβ”€β”€ public/                 # Static assets served as-is
β”‚   β”œβ”€β”€ vite.svg
β”‚   └── (other static resources)
β”‚
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ assets/             # Bundled assets
β”‚   β”‚   └── react.svg
β”‚   β”‚
β”‚   β”œβ”€β”€ components/         # Global Shared Components
β”‚   β”‚   β”œβ”€β”€ common/
β”‚   β”‚   β”‚   β”œβ”€β”€ Button.jsx
β”‚   β”‚   β”‚   └── Input.jsx
β”‚   β”‚   └── ui/
β”‚   β”‚       β”œβ”€β”€ Card.jsx
β”‚   β”‚       └── Modal.jsx
β”‚   β”‚
β”‚   β”œβ”€β”€ context/            # Global State
β”‚   β”‚   └── AuthContext.jsx
β”‚   β”‚
β”‚   β”œβ”€β”€ data/
β”‚   β”‚   └── (Global static data)
β”‚   β”‚
β”‚   β”œβ”€β”€ hooks/              # Custom React Hooks
β”‚   β”‚   └── useScrollTop.js
β”‚   β”‚
β”‚   β”œβ”€β”€ pages/              # Application Routes
β”‚   β”‚   β”œβ”€β”€ Home.jsx
β”‚   β”‚   β”œβ”€β”€ Home.css
β”‚   β”‚   β”œβ”€β”€ About.jsx
β”‚   β”‚   β”œβ”€β”€ About.css
β”‚   β”‚   β”œβ”€β”€ Lessons.jsx     # Dashboard
β”‚   β”‚   β”œβ”€β”€ Lessons.css
β”‚   β”‚   β”‚
β”‚   β”‚   └── Lessons/        # πŸŽ“ LEARING CONTENT MODULES
β”‚   β”‚       β”‚
β”‚   β”‚       β”œβ”€β”€ css/        # 🎨 CENTRALIZED STYLING
β”‚   β”‚       β”‚   β”œβ”€β”€ lessons.css  # [MASTER] All Lesson Styles (5000+ lines)
β”‚   β”‚       β”‚   └── quiz.css     # Shared Quiz Styles
β”‚   β”‚       β”‚
β”‚   β”‚       β”œβ”€β”€ components/ # 🧩 SHARED LESSON COMPONENTS
β”‚   β”‚       β”‚   β”œβ”€β”€ SharedQuiz.jsx
β”‚   β”‚       β”‚   β”œβ”€β”€ index.js
β”‚   β”‚       β”‚   └── (No local CSS files here)
β”‚   β”‚       β”‚
β”‚   β”‚       β”œβ”€β”€ data/       # πŸ“„ SHARED DATA
β”‚   β”‚       β”‚   β”œβ”€β”€ lesson1Data.js
β”‚   β”‚       β”‚   β”œβ”€β”€ lesson2Data.js
β”‚   β”‚       β”‚   └── ... (Data for all lessons)
β”‚   β”‚       β”‚
β”‚   β”‚       β”œβ”€β”€ Lesson1/ (Introduction)
β”‚   β”‚       β”‚   β”œβ”€β”€ Lesson1.jsx
β”‚   β”‚       β”‚   └── components/
β”‚   β”‚       β”‚       β”œβ”€β”€ Introduction.jsx
β”‚   β”‚       β”‚       β”œβ”€β”€ Scarcity.jsx
β”‚   β”‚       β”‚       └── Quiz.jsx
β”‚   β”‚       β”‚
β”‚   β”‚       β”œβ”€β”€ Lesson2/ (Central Problems)
β”‚   β”‚       β”‚   β”œβ”€β”€ Lesson2.jsx
β”‚   β”‚       β”‚   └── components/
β”‚   β”‚       β”‚       β”œβ”€β”€ AttainableUnattainable.jsx
β”‚   β”‚       β”‚       β”œβ”€β”€ OpportunityCost.jsx
β”‚   β”‚       β”‚       β”œβ”€β”€ PPCVisualizer.jsx
β”‚   β”‚       β”‚       β”œβ”€β”€ PPCurve.jsx
β”‚   β”‚       β”‚       β”œβ”€β”€ ProductionPossibilityCurve.jsx (Wrapper)
β”‚   β”‚       β”‚       β”œβ”€β”€ Quiz.jsx
β”‚   β”‚       β”‚       β”œβ”€β”€ SlopeMOC.jsx
β”‚   β”‚       β”‚       β”œβ”€β”€ TabularRepresentation.jsx
β”‚   β”‚       β”‚       └── WhatHowForWhom.jsx
β”‚   β”‚       β”‚
β”‚   β”‚       β”œβ”€β”€ Lesson3/ (Consumer Equilibrium - Utility)
β”‚   β”‚       β”‚   β”œβ”€β”€ Lesson3.jsx
β”‚   β”‚       β”‚   └── components/
β”‚   β”‚       β”‚       β”œβ”€β”€ ConceptOfUtility.jsx
β”‚   β”‚       β”‚       β”œβ”€β”€ ConsumerEquilibrium.jsx
β”‚   β”‚       β”‚       β”œβ”€β”€ DiminishingMarginalUtility.jsx
β”‚   β”‚       β”‚       β”œβ”€β”€ LimitationsOfUtility.jsx
β”‚   β”‚       β”‚       β”œβ”€β”€ Quiz.jsx
β”‚   β”‚       β”‚       β”œβ”€β”€ SingleCommodityChart.jsx
β”‚   β”‚       β”‚       β”œβ”€β”€ TwoCommodityChart.jsx
β”‚   β”‚       β”‚       └── WhoIsConsumer.jsx
β”‚   β”‚       β”‚
β”‚   β”‚       β”œβ”€β”€ Lesson4/ (Indifference Curve)
β”‚   β”‚       β”‚   β”œβ”€β”€ Lesson4.jsx
β”‚   β”‚       β”‚   └── components/
β”‚   β”‚       β”‚       β”œβ”€β”€ BudgetLine.jsx
β”‚   β”‚       β”‚       β”œβ”€β”€ ConsumerEquilibriumIC.jsx
β”‚   β”‚       β”‚       β”œβ”€β”€ IntroToIC.jsx
β”‚   β”‚       β”‚       β”œβ”€β”€ MRSConcept.jsx
β”‚   β”‚       β”‚       β”œβ”€β”€ MeaningOfIC.jsx
β”‚   β”‚       β”‚       β”œβ”€β”€ PropertiesOfIC.jsx
β”‚   β”‚       β”‚       └── Quiz.jsx
β”‚   β”‚       β”‚
β”‚   β”‚       β”œβ”€β”€ Lesson5/ (Theory of Demand)
β”‚   β”‚       β”‚   β”œβ”€β”€ Lesson5.jsx
β”‚   β”‚       β”‚   └── components/
β”‚   β”‚       β”‚       β”œβ”€β”€ DemandCurve.jsx
β”‚   β”‚       β”‚       β”œβ”€β”€ DemandDescription.jsx
β”‚   β”‚       β”‚       β”œβ”€β”€ DemandFunction.jsx
β”‚   β”‚       β”‚       β”œβ”€β”€ LawOfDemand.jsx
β”‚   β”‚       β”‚       β”œβ”€β”€ Quiz.jsx
β”‚   β”‚       β”‚       └── ShiftVsMovement.jsx
β”‚   β”‚       β”‚
β”‚   β”‚       β”œβ”€β”€ Lesson6/ (Elasticity)
β”‚   β”‚       β”‚   β”œβ”€β”€ Lesson6.jsx
β”‚   β”‚       β”‚   └── components/
β”‚   β”‚       β”‚       β”œβ”€β”€ Applications.jsx
β”‚   β”‚       β”‚       β”œβ”€β”€ ConceptAndMeasurement.jsx
β”‚   β”‚       β”‚       β”œβ”€β”€ FactorsAffecting.jsx
β”‚   β”‚       β”‚       β”œβ”€β”€ InteractiveCurveSimulator.jsx
β”‚   β”‚       β”‚       β”œβ”€β”€ InteractiveCurveSimulatorMobile.jsx
β”‚   β”‚       β”‚       β”œβ”€β”€ Introduction.jsx
β”‚   β”‚       β”‚       β”œβ”€β”€ Quiz.jsx
β”‚   β”‚       β”‚       └── TypesOfElasticity.jsx
β”‚   β”‚       β”‚
β”‚   β”‚       β”œβ”€β”€ Lesson7/ (Production Function)
β”‚   β”‚       β”‚   β”œβ”€β”€ Lesson7.jsx
β”‚   β”‚       β”‚   └── components/
β”‚   β”‚       β”‚       β”œβ”€β”€ AssumptionsLimitations.jsx
β”‚   β”‚       β”‚       β”œβ”€β”€ PracticeProblems.jsx
β”‚   β”‚       β”‚       β”œβ”€β”€ ProductionFunction.jsx
β”‚   β”‚       β”‚       β”œβ”€β”€ ProductionSchedule.jsx
β”‚   β”‚       β”‚       β”œβ”€β”€ Quiz.jsx
β”‚   β”‚       β”‚       β”œβ”€β”€ RealWorldExamples.jsx
β”‚   β”‚       β”‚       β”œβ”€β”€ ReturnsToFactorChart.jsx
β”‚   β”‚       β”‚       └── StagesOfProduction.jsx
β”‚   β”‚       β”‚
β”‚   β”‚       └── Lesson8/ (Cost)
β”‚   β”‚           β”œβ”€β”€ Lesson8.jsx
β”‚   β”‚           └── components/
β”‚   β”‚               β”œβ”€β”€ BreakEvenShutdown.jsx
β”‚   β”‚               β”œβ”€β”€ CostCurvesChart.jsx
β”‚   β”‚               β”œβ”€β”€ CostRelationships.jsx
β”‚   β”‚               β”œβ”€β”€ PriceCeilingFloor.jsx
β”‚   β”‚               β”œβ”€β”€ ShiftsInEquilibrium.jsx
β”‚   β”‚               └── SupplyDemandEquilibrium.jsx
β”‚   β”‚
β”‚   └── StatsLessons/   # πŸ“Š STATISTICS MODULES (Consolidated Design System)
β”‚       β”œβ”€β”€ Lesson1/ (Introduction & Scope)
β”‚       β”œβ”€β”€ Lesson2/ (Collection of Data)
β”‚       β”œβ”€β”€ Lesson3/ (Organization of Data)
β”‚       β”œβ”€β”€ Lesson4/ (Presentation - Tabular)
β”‚       β”œβ”€β”€ Lesson5/ (Presentation - Diagrammatic)
β”‚       β”œβ”€β”€ Lesson13/ (Project Work & Case Study)
β”‚       └── ...
β”‚
β”‚   β”œβ”€β”€ services/           # Backend Logic
β”‚   β”‚   └── firebase.js
β”‚   β”‚
β”‚   β”œβ”€β”€ App.css
β”‚   β”œβ”€β”€ App.jsx
β”‚   β”œβ”€β”€ index.css
β”‚   └── main.jsx
β”‚
β”œβ”€β”€ .gitignore
β”œβ”€β”€ CLAUDE.md
β”œβ”€β”€ eslint.config.js
β”œβ”€β”€ index.html
β”œβ”€β”€ package-lock.json
β”œβ”€β”€ package.json
β”œβ”€β”€ vite.config.js
└── README.md

πŸ“ˆ Education Status Update

  • Microeconomics: Grade 12 (Pending)
  • IED: Grade 12 (Pending)
  • Statistics: Construction Started 🚧

🎨 Lesson Design Styles

Each lesson features a unique visual identity to keep learning engaging:

Lesson Style Theme
Lesson 1 Leonardo da Vinci Notebook
Lesson 2 Comic Book / Graphic Novel
Lesson 3 Brutalism Design
Lesson 4 Brutalism Design
Lesson 5 Comic Book Theme
Lesson 6 Brutalism Design
Lesson 7 Modern Abstract
Lesson 8 Industrial Factory Theme
Lesson 9 Corporate Finance Gold
Lesson 10 Strategic Balance / Game Theory
Lesson 11 Logistics & Supply Chain
Lesson 12 Marketplace Simulation
Lesson 13 Terminal / Hacker Theme
Stats (All) Unified Vintage & Modern Mix
- System Consolidated for Efficiency


πŸ“š Complete Curriculum Roadmap

The ArthShastra curriculum covers the entire Grade 11 Microeconomics syllabus, broken down into interactive modules.

Unit 1: Introduction to Microeconomics

Theme: Leonardo da Vinci Notebook

  • Concept of Economics: Scarcity, Choice, and Wealth.
  • Micro vs Macro: The fundamental differences.
  • Positive vs Normative: Scientific analysis vs Value judgments.
  • Economy Types: Centrally Planned, Market, and Mixed Economies.

Theme: Comic Book / Graphic Novel

  • What to Produce?: The allocation of resources.
  • How to Produce?: Labor intensive vs Capital intensive techniques.
  • For Whom to Produce?: Distribution of income and welfare.
  • PPC (Production Possibility Curve): Shifts, Rotations, and Opportunity Cost.

Unit 2: Consumer Equilibrium and Demand

Theme: Brutalism Design

  • Total & Marginal Utility: The law of diminishing returns.
  • Single Commodity Case: Equilibrium condition (MUx = Px).
  • Two Commodity Case: Law of Equi-Marginal Utility.

Theme: Brutalism Design

  • Indifference Statistics: Monotonic preferences and the MRS.
  • Budget Line: Evaluation of purchasing power and price ratio.
  • Consumer's Equilibrium: Tangency of IC and Budget Line.

Theme: Comic Book Theme

  • Law of Demand: Inverse relationship between Price and Quantity.
  • Determinants: Income, Price of Related Goods (Substitutes/Complements).
  • Exceptions: Giffen Goods and Veblen Goods.

Theme: Brutalism Design

  • Measurement: Percentage Method and Geometric Method.
  • Degrees: Perfectly Elastic to Perfectly Inelastic.
  • Factors: Nature of commodity, Time period, Availability of substitutes.

Unit 3: Producer Behaviour and Supply

Theme: Modern Abstract

  • Short Run vs Long Run: Fixed and Variable factors.
  • Law of Variable Proportions: TP, AP, and MP relationships.
  • Returns to a Factor: Increasing, Diminishing, and Negative returns.

Theme: Industrial Factory Theme

  • Categories: Fixed vs Variable, Explicit vs Implicit.
  • Cost Curves: The 'U' shape of AC, AVC, and MC.
  • Relationships: Why MC intersects AC at its minimum.

Theme: Corporate Finance Gold

  • TR, AR, MR: Definitions and calculations.
  • Market Forms: Revenue curves in Perfect vs Imperfect completion.
  • Behavior: Relationship between TR, AR, and MR.

Theme: Strategic Balance / Game Theory

  • Conditions: MC = MR and MC must be rising.
  • Analysis: Break-even point and Shutdown point.
  • Examples: Numerical determination of profit maximization.

Theme: Logistics & Supply Chain

  • Determinants: Price, Tech, Input prices, Taxes.
  • Law of Supply: Direct relationship between Price and Quantity.
  • Elasticity: Responsiveness of supply to price changes.

Unit 4: Forms of Market & Price Determination

Theme: Marketplace Simulation

  • Perfect Competition: Large buyers/sellers, homogeneous product.
  • Monopoly: Single seller, price maker.
  • Monopolistic Competition: Product differentiation.
  • Oligopoly: Interdependence and cartels.

Theme: Terminal / Hacker Theme

  • Equilibrium Price: Intersection of Demand and Supply.
  • Shifts: Effect of change in demand and supply on equilibrium.
  • Price Control: Price Ceilings and Price Floors.

Unit 5: Statistics for Economics

Theme: Vintage Newspaper

  • Nature of Statistics: Plural and Singular sense.
  • Importance: Why we need data to stop guessing.
  • Distrust of Stats: "Lies, Damned Lies, and Statistics."

Theme: Modern Data Dashboard

  • Primary vs Secondary: Direct vs Indirect collection.
  • Census vs Sample: When to count everyone vs when to guess.
  • Sampling Errors: Why your data might be lying to you.

Theme: Project Archive / Case Study

  • The Case Study: Real-world data analysis engine.
  • Project Steps: From hypothesis to conclusion.
  • Data Visualization: Making numbers look less boring.

πŸ› οΈ Engineering Architecture

ArthShastra is built for scale. Understanding the architecture is key to contributing.

Directory Structure

src/
β”œβ”€β”€ assets/             # Global static images/icons
β”œβ”€β”€ components/         # Global shared UI (Buttons, Modals, Cards)
β”œβ”€β”€ context/            # React Context (Auth, Theme)
β”œβ”€β”€ css/                # Global Variables (index.css)
β”œβ”€β”€ data/               # Global static data
β”œβ”€β”€ hooks/              # Custom Hooks (useScrollTop, usesAuth)
β”œβ”€β”€ pages/
β”‚   β”œβ”€β”€ Home/           # Landing Page
β”‚   β”œβ”€β”€ Lessons/        # THE CORE ENGINE
β”‚   β”‚   β”œβ”€β”€ css/        # Centralized Lesson Styles
β”‚   β”‚   β”‚   └── lessons.css
β”‚   β”‚   β”œβ”€β”€ components/ # Shared Lesson Components
β”‚   β”‚   β”‚   └── Quiz.jsx
β”‚   β”‚   β”œβ”€β”€ Lesson1/    # Individual Lesson Modules
β”‚   β”‚   β”œβ”€β”€ Lesson2/
β”‚   β”‚   └── ...
β”œβ”€β”€ services/           # Backend Integrations (Firebase)
└── App.jsx             # Main Router

Key Technical Decisions

  1. Vite: Selected for HMR speed. We strictly use vite.config.js.
  2. No Redux: State is localized or handled via Context API. This reduces boilerplate.
  3. Firebase: Used for:
    • Auth: Google/Email Sign-in.
    • Firestore: Storing user progress (users/{uid}/progress/{lessonId}).
    • Performance: Real-time listeners are minimized to save costs.
  4. CSS Variables: We use a robust system of CSS variables for theming.
    • --card-bg: Dark mode card backgrounds.
    • --neon-blue: Primary accent color.
    • --text-primary: Main text color.

🎨 Component Design System

We use a "Atomic Design" inspired approach but simplified for educational content.


πŸ“Š The Statistics Efficiency Realization

Note

Unit 5 Strategy Shift: In Microeconomics, every lesson was a "unique visual invention" (Comic, Brutalism, Industrial). While artistic, this was too time-consuming to develop.

For Statistics, we have shifted to a Unified Themes Architecture. All Stats lessons now share a high-end Vintage Newspaper / Modern Data Dashboard hybrid. This ensures a professional "Researcher Archive" vibe throughout the unit.


1. The Lesson Container

Every lesson page (LessonX.jsx) follows this strict layout:

  • Header: Back button + Breadcrumbs.
  • Nav: Horizontal scrolling tab bar for sections.
  • Main: The content area rendering the active component.
  • Footer: Prev/Next buttons + Progress dots.

2. Cards

We have three types of cards in lessons.css:

  • .content-card: Standard padding, white/dark bg, subtle shadow.
  • .highlight-card: Colored border, used for definitions/formulas.
  • .interactive-card: Hover effects, used for clickable elements.

3. Quizzes

The Quiz.jsx component is a complex engine that supports:

  • Multiple Choice: Standard options.
  • True/False: Boolean logic.
  • Feedback: Immediate detailed explanation on correct/incorrect answers.
  • Score Tracking: Auto-logs to Firebase upon completion.

🀝 Developer Guide: How to Build a Lesson

Want to add Lesson 14? Follow the "Factory Model":

Step 1: Create the Directory

Copy the folder structure of Lesson12 to Lesson14. Rename all files from 12 to 14.

Step 2: Define Data

Edit data/lesson14Data.js. This is where you define the structure.

export const lesson14Data = {
    title: "National Income",
    sections: [
        { id: 'intro', name: 'Introduction', icon: FaBook },
        { id: 'methods', name: 'Measurement', icon: FaCalculator }
    ],
    // ...
}

Step 3: Build Components

Create atomic components in Lesson14/components/. Rule: Do NOT write inline CSS. Use classes from lessons.css.

Step 4: Wire it Up

Import your components into Lesson14.jsx and map them in the renderActiveSection switch statement.

Step 5: Route It

Add the route in App.jsx:

<Route path="/lessons/14" element={<Lesson14 />} />

πŸ› Troubleshooting

Common Issues

1. "Firebase API Key Missing"

  • Ensure you have a .env file in the root.
  • It must contain VITE_FIREBASE_API_KEY, etc.
  • Restart the dev server after creating .env.

2. "Module Not Found"

  • Check your imports. We use absolute paths or relative paths.
  • Ensure case sensitivity (Windows ignores it, Linux enforces it).

3. "Styles Not Applying"

  • Did you import ../../css/lessons.css?
  • Are you using valid class names? Check lessons.css for typos.

πŸ“œ License & Assignments

Copyright Β© 2026 ArthShastra Education. Built for CBSE Grade 11 & 12 Economics students. Concept & Code by TRINNO ASPHALT.

β€œEconomics is the art of making the most of life.” - George Bernard Shaw


πŸš€ Running Locally

npm install
npm run dev

Documentation updated: Jan 2026 - CSS Architecture Consolidated

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages