Skip to content
Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

76 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🍞 Bread Van App CLI

This project provides a command-line interface (CLI) for managing and interacting with the Bread Van App. It is built with Flask CLI and click, and supports multiple roles: Admin, Driver, and Resident.

πŸš€ Setup

Install dependencies:

$ pip install -r requirements.txt

Initialize the database:

flask init

This creates and initializes all accounts and tables.

  • Admin
    • admin / adminpass
  • Drivers
    • bob / bobpass
    • mary / marypass
  • Residents
    • alice / alicepass
    • jane / janepass
    • john / johnpass

Run any CLI command using:

flask <group> <command> [args...]

(NEW) Table Inspection Commands

Description Command
Display user table flask list-users
Display admin table flask list-admins
Display resident table flask list-residents
Display driver table flask list-drivers
Display area table flask list-areas
Display street table flask list-streets
Display drive table flask list-drives
Display stop table flask list-stops
Display street subscription table flask list-street-subscriptions
Display notification table flask list-notifications
Display menu table flask list-menus
Display bread item table flask list-bread-items
Display menu bread item table flask list-menu-bread-items

(NEW) Special Feature Commands for Observer Pattern

User Group Command
Resident flask resident subscribe
Resident flask resident unsubscribe
Resident flask resident view-notifications
Resident flask resident view-subscriptions
Admin flask admin schedule-drive YYYY-MM-DD HH:MM

πŸ‘€ User Commands | Group: flask user

Login

 flask user login <username> <password>

Logout

flask user logout

View Drives on a Street

flask user view_street_drives

Prompts to select an area and street, then lists scheduled drives.

πŸ› οΈ Admin Commands | Group: flask admin

Admins manage drivers, areas, and streets.

List Users

flask admin list

Create Driver

flask admin create_driver <username> <password>

Delete Driver

flask admin delete_driver <driver_id>

Add Area

flask admin add_area <name>

Add Street

flask admin add_street <area_id> <name>

Delete Area

flask admin delete_area <area_id>

Delete Street

flask admin delete_street <street_id>

View All Areas

flask admin view_all_areas

View All Streets

flask admin view_all_streets

🚐 Driver Commands | Group: flask driver

Drivers manage drives and stops.

Schedule Drive

flask driver schedule_drive YYYY-MM-DD HH:MM

Prompts to select area & street. Drives cannot be scheduled in the past nor more than 1 year ahead of the current date.

Cancel Drive

flask driver cancel_drive <drive_id>

View My Drives

flask driver view_my_drives

Start Drive

flask driver start_drive <drive_id>

End Drive

flask driver end_drive

View Requested Stops

flask driver view_requested_stops <drive_id>

🏠 Resident Commands | Group: flask resident

Residents can request stops and view their inbox.

Create Resident

flask resident create <username> <password>

Prompts for area, street, and house number. A logged-in account is not required to create a resident.

Request Stop

flask resident request_stop

Cancel Stop

flask resident cancel_stop <drive_id>

View Inbox

flask resident view_inbox

View Driver Stats

flask resident view_driver_stats <driver_id>

πŸ”‘ Role Requirements

  • flask admin ... β†’ must be logged in as Admin
  • flask driver ... β†’ must be logged in as Driver
  • flask resident ... β†’ must be logged in as Resident

General user commands (login/logout/view_street_drives) are available to all.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages