Skip to content

Tarunkumar0601/Event-Scheduler

Repository files navigation

Event Scheduling & Resource Allocation System

A Flask-based web application to schedule events and allocate shared resources while preventing time-based conflicts.

Demo Video

Project demo drive link

Tech Stack

  • Python
  • Flask
  • SQLAlchemy
  • HTML, CSS

UI Themes (optional)

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.

Features

  • Create and manage events
  • Create and manage resources
  • Allocate resources to events
  • Conflict detection
  • Resource utilisation reporting

Caching (Redis)

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.

Why use Redis

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.

How to enable Redis locally

  1. 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-alpine

Date/time picker (improved UX)

The 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.

  1. Set the REDIS_URL environment 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"
  1. 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
  1. 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.)

  1. Demo assets

Add screenshots and a short demo video to the demo/ folder. See demo/README.md for suggested filenames and guidance.

  1. (Optional) Set CACHE_TTL (seconds) to change the TTL for cached items. The app also exposes app.config['CACHE_TTL'] if you prefer configuring it in code.

Behavior

  • If REDIS_URL is set and reachable, the app uses Redis for caching CSV report outputs and sets an X-Cache header (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.

Testing the cache

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.)

About

A Flask-based web application to schedule events and allocate shared resources while preventing time-based conflicts.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors