-`simple_app.py` - Web-based version (requires Flask)
-`app.py` - Alternative web version (requires Flask)
## Quick Start
### 1. Run the test to see it in action
```bash
python3 test_app.py
```
This will:
- Create the database
- Add sample tablets and users
- Demonstrate loan and return operations
- Show the complete workflow
### 2. Run the interactive application
```bash
python3 minimal_app.py
```
This provides a menu-driven interface for:
- Adding tablets
- Adding users
- Loaning tablets
- Returning tablets
- Viewing inventory and loan status
### 3. Database Structure
The system uses three main tables with a **many-to-many relationship** between users and tablets:
**tablets**
-`id`: Primary key
-`brand`: Tablet brand
-`model`: Tablet model
-`serial_number`: Unique serial number
-`status`: 'available' or 'loaned'
**users**
-`id`: Primary key
-`name`: User's name
-`identification`: Unique identification
**loans** (junction table)
-`id`: Primary key
-`tablet_id`: Foreign key to tablets
-`user_id`: Foreign key to users
-`loan_date`: When the tablet was loaned
-`return_date`: When the tablet was returned (NULL if still active)
-`status`: 'active' or 'returned'
> **Note**: The loans table enables a many-to-many relationship. One user can loan **multiple tablets** (one-to-many from user to loans), and each tablet can be loaned to different users over time. The `status` field on tablets ensures a device can only be loaned to one user at a time.
## Requirements
- Python 3.x (built-in sqlite3 module)
- No additional dependencies needed for the command-line version