Skip to content

About

this is official dai study tracker repo which is now live on google it is ai powered study tracker specially designed for student to manage academics and increase productivity while keeping track of all the activities

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

DAI StudyTracker 🚀

Intelligent, AI-Powered Student Productivity & Study Planner

DAI StudyTracker is a state-of-the-art study planning and tracking web application. It empowers students with AI-generated personalized study plans, topic summaries, automated flashcards/quizzes, and a conversational AI Study Coach that can directly read from and write to the user's study dashboard using agentic tool execution.


🏛️ System Architecture

DAI StudyTracker is structured as a decoupled web application with a Next.js frontend, a Django REST API backend, and an intelligent AI agent layer.

graph TD
    Client[Next.js Frontend] <-->|HTTPS / JSON API| Backend[Django API Server]
    Backend <-->|Django ORM| DB[(Database / SQLite / Postgres)]
    Backend <-->|Redis cache| Redis[(Redis Broker)]
    Backend <-->|Smart Router / SDKs| AIProviders{AI Model Providers}
    AIProviders <-->|Conversational / Tools| OpenAI[OpenAI / OpenRouter]
    AIProviders <-->|Fast Text generation| Gemini[Google Gemini]
Loading

1. Frontend: Next.js (App Router)

  • Tech Stack: Next.js 16.2.6 (App Router), TypeScript, Tailwind CSS, Radix UI, Framer Motion, Embla Carousel.
  • Key Design Patterns:
    • Server & Client Components Separation: Dynamic page routes are rendered as Server Components to handle SEO metadata, while complex user interactions are delegated to modular Client Components under components/.
    • Next.js 16 Proxy Router: Implements proxy.ts (replacing the deprecated middleware.ts naming convention) to perform edge-level redirect optimizations (lowercase path enforcement, trailing slash removal) without interfering with static or validation crawler routes.

2. Backend: Django REST Framework (DRF)

  • Tech Stack: Python 3.10+, Django, Django REST Framework, SQLite (Development) / PostgreSQL (Production), Redis.
  • Key Apps:
    • users: User authentication, stats tracking, and profile management.
    • study: Core entities including StudyPlan, Topic, Task, and Note.
    • ai_assistant: Core AI assistant services, serializers, and action schemas.

3. AI Service & Agentic Tool Execution Layer

The backend implements a highly resilient AI service (AIService) in backend/apps/ai_assistant/services.py that handles:

  • Dashboard Context Injection: Every user question automatically queries the Django ORM to serialize active study plans and notes, feeding it directly to the system prompt so the AI possesses real-time ground-truth knowledge of the user's dashboard.
  • Dual Routing: Dynamically inspects the user prompt; routing conversational requests to fast, cost-efficient chat models (e.g., openrouter/free), and structural requests (e.g., generating 4-week study plans or multiple-choice quizzes) to capable reasoning models (e.g., gpt-4o-mini, gemini-1.5-flash).
  • Dynamic Failover & Resilience: Caches deprecated or rate-limited model IDs (e.g., google/gemma-2-9b-it:free) at the class level and automatically falls back to alternative stable endpoints (such as meta-llama/llama-3-8b-instruct:free or qwen-2.5-7b-instruct:free).
  • Agentic Database Mutations (Tool Calling): When a user instructs the AI to make a change (e.g., "create a plan for Chemistry" or "complete my focus task"), the LLM returns a structured JSON tool call. The backend extracts this, runs the corresponding ORM mutations, feeds the database execution result back into the prompt, and returns a natural language response.

⚡ SEO & Redirection Engine

To ensure search engine indexing health, the application is optimized for Google Search Console (GSC) and Google AdSense validation:

  • Canonical Validation: Every core landing route (/, /about, /features, /how-it-works, /pricing) exports explicit, self-referential canonical tags to avoid layout metadata inheritance conflicts.
  • Sitemap & Robots.txt: Automated sitemap generation (/sitemap.xml) lists only final, indexable marketing pages, excluding private pages (/dashboard, /login, /register). robots.txt explicitly allows crawling of features/pricing and disallows dashboard/checkout paths.
  • Domain Canonization: Non-www to www domain redirections are offloaded directly to Vercel's edge network routing rules. This prevents conflicts and infinite redirect loops with the application-level middleware.
  • AdSense Crawling Compliance: The proxy.ts matcher explicitly excludes static verification targets:
    '/((?!api|_next/static|_next/image|favicon.ico|sitemap.xml|robots.txt|ads.txt|.*\\..*).*)'
    This ensures that Google AdSense can query /ads.txt directly (returning 200 OK) without encountering authentication checks or redirects.

🐳 DevOps & Deployment

The deployment pipeline is fully automated and designed for cloud scalability:

1. Local Staging & Environment Launch

A custom Bash shell script (deploy.sh) automatically orchestrates environment initialization:

  1. Installs Docker and Docker Compose if missing.
  2. Stops any conflicting containers.
  3. Builds and spins up the backend database (PostgreSQL), Redis broker, and Django API service in detached mode.
  4. Performs health-check polling on the backend (/health/).
  5. Installs frontend Next.js packages and fires up the development server on localhost:3000.

2. Multi-Platform Production Hosting

  • Frontend: Deployed on Vercel with custom domain configurations (www.daistudy.online).
  • Backend API: Hosted on Railway via containerized Docker configurations, pointing to production PostgreSQL and Redis engines.
  • DNS & SSL: Managed via Cloudflare for SSL termination, request buffering, and caching optimization.

🛠️ Local Installation Guide

To set up DAI StudyTracker in your local environment, follow these steps:

Prerequisites

  • Docker Engine & Docker Compose
  • Node.js (v18+) & npm / pnpm
  • Python 3.10+ (if running without Docker)

Run with Local Bash Script (Docker + Next)

Simply run the root launch script to build the backend containers and boot the frontend:

chmod +x deploy.sh
./deploy.sh

Manual Configuration

  1. Backend Configuration:

    • Navigate to backend/ and duplicate .env.example as .env.
    • Configure database variables, along with GOOGLE_AI_API_KEY or OPENAI_API_KEY for AI features.
    • Start backend manually:
      cd backend
      docker compose up --build
  2. Frontend Configuration:

    • Copy .env.production (or local env) into the root folder.
    • Install packages and start the Next.js development server:
      npm install
      npm run dev
    • Open http://localhost:3000 in your browser.

About

this is official dai study tracker repo which is now live on google it is ai powered study tracker specially designed for student to manage academics and increase productivity while keeping track of all the activities

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages