Skip to content

Repository files navigation

Dayoffy (Python Edition)

A robust, self-hosted Slack App for managing Leave and WFH requests. Built with Python, Slack Bolt, and DynamoDB.

Features

  • Interactive Requests: Create requests via /dayoff command or Modal.
  • Approval Workflow: Managers approve/reject requests directly from Slack.
  • In-place Updates: Messages update instantly (e.g., "Pending" -> "Approved").
  • Google Sheets Sync: Approved requests are automatically synced to a Google Sheet.
  • Business Logic: Automated duration calculation, conflict checking, and history tracking.

Architecture & GitOps

This project follows GitOps principles for deployment, separating application code from environment configuration.

  • Repos:
    • dayoffy (This Repo): Application source code, tests, and CI/CD for building images.
    • dayoffy-config: Environment-specific configurations (Staging, Production) and deployment workflows.
  • Backend: Python 3.13, FastAPI, Slack Bolt.
  • Database: AWS DynamoDB.
  • Infrastructure: Managed via Terraform (housed in dayoffy-config).

CI/CD Flow

Every push to the main branch triggers the following GitOps flow:

  1. Build & Push: GitHub Actions runs tests, builds a Docker image, and pushes it to Amazon ECR.
  2. Promote: The workflow automatically creates a Pull Request in the dayoffy-config repository with the new image tag.
  3. Deploy:
    • Staging: Merging the PR in the config repo triggers an automatic deployment to AWS App Runner.
    • Production: Promotion to production is handled via a script in the config repo and requires manual approval.

Quick Start (Local)

  1. Prerequisites: Docker, Docker Compose, Slack App credentials (App Token, Bot Token).
  2. Environment Setup: Copy .env.example to .env (create one if not exists) and fill in your Slack credentials:
    SLACK_BOT_TOKEN=xoxb-...
    SLACK_APP_TOKEN=xapp-...
    SLACK_SIGNING_SECRET=...
    GOOGLE_SHEET_ID=...
    GOOGLE_SHEETS_CREDENTIALS_JSON='{...}'
  3. Run Application:
    docker-compose up --build
  4. Access:

Development & Testing

This project uses uv for dependency management.

# Install dependencies
uv sync

# Run Unit & Integration Tests
uv run pytest tests

Usage

  • /dayoff: Open the Request Modal.
  • /dayoff leave tomorrow visiting doctor: Quick create a request.

Project Structure

.
├── app/                 # Application Source (Python, Bolt)
├── docs/                # Documentation
├── .github/workflows/   # CI/CD Workflows (GitOps Build & Promote)
├── tests/               # Unit and Integration Tests
└── scripts/             # Utility Scripts

About

No description, website, or topics provided.

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages