A PHP/MySQL web application that digitizes the GBU university semester registration and payment process.
- PHP 8.1+
- MySQL 8.0+
- Composer
- Apache with
mod_rewrite(or Nginx with equivalenttry_filesconfig) - SSL certificate (HTTPS required)
-
Clone the repository
git clone <repo-url> cd semester-online-registration
-
Copy environment file and fill in values
cp .env.example .env # Edit .env with your database credentials, API keys, and app URL -
Install PHP dependencies
composer install --no-dev # production # or composer install # development (includes PHPUnit)
-
Run database migrations (in order)
mysql -u <user> -p <app_db_name> < database/migrations/001_create_students.sql mysql -u <user> -p <app_db_name> < database/migrations/002_create_otp_tokens.sql mysql -u <user> -p <app_db_name> < database/migrations/003_create_registrations.sql mysql -u <user> -p <app_db_name> < database/migrations/004_create_payments.sql mysql -u <user> -p <app_db_name> < database/migrations/005_create_admin_actions.sql
-
Configure web server
- Point the document root to the
public/directory. - Ensure
mod_rewriteis enabled (Apache) or configuretry_files(Nginx). - Enable HTTPS — HTTP requests are automatically redirected.
- Point the document root to the
-
Set up cron jobs
# Retry pending payment verifications every 6 hours 0 */6 * * * php /path/to/app/scripts/retry_verification.php # Purge expired OTP tokens hourly 0 * * * * php /path/to/app/scripts/purge_otp_tokens.php
-
Create the uploads directory (outside web root)
mkdir -p storage/uploads chmod 750 storage/uploads
./vendor/bin/phpunit --testdox├── app/
│ ├── Controllers/
│ ├── Services/
│ ├── Models/
│ ├── Views/
│ └── Middleware/
├── config/
│ ├── app.php
│ └── database.php
├── database/
│ └── migrations/
├── public/ ← web root
│ ├── index.php
│ └── .htaccess
├── scripts/
├── storage/
│ └── uploads/ ← receipt files (outside web root)
├── tests/
├── .env.example
└── composer.json