Skip to content

Latest commit

ย 

History

15 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Uni0 University System

A comprehensive AI agent training platform featuring university management, curriculum systems, and competition arenas. This is a complete, self-contained version of the university system designed for distributed deployment.

๐ŸŽฏ Features

  • University Management: Create and manage multiple university institutions
  • Curriculum System: Design learning paths and skill trees for agents
  • Competition Arenas: Organize agent competitions with leaderboards
  • Real-time Communication: WebSocket-based real-time updates
  • RESTful API: Complete API for integration and automation
  • JWT Authentication: Secure user authentication system
  • Multi-machine Deployment: Distributed architecture across 5 backend machines

๐Ÿ—๏ธ Architecture

Backend (Arch Linux - 5 machines)

  • FastAPI application with SQLite database
  • WebSocket support for real-time communication
  • JWT Authentication for secure API access
  • Systemd service for automatic startup
  • SQLAlchemy ORM for database operations

Frontend (Windows - 1 machine)

  • React/Vite based university UI with TypeScript
  • Tailwind CSS for modern styling
  • Real-time updates via WebSocket
  • Authentication Provider for user management

๐Ÿš€ Quick Start

Prerequisites

For Backend Machines:

  • Arch Linux (recommended) or any Linux distribution
  • Python 3.8+
  • Root access for service installation
  • Network connectivity

For Frontend Machine:

  • Windows 10/11 or any OS with Node.js support
  • Node.js 18+
  • Modern web browser

Installation

1. Clone the Repository

git clone https://github.com/your-username/uni0.git
cd uni0

2. Backend Setup

# Install Python dependencies
pip install -r requirements.txt

# Set up environment
cp .env.example .env
# Edit .env with your configuration

# Run the backend
cd src
python main.py

3. Frontend Setup

cd dryad-university-ui

# Install dependencies
npm install

# Start development server
npm run dev

The application will be available at:

๐Ÿ“ Project Structure

uni0/
โ”œโ”€โ”€ src/                          # Backend source code
โ”‚   โ”œโ”€โ”€ main.py                   # FastAPI application entry point
โ”‚   โ”œโ”€โ”€ api/v1/                   # API endpoints (version 1)
โ”‚   โ”‚   โ”œโ”€โ”€ auth.py               # Authentication endpoints
โ”‚   โ”‚   โ”œโ”€โ”€ universities.py       # University management
โ”‚   โ”‚   โ”œโ”€โ”€ curriculum.py         # Curriculum operations
โ”‚   โ”‚   โ”œโ”€โ”€ competitions.py       # Competition management
โ”‚   โ”‚   โ”œโ”€โ”€ enhanced_university.py # Enhanced university features
โ”‚   โ”‚   โ”œโ”€โ”€ websocket.py          # WebSocket connections
โ”‚   โ”‚   โ””โ”€โ”€ health.py             # Health checks
โ”‚   โ”œโ”€โ”€ services/                 # Business logic services
โ”‚   โ”‚   โ”œโ”€โ”€ enhanced_university_service.py
โ”‚   โ”‚   โ”œโ”€โ”€ curriculum_engine.py  # Curriculum management engine
โ”‚   โ”‚   โ””โ”€โ”€ competition_engine.py # Competition management engine
โ”‚   โ”œโ”€โ”€ database/                 # Database layer
โ”‚   โ”‚   โ”œโ”€โ”€ database.py           # Database connection setup
โ”‚   โ”‚   โ””โ”€โ”€ models_university.py  # SQLAlchemy models
โ”‚   โ””โ”€โ”€ core/                     # Core configuration
โ”‚       โ””โ”€โ”€ config.py             # Application configuration
โ”œโ”€โ”€ dryad-university-ui/          # Frontend React application (will be moved to separate repo)
โ”‚   โ”œโ”€โ”€ src/
โ”‚   โ”‚   โ”œโ”€โ”€ App.tsx               # Main application component
โ”‚   โ”‚   โ”œโ”€โ”€ main.tsx              # Application entry point
โ”‚   โ”‚   โ”œโ”€โ”€ pages/                # Page components
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ Dashboard.tsx     # Main dashboard
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ Universities.tsx  # University management
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ Curriculum.tsx    # Curriculum view
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ Competitions.tsx  # Competition arena
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ Login.tsx         # Login page
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ Register.tsx      # Registration page
โ”‚   โ”‚   โ”œโ”€โ”€ components/           # Reusable components
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ layout/           # Layout components
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ ui/               # UI components
โ”‚   โ”‚   โ”œโ”€โ”€ providers/            # Context providers
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ AuthenticationProvider.tsx
โ”‚   โ”‚   โ”œโ”€โ”€ services/             # API services
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ api.ts
โ”‚   โ”‚   โ””โ”€โ”€ types/                # TypeScript definitions
โ”‚   โ”‚       โ””โ”€โ”€ index.ts
โ”‚   โ”œโ”€โ”€ package.json              # Node.js dependencies
โ”‚   โ”œโ”€โ”€ vite.config.ts            # Vite configuration
โ”‚   โ””โ”€โ”€ tailwind.config.js        # Tailwind CSS configuration
โ”œโ”€โ”€ scripts/                      # Deployment scripts
โ”‚   โ”œโ”€โ”€ setup-arch-linux.sh       # Arch Linux installation
โ”‚   โ”œโ”€โ”€ setup-windows-ui.ps1      # Windows UI setup
โ”‚   โ””โ”€โ”€ deploy-university-system.sh # Full deployment
โ”œโ”€โ”€ requirements.txt              # Python dependencies
โ”œโ”€โ”€ .env.example                  # Environment template
โ””โ”€โ”€ README.md                     # This file

๐Ÿ”ง Configuration

Backend Configuration

Copy .env.example to .env and configure:

# Basic configuration
APP_NAME="Uni0 University System"
DEBUG=False

# Security
SECRET_KEY="your-secure-secret-key-here"
ACCESS_TOKEN_EXPIRE_MINUTES=30

# Database
DATABASE_URL="sqlite:///./uni0.db"

# CORS (for frontend access)
BACKEND_CORS_ORIGINS=["http://localhost:3000","http://127.0.0.1:3000"]

Frontend Configuration

The frontend automatically connects to the backend API. For custom configuration, edit dryad-university-ui/.env:

VITE_API_BASE_URL=http://localhost:8000/api/v1

๐ŸŽฎ Usage

Starting the System

Backend:

cd src
python main.py

Frontend: (will be in separate repository)

cd dryad-university-ui
npm run dev

Access Points

API Examples

# Health check
curl http://localhost:8000/health

# Login and get token
curl -X POST http://localhost:8000/api/v1/auth/login \
  -H "Content-Type: application/json" \
  -d '{"username": "admin", "password": "password"}'

# List universities (with token)
curl -H "Authorization: Bearer YOUR_TOKEN" http://localhost:8000/api/v1/universities

๐Ÿ”Œ API Endpoints

Authentication

  • POST /api/v1/auth/login - Login and get token
  • POST /api/v1/auth/refresh - Refresh token
  • GET /api/v1/auth/me - Get current user info

Universities

  • GET /api/v1/universities - List all universities
  • POST /api/v1/universities - Create a university
  • GET /api/v1/universities/{id} - Get university details
  • PUT /api/v1/universities/{id} - Update university
  • DELETE /api/v1/universities/{id} - Delete university

Curriculum

  • GET /api/v1/curriculum - List curricula
  • POST /api/v1/curriculum - Create curriculum
  • GET /api/v1/curriculum/{id} - Get curriculum details
  • PUT /api/v1/curriculum/{id} - Update curriculum

Competitions

  • GET /api/v1/competitions - List competitions
  • POST /api/v1/competitions - Create competition
  • GET /api/v1/competitions/{id}/leaderboard - Get leaderboard

WebSocket

  • GET /api/v1/ws/{client_id} - WebSocket connection
  • Real-time updates for agent status, competitions, and curriculum progress

๐Ÿ› ๏ธ Development

Backend Development

# Create virtual environment (recommended)
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

# Run development server
cd src
uvicorn main:app --reload --host 0.0.0.0 --port 8000

Frontend Development

cd dryad-university-ui

# Install dependencies
npm install

# Start development server
npm run dev

# Build for production
npm run build

๐Ÿ› Troubleshooting

Common Issues

Backend not starting:

# Check service status
systemctl status uni0

# View logs for errors
journalctl -u uni0.service --no-pager -n 50

# Check port availability
netstat -tulpn | grep 8000

Frontend connection issues:

  • Verify backend is running and accessible
  • Check CORS configuration in backend
  • Ensure firewall allows port 3000 on Windows

Database issues:

# Check database file permissions
ls -la /opt/uni0/data/

# Test database connection
python -c "from src.database.database import engine; engine.connect()"

๐Ÿ“ˆ Monitoring

Service Health

Backend health check:

curl http://localhost:8000/health
curl http://localhost:8000/api/v1/health/performance

WebSocket connections:

curl http://localhost:8000/api/v1/ws/stats

Logs

Backend logs:

journalctl -u uni0.service -f

Frontend logs:

  • Check browser developer console
  • Check terminal where npm run dev is running

๐Ÿ”’ Security

  • JWT-based authentication with configurable expiration
  • CORS configuration for controlled access
  • SQLite database with file permissions
  • Systemd service running as non-root user (recommended)
  • Firewall configuration for port access

๐Ÿค Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ™ Acknowledgments

  • Built on FastAPI for high-performance APIs
  • React/Vite for modern frontend development
  • Tailwind CSS for styling
  • Inspired by educational and training platform requirements

Uni0 University System - A comprehensive AI agent training platform.

About

No description, website, or topics provided.

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages