Skip to content

Conversation

@onelrian
Copy link
Owner

Overview

This PR transitions the VividShift project toward production readiness by refining the backend architecture and introducing a modern, React-based dashboard.

Backend Improvements

  • Robust Error Handling: Replaced all instances of .unwrap() and .expect() with anyhow::Context for better observability and failure management in src/db.rs, src/api/, and src/discord.rs.
  • Dynamic Configuration: Implemented a settings table in the database, allowing runtime configuration of assignment intervals and Discord integration.
  • Async Efficiency: Optimized the REST API handlers to avoid blocking the async runtime during external I/O (e.g., Discord webhooks).
  • Service Layering: Restructured logic into a dedicated assignment_engine.rs to support both CLI and REST API use cases.

Frontend Enhancements

  • Modern Dashboard: Built a premium user interface using Vite, React, TailwindCSS, and Framer Motion.
  • Authentication: Integrated Supabase Auth for secure access management.
  • Lint Cleanup: Fixed all TypeScript lint errors related to type-only imports and unused variables.

CI/CD

  • Updated GitHub Actions to favor manual triggers and dynamic scheduling.

Verification

  • Backend compiled successfully with cargo build.
  • Frontend lints passed.
  • Local manual verification of API endpoints and UI responsiveness.

- Add configurable assignment_interval_days to Settings struct (1-365 days, defaults to 14)
- Create config/default.toml for centralized configuration
- Update db::should_run() to accept configurable interval parameter
- Replace hardcoded 14-day interval with configuration-driven approach
- Add comprehensive config tests with serial execution (7 tests)
- Add serial_test dev dependency to prevent env var test interference
- Fix doctests in people_config.rs

Workflow optimization:
- Remove inefficient daily cron trigger from GitHub Actions
- Default to manual workflow_dispatch for better resource efficiency
- Add APP__ASSIGNMENT_INTERVAL_DAYS environment variable support
- Document scheduling strategies (manual, external scheduler, daily cron)

Documentation:
- Update README.md with configuration guide and scheduling options
- Add cross-reference in docs/PEOPLE_DATA.md
- Document configuration precedence (env vars > files > defaults)

Test results: All 41 tests passing
- 7 lib tests + 9 main tests + 7 config tests + 16 people_config tests + 2 doctests

Backward compatible: Existing setups continue using 14 days automatically.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant