How cooperkeenan/parkalot works
This repository is a small Azure Functions-based automation service whose purpose is to reserve a parking spot automatically each day.
At a high level, the architecture is:
• A Python Azure Functions app as the runtime host
• A single main function, ReserveParkalot, as the orchestration entrypoint
• A set of internal service modules that split the reservation workflow into steps
• Local Azure Storage emulation via Azurite for development/runtime state
• Shell scripts and container support for local execution and deployment
Main runtime boundary
• parkalot-func/ is the application boundary.
• parkalot-func/function_app.py and parkalot-func/ReserveParkalot/function.json indicate an Azure Functions project, with the function definition and bindings separated from the business logic.
• host.json and local.settings.json are the standard Azure Functions host/configuration files, so the app is designed to run in the Azure Functions host locally and in Azure.
Core business workflow
The main workflow lives under parkalot-func/ReserveParkalot/:
• coordinator.py is the orchestration layer. This is the most important application-level component from an architecture perspective.
• The coordinator likely drives the reservation process end-to-end and coordinates the subordinate services.
• date_calculator.py determines which date should be reserved, which suggests the reservation is not just “reserve now” but “reserve the correct day” according to business rules.
• login_service.py handles authentication to the external Parkalot system.
• reservation_service.py performs the actual reservation operation.
• verification_service.py checks that the reservation succeeded or validates the resulting state.
• notification_service.py sends a success/failure/status notification after the workflow completes.
• notification_factory.py likely chooses or constructs the right notification implementation or payload, which implies the notification mechanism is abstracted from the orchestration flow.
Likely execution/data flow
A reasonable diagram of the flow would be:
• Azure Functions trigger invokes ReserveParkalot
• ReserveParkalot delegates to coordinator.py
• coordinator.py:
- computes the target reservation date via date_calculator.py
- authenticates via login_service.py
- submits the reservation via reservation_service.py
- validates the outcome via verification_service.py
- emits a result message via notification_service.py and notification_factory.py
This is a classic orchestration-plus-services split: the function entrypoint is thin, and the actual business process is decomposed into reusable steps.
External dependencies and boundaries
The repository name and module names imply at least one external system:
• The Parkalot reservation backend or website is the primary business dependency. The code likely logs in, reserves a parking spot, and verifies success against that external system.
• A notification channel is also external, though the exact medium is not visible from the tree. The architecture clearly includes a notification boundary, but the transport could be email, messaging, or another alert mechanism.
Local infrastructure and state
The top-level c:azurite/ directory contains Azurite state:
• __azurite_db_blob__.json
• __azurite_db_queue__.json
• __azurite_db_table__.json
• __blobstorage__/...
This indicates the project depends on Azure Storage abstractions during development or local execution. In an Azure Functions app, storage is usually part of the host/runtime plumbing rather than the reservation business logic. The presence of Azurite suggests:
• local emulation of Blob/Queue/Table storage
• persisted runtime state for the function host
• support for local testing without requiring live Azure Storage
Supporting tooling
• Dockerfile shows the function app can be containerized.
• deploy.sh suggests a scripted deployment path.
• manager.sh likely provides local management or orchestration for running the app and/or emulator.
• logs/parkalot.log indicates runtime logging is captured locally, which is useful for diagnosing the workflow steps above.
Architectural boundaries to show in a diagram
If you are drawing this system, the important boundaries are:
• Azure Functions host boundary
- contains the trigger and function entrypoint
• Application workflow boundary
- coordinator.py plus the service modules
• External Parkalot system boundary
- authentication, reservation, and verification calls
• Notification boundary
- outbound status reporting
• Local Azure Storage emulator boundary
- Azurite backing the function host during development
Overall shape
This is not a multi-service distributed system. It is a single-function automation app with a clean internal separation between orchestration and step-specific services. The main architectural idea is “one scheduled/triggered function coordinates a reservation workflow against an external system, then reports the result.”
Main entry points: coordinator.py Coordinator · host.json Functions host · notification_service.py Notifier · function_app.py Function app
Components 18
Azure Functions app
Python Azure Functions boundary and workflow code
- Functions host · Azure Functions runtime boundary
parkalot-func/host.json - Function app · Python function registration and trigger wiring
parkalot-func/function_app.py - ReserveParkalot · Main function definition and bindings
parkalot-func/ReserveParkalot/function.json - Coordinator · Drives the reservation workflow end to end
parkalot-func/ReserveParkalot/coordinator.py - Date calc · Selects the reservation date
parkalot-func/ReserveParkalot/date_calculator.py - Login service · Authenticates with Parkalot
parkalot-func/ReserveParkalot/login_service.py - Reservation service · Submits the parking reservation
parkalot-func/ReserveParkalot/reservation_service.py - Verification · Checks reservation success or state
parkalot-func/ReserveParkalot/verification_service.py - Notifier · Sends workflow outcome notifications
parkalot-func/ReserveParkalot/notification_service.py - Notify factory · Builds notification payloads or implementations
parkalot-func/ReserveParkalot/notification_factory.py
Local runtime
Emulation, host config, and execution support
- Azurite · Local Azure Storage emulation for runtime state
c:azurite - Local settings · Local Azure Functions configuration
local.settings.json - Docker image · Containerized execution for the function app
parkalot-func/Dockerfile - Deploy script · Scripted deployment path
parkalot-func/deploy.sh - Manager script · Local run and management helper
manager.sh - Logs · Captured function runtime output
parkalot-func/logs/parkalot.log
External systems
Parkalot backend and outbound notification targets
- Parkalot backend · External reservation site or API
- Notify target · Outbound notification destination
Connections 19
- Functions host → Function app: runs · Functions host loads the Python app
- Function app → ReserveParkalot: registers · Function app exposes the ReserveParkalot trigger
- ReserveParkalot → Coordinator: invokes · Entry function delegates to the orchestration layer
- Coordinator → Date calc: computes date · Selects the target reservation date
- Coordinator → Login service: authenticates · Logs in before reservation actions
- Coordinator → Reservation service: reserves · Submits the booking request
- Coordinator → Verification: verifies · Checks that the reservation succeeded
- Coordinator → Notifier: notifies · Reports success or failure at the end of the workflow
- Notifier → Notify factory: builds via · Uses factory to construct notification output
- Login service → Parkalot backend: uses · Authenticates against the external Parkalot system
- Reservation service → Parkalot backend: calls · Sends reservation requests to Parkalot
- Verification → Parkalot backend: checks · Validates reservation state in Parkalot
- Notifier → Notify target: sends · Emits status notifications to an external channel
- Functions host → Azurite: stores state · Uses local storage emulation during development
- Functions host → Local settings: configured by · Local runtime settings for the Functions host
- Docker image → Function app: packages · Builds the function app into a container image
- Deploy script → Docker image: deploys · Uses container or app packaging for deployment
- Manager script → Functions host: manages · Supports local execution and host management
- Logs → Coordinator: records · Captures workflow execution output