Skip to content
oovaaPublic

About

salam hack project

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

Β 

History

108 Commits

Folders and files

Repository files navigation

Darajat: AI-Powered Educational Platform

TypeScript Bun LangChain Google GenAI License Status

Salam Hackathon Project β€” AI-powered educational platform for Grades 10-12. Combines RAG-based syllabus search, AI tutoring, and adaptive content generation using LangChain + Google Gemini.


🎯 Overview

Darajat (Ψ―Ψ±Ψ¬Ψ§Ψͺ = "Grades" in Arabic) is a hackathon prototype built for the Salam Hackathon. An AI-powered educational platform targeting Grades 10-12 students in Sudan, providing intelligent tutoring, syllabus-aligned content generation, and adaptive learning paths using RAG over curriculum data.


πŸ—οΈ Architecture

darajat/
β”œβ”€β”€ backend/                    # Bun + Express + TypeScript
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ routes/
β”‚   β”‚   β”‚   β”œβ”€β”€ coach.ts        # AI Tutoring endpoint
β”‚   β”‚   β”‚   β”œβ”€β”€ content.ts      # Content generation
β”‚   β”‚   β”‚   β”œβ”€β”€ plan.ts         # Learning plan generation
β”‚   β”‚   β”‚   └── index.ts        # Route aggregation
β”‚   β”‚   β”œβ”€β”€ middleware/
β”‚   β”‚   β”‚   └── loggerMiddleware.ts
β”‚   β”‚   β”œβ”€β”€ syllabus/           # Curriculum data (JSON)
β”‚   β”‚   β”‚   β”œβ”€β”€ G10.json
β”‚   β”‚   β”‚   β”œβ”€β”€ G11.json
β”‚   β”‚   β”‚   └── G12.json
β”‚   β”‚   β”œβ”€β”€ lib/
β”‚   β”‚   β”‚   β”œβ”€β”€ llm.ts          # Google Gemini 1.5 Pro config
β”‚   β”‚   β”‚   β”œβ”€β”€ coachChain.ts   # LangChain RAG chain
β”‚   β”‚   β”‚   β”œβ”€β”€ contentGenerator.ts
β”‚   β”‚   β”‚   β”œβ”€β”€ material.ts
β”‚   β”‚   β”‚   β”œβ”€β”€ planner.ts
β”‚   β”‚   β”‚   └── syllabus.ts
β”‚   β”‚   β”œβ”€β”€ types/
β”‚   β”‚   β”‚   β”œβ”€β”€ contentResponse.ts
β”‚   β”‚   β”‚   └── plannerResponse.ts
β”‚   β”‚   └── index.ts            # Express app entry
β”‚   β”œβ”€β”€ package.json
β”‚   β”œβ”€β”€ tsconfig.json
β”‚   └── README.md
β”œβ”€β”€ frontend/                    # Static JSON lessons
β”‚   └── Lessons/
β”‚       β”œβ”€β”€ MathG10.json
β”‚       β”œβ”€β”€ MathG11.json
β”‚       β”œβ”€β”€ MathG12.json
β”‚       β”œβ”€β”€ ScienceG10.json
β”‚       β”œβ”€β”€ ScienceG11.json
β”‚       └── PhysicsG11.json
β”œβ”€β”€ erd.md                       # Entity Relationship Diagram
β”œβ”€β”€ schema-definition.md        # Database schema
β”œβ”€β”€ package.json                # Root scripts
└── README.md

πŸ›  Tech Stack

Category Technologies
Runtime Bun (primary) / Node.js
Language TypeScript 5+
Framework Express.js 4.21+
AI/ML LangChain, LangChain-Google-GenAI, LangChain-Core
LLM Google Gemini 1.5 Pro (gemini-1.5-pro)
RAG LangChain Runnables, PromptTemplate
Validation Zod (planned)
Logging Custom middleware

πŸš€ Quick Start

git clone https://github.com/oovaa/darajat.git
cd darajat

# Backend
cd backend
bun install
bun run dev    # Starts on http://localhost:3000

# Frontend lessons are static JSON
# Serve with any static server or use frontend framework

πŸ”§ Environment Variables

# backend/.env
GOOGLE_API_KEY=your_gemini_api_key
PORT=3000

πŸ“‘ API Endpoints

πŸŽ“ Coach (AI Tutor)

POST /coach
Content-Type: application/json

{
  "information": "The first law of thermodynamics states that energy cannot be created or destroyed...",
  "question": "How does the first law apply to closed systems?"
}

Response:

{
  "answer": "The first law of thermodynamics states that in a closed system, the total energy remains constant..."
}

πŸ“š Content Generation (Planned)

POST /content
Content-Type: application/json

{
  "grade": "G11",
  "subject": "Mathematics",
  "topic": "Quadratic Equations",
  "difficulty": "medium"
}

πŸ“… Learning Plan (Planned)

POST /plan
Content-Type: application/json

{
  "grade": "G12",
  "subjects": ["Mathematics", "Physics"],
  "duration_weeks": 12,
  "hours_per_week": 10
}

🧠 RAG Pipeline (Coach Chain)

// backend/lib/coachChain.ts
const coach = `
## Context:
{information}

## Question:
{question}

## Task:
Answer the provided question based on the given information

## Response:
`

const coach_prompt = PromptTemplate.fromTemplate(coach)
const chain = RunnableSequence.from([coach_prompt, llm])

export async function coachAnswer(information: string, question: string) {
  const response = await chain.invoke({ information, question })
  return { answer: response.content }
}

Flow:

  1. Retrieve relevant syllabus context from G10/G11/G12 JSON
  2. Augment prompt with retrieved information
  3. Generate answer using Gemini 1.5 Pro
  4. Return structured response

πŸ“š Curriculum Data (Grades 10-12)

Grade Subjects Format
G10 Mathematics, Science JSON
G11 Mathematics, Science, Physics JSON
G12 Mathematics, Science JSON

Sample Structure (backend/src/syllabus/G11.json):

{
  "subjects": [
    "Equations and Functions",
    "Variable Expressions",
    "Order of Operations",
    "Patterns and Equations",
    "Equations and Inequalities",
    "Functions as Rules and Tables",
    "Functions as Graphs",
    ...
  ]
}

πŸ›  Tech Stack

Category Technologies
Runtime Bun (primary) / Node.js 20+
Language TypeScript 5+ (ESM)
Framework Express.js 4.21+
AI/ML LangChain, LangChain-Google-GenAI, LangChain-Core
LLM Google Gemini 1.5 Pro (gemini-1.5-pro)
RAG LangChain Runnables, PromptTemplate, RunnableSequence
Validation Zod (planned)
Dev Tools Bun --watch, TypeScript 5+, ESLint

πŸš€ Quick Start

git clone https://github.com/oovaa/darajat.git
cd darajat

# Backend
cd backend
bun install
bun run dev    # http://localhost:3000

# Frontend lessons (static JSON)
# Serve with any static server or integrate with React/Vue

πŸ“‹ Development Scripts

// backend/package.json
{
  "scripts": {
    "dev": "bun --watch index.ts",
    "start": "bun index.ts"
  }
}

🎯 Hackathon Context

Built for Salam Hackathon β€” addressing educational gaps in Sudan with AI-powered, curriculum-aligned tutoring for Grades 10-12.

Problem

  • Limited access to quality tutoring
  • Curriculum misalignment with available resources
  • No adaptive learning for Sudanese curriculum

Solution

  • RAG over Sudanese curriculum (Grades 10-12)
  • Gemini 1.5 Pro for high-quality Arabic/English responses
  • Modular chains for coaching, content generation, planning
  • Offline-first JSON syllabus data

πŸ“‹ Roadmap

  • Vector database integration (Qdrant/Pinecone) for better RAG
  • Frontend React/Next.js application
  • User authentication & progress tracking
  • Multi-language support (Arabic/English)
  • Offline sync capability
  • Teacher dashboard for content management
  • Assessment & quiz generation
  • Voice interface for accessibility

πŸ“„ License

MIT License - see LICENSE for details.


πŸ‘€ Author

Omar Abdulrahim
GitHub: @oovaa
Salam Hackathon Participant

About

salam hack project

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages