Shikshya is a comprehensive monolithic web application architected to facilitate seamless interaction between academic stakeholders. Ideally suited for educational institutions, it combines course management, interactive study tools, and AI-powered assistance into a unified, secure platform.
The platform serves as a central hub for academic operations, facilitating:
- Course Administration: Enabling instructors to manage curricula, distribute resources (PDFs), and monitor student engagement metrics.
- Student Portal: Providing enrollment management, syllabus tracking, and an integrated study environment.
- AI-Assisted Learning: Implementing Retrieval-Augmented Generation (RAG) flows to provide context-aware explanations of course materials via the Google Gemini API.
- Role-Based Access Control: Strictly typed enforcement of permissions for Admin, Teacher, and Student roles.
- Features
- Technical Architecture
- Functional Specifications
- Engineering Optimizations
- Installation & Setup
- Environment Configuration
- Course Enrollment: Browse and enroll in available courses with real-time availability
- Interactive Study Environment: Resizable split-pane workspace with PDF viewer and AI chat
- AI-Powered Learning Assistant: Get instant explanations of course materials using context-aware AI
- Text-to-Explanation: Select any text in PDFs to receive detailed AI explanations
- Syllabus Management: Track course syllabi and upcoming topics
- Personal Dashboard: View enrolled courses, upcoming deadlines, and personalized learning progress
- Course Creation & Management: Create, update, and delete courses with rich metadata
- PDF Resource Upload: Upload and manage learning materials for each course
- Student Analytics: Monitor student enrollment and engagement metrics
- Course Customization: Organize courses by nested folder setup
- Todo Management: Track teaching tasks and course preparation items
- User Management: Oversee student and teacher accounts
- System Analytics: Monitor platform usage and performance metrics
- Role Assignment: Manage user permissions and access levels
- Platform Configuration: Control system-wide settings and features
- Contextual Chat: AI assistant understands the context of currently viewed PDF materials
- RAG Implementation: Retrieval-Augmented Generation for accurate, source-based responses
- LaTeX Support: Render mathematical equations and scientific notation in chat
- Streaming Responses: Real-time AI response streaming for better user experience
- Multi-turn Conversations: Maintain conversation context across multiple interactions
- PDF Viewer: High-fidelity document rendering with zoom, navigation, and page controls
- Resizable Workspace: Drag-to-resize panels for optimal viewing experience
- Text Selection: Select and interact with PDF text for explanations
- Responsive Design: Seamless experience across desktop and tablet devices
- Multi-Provider Authentication: Email/Password and Google OAuth support
- Session Management: Secure, encrypted session handling with Better Auth
- Role-Based Access Control (RBAC): Granular permissions for Admin, Teacher, and Student
- Route Protection: Middleware-enforced access validation on protected routes
- Input Sanitization: Comprehensive Zod schema validation across all forms and APIs
- Framework: Next.js 15 (App Router)
- Language: TypeScript (Strict Mode)
- Runtime: Node.js
- Package Manager: pnpm
- UI Library: React 19
- Styling Engine: Tailwind CSS 4
- Component System: Shadcn UI (Headless UI + Radix Primitives)
- State Management: React Query (TanStack Query) for server state; URL-based state for UI.
- Animations: Framer Motion
- API Architecture: tRPC (End-to-end type safety)
- Database: PostgreSQL (Relational Data Store)
- ORM: Drizzle ORM
- Authentication: Better Auth (Secure session management)
- File Storage: UploadThing (Object storage abstraction)
- Provider: Google Generative AI (Gemini)
- SDK: Vercel AI SDK
- Integration: Custom, context-aware query resolution for document Interaction.
- Secure Authentication Flows: Integrated robust sign-up/sign-in using Email/Password and OAuth (Google).
- Input Validation: Enforced rigorous validation using Zod schemas at both API and form levels to ensure data integrity.
- Route Protection: Middleware-based access validation.
- CRUD Operations: Comprehensive creation, read, update, and delete functionality for course content.
- Optimistic UI Updates: Immediate feedback during state mutations (e.g., course creation) prior to server confirmation.
- Visual Integration: Utilized
react-pdfandpdfjs-distfor high-fidelity rendering of academic materials within the browser.
- Split-Pane Layout: Engineered a resizable interface enabling simultaneous document viewing and chat interaction.
- Mathematical Rendering: Integrated LaTeX support for displaying complex equations within chat streams.
- Context-Aware Explanations: Select-to-explain functionality triggers AI interpretation of specific document sections.
- Type Safety: Achieved full-stack type safety through tRPC and shared Zod schemas, significantly reducing runtime anomalies.
- Performance:
- Server Components: Leveraged React Server Components (RSC) to minimize client-side bundle size.
- Streaming & Suspense: Utilized granular loading states and streaming responses for non-blocking UI rendering.
- Efficient Data Fetching: Implemented TanStack Query for optimal caching and request deduplication.
- Scalability: Designed the database schema with Drizzle ORM to support future extensions and complex relationships.
- Node.js (v18+)
- pnpm
- Docker (for local PostgreSQL instance)
-
Clone Repository
git clone https://github.com/i-ces/shikshya.git cd shikshya -
Install Dependencies
pnpm install
-
Database Initialization
./start-database.sh # Initializes a Postgres container on port 5432 -
Environment Configuration
cp .env.example .env # Update .env with valid credentials -
Schema Migration
pnpm db:push
-
Start Development Server
pnpm dev
Create a .env file in the root directory with the following variables:
DATABASE_URL: Connection string for PostgreSQL.
BETTER_AUTH_SECRET: Cryptographic secret for session security.
GOOGLE_CLIENT_ID: OAuth Client ID from Google Cloud Console.GOOGLE_CLIENT_SECRET: OAuth Client Secret.
GOOGLE_GENERATIVE_AI_API_KEY: API key for Google Gemini model access.
UPLOADTHING_TOKEN: API token for file upload service.
Auth Secret: Generate via OpenSSL:
openssl rand -base64 32Google OAuth:
- Configure a new Project in Google Cloud Console.
- Enable OAuth 2.0 APIs.
- Set Authorized Redirect URIs to
http://localhost:3000/api/auth/callback/google.