A Flask-based web application to schedule events and allocate shared resources while preventing time-based conflicts.
- Python
- Flask
- SQLAlchemy
- HTML, CSS
You can enable a Bootswatch theme (permanent) by setting the BOOTSWATCH_THEME environment variable to one of the Bootswatch theme names (e.g., cosmo, cyborg, litera). When set, the app will load the corresponding Bootswatch CSS from a CDN.
Example (PowerShell):
$env:BOOTSWATCH_THEME = "cosmo"If you don't set this variable the app will use default Bootstrap styling.
- Create and manage events
- Create and manage resources
- Allocate resources to events
- Conflict detection
- Resource utilisation reporting
This project supports server-side caching for reports using Redis. The app will automatically use Redis when a REDIS_URL environment variable is provided and the redis Python package is installed. If Redis is not available, the app falls back to a simple in-memory cache.
Redis provides a fast, shared cache suitable for multi-process or distributed deployments. It avoids stale report generation and reduces load for expensive report exports.
- Install and run Redis. Recommended options:
- Docker (recommended):
# Run Redis on the default port 6379
docker run -p 6379:6379 --name event-scheduler-redis -d redis:7-alpineThe UI integrates a lightweight date/time picker (flatpickr) for all date/time inputs. This provides a friendly date/time selection and displays a readable format while submitting ISO 8601 values (compatible with the backend). No configuration is required; the picker is included via CDN in the base template.
- Windows (WSL) or native installer: follow instructions at https://redis.io/docs/getting-started/installation/
- Set the
REDIS_URLenvironment variable. Examples:
- macOS / Linux:
export REDIS_URL=redis://localhost:6379/0
export CACHE_TTL=300 # optional: cache TTL in seconds (default 300)- Windows PowerShell:
$env:REDIS_URL = "redis://localhost:6379/0"
$env:CACHE_TTL = "300"- Seeding and running the app
After you have a working Python environment and dependencies installed (see below), you can create the database and seed sample data using the Flask CLI commands that ship with the app:
# Create tables and seed sample data
flask reset-db
flask seed
# Start the app (make sure FLASK_APP is set or use 'python app.py')
flask run --debug- Running tests
Run the included tests with:
# from project root (Windows)
./.venv/Scripts/python.exe -m pytest -q
# or on macOS/Linux
.venv/bin/python -m pytest -q(Or use your environment's python command.)
- Demo assets
Add screenshots and a short demo video to the demo/ folder. See demo/README.md for suggested filenames and guidance.
- (Optional) Set
CACHE_TTL(seconds) to change the TTL for cached items. The app also exposesapp.config['CACHE_TTL']if you prefer configuring it in code.
- If
REDIS_URLis set and reachable, the app uses Redis for caching CSV report outputs and sets anX-Cacheheader (HIT/MISS). - If Redis is not available, the app uses a thread-safe in-memory cache fallback. This is suitable for development or single-process deployments only.
- Cache is invalidated automatically when events, resources, or allocations are added/edited.
You can test the CSV report and caching using the GET endpoint (replace start/end as needed):
curl -v "http://127.0.0.1:5000/reports/utilisation.csv?start=2025-01-10T00:00&end=2025-01-15T00:00"Check for the X-Cache header in the response to see if a request was a HIT or MISS.
(Other sections and usage instructions remain unchanged.)