| [95cf703] | 1 | # FRRUAS Prototype — CLI Application
|
|---|
| 2 |
|
|---|
| 3 | Command-line prototype for the **Faculty Resource Reservation and Usage Analytics System (FRRUAS)**.
|
|---|
| 4 |
|
|---|
| 5 | A database course project (Databases 2025/2026 Winter) at FINKI, under the supervision of Prof. Dr. Vangel V. Ajanovski. This prototype connects to a PostgreSQL database and demonstrates six use cases through an interactive terminal interface.
|
|---|
| 6 |
|
|---|
| 7 | ## Use Cases
|
|---|
| 8 |
|
|---|
| 9 | | UC | Name | Role |
|
|---|
| 10 | |----|------|------|
|
|---|
| 11 | | UC0001 | Browse Available Resources | All |
|
|---|
| 12 | | UC0002 | Make a Resource Reservation | Teaching Staff |
|
|---|
| 13 | | UC0003 | Approve or Reject Reservations | Administrator |
|
|---|
| 14 | | UC0007 | View Resource Usage Analytics | Administrator |
|
|---|
| 15 | | UC0008 | Log In to the System | All |
|
|---|
| 16 | | UC0009 | Register a New User | Administrator |
|
|---|
| 17 |
|
|---|
| 18 | ## Prerequisites
|
|---|
| 19 |
|
|---|
| 20 | - Python 3.10+
|
|---|
| 21 | - Docker & Docker Compose (for PostgreSQL)
|
|---|
| 22 |
|
|---|
| 23 | ## Setup
|
|---|
| 24 |
|
|---|
| 25 | ### 1. Start the Database
|
|---|
| 26 |
|
|---|
| 27 | ```bash
|
|---|
| 28 | cd docker
|
|---|
| 29 | docker compose up -d
|
|---|
| 30 | ```
|
|---|
| 31 |
|
|---|
| 32 | This starts a PostgreSQL 16 container (`frruas_db`) on port 5432.
|
|---|
| 33 |
|
|---|
| 34 | ### 2. Load Schema and Seed Data
|
|---|
| 35 |
|
|---|
| 36 | ```bash
|
|---|
| 37 | docker exec -i frruas_db psql -U frruas_user -d frruas_db < database/ddl/schema_creation.sql
|
|---|
| 38 | docker exec -i frruas_db psql -U frruas_user -d frruas_db < database/dml/data_load.sql
|
|---|
| 39 | ```
|
|---|
| 40 |
|
|---|
| 41 | ### 3. Set Up the Python Environment
|
|---|
| 42 |
|
|---|
| 43 | ```bash
|
|---|
| 44 | python3 -m venv .venv
|
|---|
| 45 | source .venv/bin/activate
|
|---|
| 46 | pip install -r requirements.txt
|
|---|
| 47 | ```
|
|---|
| 48 |
|
|---|
| 49 | ### 4. Run
|
|---|
| 50 |
|
|---|
| 51 | ```bash
|
|---|
| 52 | python main.py
|
|---|
| 53 | ```
|
|---|
| 54 |
|
|---|
| 55 | ## Test Credentials
|
|---|
| 56 |
|
|---|
| 57 | All seed users share the password `password123`.
|
|---|
| 58 |
|
|---|
| 59 | | Role | Email |
|
|---|
| 60 | |------|-------|
|
|---|
| 61 | | Administrator | ana.petrovska@finki.ukim.mk |
|
|---|
| 62 | | Administrator | marko.dimitrovski@finki.ukim.mk |
|
|---|
| 63 | | Teaching Staff | elena.stojanova@finki.ukim.mk |
|
|---|
| 64 | | Teaching Staff | nikola.trajkovski@finki.ukim.mk |
|
|---|
| 65 | | Student | stefan.nikolov@students.finki.ukim.mk |
|
|---|
| 66 | | Student | martina.ilievska@students.finki.ukim.mk |
|
|---|
| 67 |
|
|---|
| 68 | ## Project Structure
|
|---|
| 69 |
|
|---|
| 70 | | File | Description |
|
|---|
| 71 | |------|-------------|
|
|---|
| 72 | | `main.py` | Entry point: login with email/password, role-based main menu |
|
|---|
| 73 | | `db.py` | Database connection helper and shared UI utilities |
|
|---|
| 74 | | `uc_browse.py` | UC0001: Browse Available Resources |
|
|---|
| 75 | | `uc_reserve.py` | UC0002: Make a Resource Reservation |
|
|---|
| 76 | | `uc_approve.py` | UC0003: Approve or Reject Reservations |
|
|---|
| 77 | | `uc_analytics.py` | UC0007: View Resource Usage Analytics |
|
|---|
| 78 | | `uc_users.py` | UC0009: Register a New User |
|
|---|
| 79 | | `docker/` | Docker Compose configuration for PostgreSQL |
|
|---|
| 80 | | `database/` | SQL scripts for schema creation and seed data |
|
|---|
| 81 |
|
|---|
| 82 | ## Technology
|
|---|
| 83 |
|
|---|
| 84 | - **psycopg2** — PostgreSQL adapter
|
|---|
| 85 | - **bcrypt** — password hashing
|
|---|