> ## Documentation Index
> Fetch the complete documentation index at: https://ihub.learnille.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Learnille Tech Stack

> Migrated from the previous Learnille internal documentation hub

## Overview

This document outlines the technologies powering the Learnille platform across all applications and infrastructure.

## Backend

### Core Framework

| Technology | Purpose |
| - | - |
| **NestJS** | Backend framework (modular, TypeScript-first) |
| **TypeScript** | Primary language |
| **TypeORM** | Database ORM and migrations |

### Databases

| Technology | Purpose |
| - | - |
| **PostgreSQL** | Primary relational database |
| **OpenSearch** | Search, recommendations, product embeddings |
| **Redis** | Caching, session storage, rate limiting |

### Background Processing

| Technology | Purpose |
| - | - |
| **BullMQ** | Job queues (video processing, emails, embeddings) |
| **Redis** | Queue backend for BullMQ |

### Authentication & Security

| Technology | Purpose |
| - | - |
| **Passport.js** | Authentication strategies |
| **JWT** | Access tokens (short-lived) |
| **HttpOnly Cookies** | Refresh tokens (secure) |
| **bcrypt** | Password hashing |
| **CASL** | Authorization and permissions |

### File Storage

| Technology | Purpose |
| - | - |
| **MinIO** | Local S3-compatible object storage for development |
| **Cloudflare R2** | CDN and storage (production) |

### Real-time

| Technology | Purpose |
| - | - |
| **Soketi** | WebSocket server (Pusher-compatible) |
| **InstantDB** | Real-time data sync |

### Payments

| Technology | Purpose |
| - | - |
| **Paystack** | Payment processing (primary) |
| **Flutterwave** | Payment processing (alternative) |

### Email & Notifications

| Technology | Purpose |
| - | - |
| **Nodemailer** | Email sending |
| **Handlebars** | Email templates |
| **OneSignal** | Push notifications |

### API Documentation

| Technology | Purpose |
| - | - |
| **Swagger/OpenAPI** | API documentation |
| **Mintlify** | Developer docs site |

***

## Frontend Applications

### Shared Stack (All Apps)

| Technology | Purpose |
| - | - |
| **React** | UI framework; version is package-specific |
| **TypeScript** | Primary language |
| **Vite** | Build tool and dev server |
| **Chakra UI v3** | Component library |
| **Zustand** | State management |
| **React Query** | Server state and caching |
| **Axios** | HTTP client |
| **Zod** | Schema validation |
| **React Router** | Routing |

### Applications

| App | Domain | Description |
| - | - | - |
| **public** | learnille.com | Student-facing marketplace |
| **student** | app.learnille.com | Student dashboard and learning |
| **instructor** | instructor.learnille.com | Instructor dashboard |
| **consultant** | consultant.learnille.com | Consultant dashboard |
| **admin** | admin.learnille.com | Admin dashboard |
| **auth** | auth.learnille.com | Authentication flows |
| **landing-page** | learnille.com | Marketing pages |

### Shared Package

| Technology | Purpose |
| - | - |
| **shared/** | Shared TypeScript types, utilities, constants |

***

## Infrastructure

### Hosting & Deployment

| Technology | Purpose |
| - | - |
| **Docker** | Containerization |
| **Docker Compose** | Local development orchestration |
| **GitHub Actions** | CI/CD pipelines |

### Monitoring & Logging

| Technology | Purpose |
| - | - |
| **Winston** | Structured logging |
| **Sentry** | Frontend and backend error tracking |

### Development Tools

| Technology | Purpose |
| - | - |
| **ESLint** | Code linting |
| **Prettier** | Code formatting |
| **Jest** | Unit and integration testing |
| **Supertest** | API testing |

***

## Third-Party Services

| Service | Purpose |
| - | - |
| **OpenAI** | Embeddings for recommendations |
| **Google OAuth** | Social login |
| **Google OAuth** | Social login |
| **Cloudflare** | CDN, DNS, security |

***

## Data Flow

```
┌─────────────┐     ┌─────────────┐     ┌─────────────┐
│   Frontend  │────▶│   NestJS    │────▶│  PostgreSQL │
│   (React)   │     │   Server    │     │             │
└─────────────┘     └──────┬──────┘     └─────────────┘
                           │
              ┌────────────┼────────────┐
              ▼            ▼            ▼
        ┌──────────┐ ┌──────────┐ ┌──────────┐
        │  Redis   │ │ OpenSearch│ │  R2/MinIO│
        │ (Cache)  │ │ (Search) │ │ (Files)  │
        └──────────┘ └──────────┘ └──────────┘
              │
              ▼
        ┌──────────┐
        │  BullMQ  │
        │  (Jobs)  │
        └──────────┘
```

***

## Key Architectural Decisions

| Decision | Rationale |
| - | - |
| **NestJS over Express** | Modular architecture, built-in DI, TypeScript-first |
| **PostgreSQL over MongoDB** | Relational data, complex queries, ACID compliance |
| **OpenSearch for search** | Full-text search, vector similarity, aggregations |
| **BullMQ over Agenda** | Redis-backed, better performance, reliable job processing |
| **Chakra UI v3** | Accessible, composable, good DX |
| **Zustand over Redux** | Simpler API, less boilerplate |
| **Separate frontend apps** | Independent deployments, role-specific UX |

***

## Version Requirements

| Technology | Version |
| - | - |
| Node.js | 18+ |
| PostgreSQL | 14+ |
| OpenSearch | 2.x-compatible Aiven service |
| Redis | 6+ |
| Docker | 20+ |

***

## Local Development

```bash theme={null}
# Start infrastructure
docker-compose up -d minio

# Start backend
cd server && npm run start:dev

# Start frontend (pick one)
cd public && npm run dev
cd admin && npm run dev
cd instructor && npm run dev
```

***

## Related Documents

* [OpenSearch Migration Plan](https://ihub.learnille.com/engineering/architecture/opensearch-migration-plan.md)
* [API Specifications](https://ihub.learnille.com/engineering/architecture/api-specifications.md)

## Last Updated

2025-01-27


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.