Skip to content

DayDang/room-booking

Repository files navigation

Room Booking System

A simple CLI application for managing office room reservations with email and SMS notifications.

⚡ Quick Start

Option 1: One-Click Setup (Recommended)

Linux/macOS:

git clone https://github.com/DayDang/room-booking
cd room-booking
./setup.sh

Windows:

git clone https://github.com/DayDang/room-booking
cd room-booking
setup.bat

Option 2: Docker (Zero Dependencies)

git clone https://github.com/DayDang/room-booking
cd room-booking

# Build and run with Docker
docker build -t room-booking .
docker run --rm room-booking

Option 3: Manual Setup

git clone https://github.com/DayDang/room-booking
cd room-booking
pip install uv
uv sync
uv run python main.py --help

🚀 Try It Out

Quick Demo:

./demo.sh        # Linux/macOS
demo.bat         # Windows

Interactive Mode (Recommended):

# Start interactive mode - keeps running until you type 'quit'
uv run python main.py --interactive

# Once in interactive mode, just type commands without 'uv run python main.py'
📋 booking> check --room 1 --from "today 14:00" --to "today 16:00"
📋 booking> book --room 1 --from "today 15:00" --to "today 16:00" --name "John Doe"
📋 booking> list --date today
📋 booking> quit

Single Commands:

# Check room availability
uv run python main.py check --room 1 --from "today 14:00" --to "today 16:00"

# Book a room
uv run python main.py book --room 1 --from "today 14:00" --to "today 16:00" \
    --name "John Doe" --email "[email protected]"

# View schedule
uv run python main.py list --date today

# Cancel booking
uv run python main.py cancel --booking-id 1 --name "John Doe"

📋 Features

  • 5 Office Rooms - Book any of rooms 1-5
  • Conflict Detection - Prevents double bookings
  • 📧 Email Notifications - Automatic confirmations
  • 📱 SMS Support - Mock implementation included
  • 🗄️ SQLite Database - Reliable data persistence
  • 🕒 Business Hours - Enforces 8 AM - 6 PM, Monday-Friday
  • ⏱️ Duration Limits - 15 minutes minimum, 8 hours maximum

⚙️ Configuration

Create a .env file for email notifications:

SMTP_HOST=smtp.gmail.com
SMTP_PORT=587
[email protected]
SMTP_PASSWORD=your-app-password
[email protected]

📖 Commands Reference

Command Description Example
--interactive Interactive mode Keeps CLI running until you quit
check Check room availability --room 1 --from "today 14:00" --to "today 16:00"
book Book a room --room 1 --from "today 14:00" --to "today 16:00" --name "John" --email "[email protected]"
list View schedules --date today or --room 1
cancel Cancel booking --booking-id 123 --name "John Doe"
status System overview Shows all rooms and stats

🕒 Time Formats

  • "today 14:00", "tomorrow 09:00", "2024-12-20 14:30", "14:30"
  • Rooms: 1-5
  • Hours: 8 AM - 6 PM (Monday-Friday)
  • Duration: 15 minutes - 8 hours

🐳 Docker Usage

# Build the image
docker build -t room-booking .

# Quick test
docker run --rm room-booking

# Interactive booking mode (recommended)
docker run --rm -it room-booking uv run python main.py --interactive

# Interactive shell mode (for debugging)
docker run --rm -it room-booking /bin/bash

# Custom commands
docker run --rm room-booking uv run python main.py list

# With persistent data
docker run --rm -v $(pwd)/data:/app/data room-booking

📝 License

MIT License - see LICENSE file

Need help? Run: uv run python main.py --help

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published