# Twiga Admin Dashboard
## About Twiga
Twiga is an AI-powered teaching companion designed specifically for Tanzanian educators. Winner of the Meta Llama Impact Grant Award 2024, Twiga empowers teachers with AI-driven lesson support, educational resources, and guidance delivered directly through WhatsApp.
## Repository Overview
**This repository contains the admin dashboard for managing Twiga users** - it connects to the main Twiga project database. This admin interface built with Next.js provides:
- **User Management**: View and manage all Twiga users from the core database
- **Access Control**: Block, rate limit, or activate users as needed
- **Role Management**: Assign admin or teacher roles to users
- **User Analytics**: Monitor user states, activity, and onboarding progress
- **Database Integration**: Direct connection to the main Twiga PostgreSQL database
> 📱 **Looking for the main Twiga app?** The core WhatsApp-based AI teaching companion is available at Tanzania-AI-Community/twiga.
## Admin Dashboard Features
- **User State Management**: Activate, block, or rate-limit users
- **Role Assignment**: Promote users to admin or assign teacher roles
- **User Search & Filtering**: Find users by name, WhatsApp ID, school, or state
- **Analytics Dashboard**: View user statistics and activity metrics
- **Database Integration**: Direct connection to existing Twiga database
- **Docker Support**: Easy deployment with Docker and Docker Compose
## 🚀 Quick Start
### Prerequisites
- Node.js 18+
- pnpm (recommended) or npm
- Access to your Twiga project database
### Installation
1. **Clone the repository**
```bash
git clone github.com
cd twiga-admin-dashboard
```
2. **Install dependencies**
```bash
pnpm install
```
3. **Set up environment variables**
```bash
cp .env.example .env.local
```
**Important**: Configure your Twiga project database connection:
```env
# Connect to your existin …