Prerequisites
Before installing Luna, ensure you have the following installed:- Python 3.9+
- Docker and Docker Compose
- PostgreSQL (for local development without Docker)
- Git
Dependencies
Core Packages
| Package | Version | Purpose |
|---|---|---|
| Django | 4.2.5 | Web framework |
| Django REST Framework | 3.14.0 | API development |
| psycopg2-binary | 2.9.7 | PostgreSQL adapter |
| django-cors-headers | 4.2.0 | CORS handling |
| python-decouple | 3.8 | Environment config |
| django-cron | - | Scheduled tasks |
| drf-yasg | - | API documentation |
| numpy | - | Data analysis |
Additional Dependencies
Installation Methods
Method 1: Docker Installation (Recommended)
Step 1: Clone Repository
Step 2: Configure Environment Variables
Create a.env file in the project root:
Step 3: Build and Start Services
- Web Application (Port 80 → 8000)
- PostgreSQL Database (Port 5432)
- pgAdmin (Port 8001)
Step 4: Run Database Migrations
Step 5: Create Superuser
- Email address
- First name
- Last name
- Password
Step 6: Initialize University Data
Access PostgreSQL and create initial university:- Host: localhost
- Port: 5432
- Database: postgres
- Username: (from .env PGUSER)
- Password: (from .env PGPASSWORD)
Step 7: Access Application
- Main Application: http://localhost
- Admin Portal: http://localhost/admin
- pgAdmin: http://localhost:8001
- Email: admin@pgadmin.org
- Password: admin
Method 2: Local Python Installation
Step 1: Clone and Setup Virtual Environment
Step 2: Install Dependencies
Step 3: Configure Environment
Create.env file:
Step 4: Setup PostgreSQL Database
Step 5: Run Migrations
Step 6: Start Development Server
Docker Service Management
View Logs
Container Access
Restart Services
Stop Services
Database Setup Details
Docker Compose Configuration
Thedocker-compose.yml defines three services:
Dockerfile Overview
The application uses Python 3.9 base image and:- Installs Python dependencies from
requirements.txt - Installs system utilities (cron)
- Copies application code
- Sets up entrypoint script for initialization
- Exposes port 8000
Entrypoint Process
Theentrypoint.sh script:
- Waits for PostgreSQL to be ready
- Runs database migrations
- Starts cron for scheduled tasks
- Starts Django development server
- Executes django-cron jobs every 12 hours
Verification Steps
1. Check Running Containers
2. Verify Database Connection
3. Check Migrations
4. Access Admin Panel
Navigate to http://localhost/admin and login with superuser credentials.Troubleshooting
Port Conflicts
If ports 80, 5432, or 8001 are in use, modifydocker-compose.yml:
Database Connection Issues
-
Ensure PostgreSQL container is running:
-
Check environment variables in
.env -
Verify database logs:
Migration Errors
Permission Issues
Next Steps
After successful installation:- Configure Modules - Create university modules via admin panel
- Add Users - Register students and lecturers
- Create Surveys - Design forms for data collection
- Review Architecture - See Architecture Guide
- Understand Workflows - See Student Experience and Lecturer Experience
Production Deployment
For production deployment on AWS EC2 with Nginx:- Use production-ready database (RDS or managed PostgreSQL)
- Configure Nginx as reverse proxy
- Set
DEBUG=Falsein environment - Use proper SSL certificates
- Configure allowed hosts
- Set up database backups
- Implement monitoring and logging
Support: For issues, consult project documentation or contact the development team.