Skip to content

panteLx/BetterShift

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

97 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

BetterShift Logo

BetterShift

BetterShift Version Checks

Discord Buy Me A Coffee GitHub Sponsors

Note

BetterShift is a modern shift management application designed to simplify variable work schedules. Manage unlimited calendars with one-click shift toggles, reusable presets, and real-time synchronization across devices. Features include external calendar integration (Google, Outlook, iCal), password-protected calendars, ICS/PDF export, live statistics, calendar comparison and multi-language support. Built with Next.js 16 and SQLite for fast, self-hosted deployment.

πŸ”— Quick Links

Demo: bettershift.pantelx.com

Discord Server: Join our Discord for community discussions and support

Self-Hosting: Check out the Deployment Guide

Support the Project: Buy Me A Coffee or Become a GitHub Sponsor


✨ Key Features

πŸ“… Calendar & Shift Management

  • Multiple Calendars β€” Unlimited calendars with custom names and colors
  • Interactive Month View β€” Clean, week-based calendar layout with one-click shift toggles
  • Quick Actions β€” Left-click to add/remove shifts, right-click to add notes or events
  • External Calendar Sync β€” Subscribe to Google, Outlook or iCal calendars with auto/manual refresh
  • Sync Monitoring β€” Real-time sync status and error notifications
  • Calendar Comparison β€” Overlay multiple calendars for easy shift comparison

🎨 Customization & Organization

  • Shift Presets β€” Reusable templates with custom labels, times, and colors
  • Visual Organization β€” Color-code calendars and shifts for instant recognition
  • Auto-Save Templates β€” Automatically save shift configurations for future use
  • Export Options β€” Download as ICS or PDF with flexible time range filters

πŸ”’ Security & Privacy

  • Password Protection β€” SHA-256 encrypted calendar passwords
  • Per-Calendar Access β€” Different security levels for each calendar

πŸ“Š Analytics & Live Updates

  • Real-Time Statistics β€” Instant shift tracking and hour calculations with visual charts
  • Server-Sent Events β€” Changes sync instantly across all open browser tabs

🌍 Multi-Language & Themes

  • Built-in Translations β€” Full German, English, and Italian support
  • Dark/Light Theme β€” Toggle themes with system preference detection
  • Responsive Design β€” Optimized for desktop and mobile devices

πŸ”” Modern Stack & Updates

  • Auto Update Checks β€” Detects new releases with visual notifications
  • Integrated Changelog β€” View release notes directly in the app
  • PWA Support β€” Installable as a Progressive Web App
  • Next.js 16 + React 19 β€” Latest App Router architecture
  • SQLite + Drizzle ORM β€” Type-safe database with file-based storage
  • Docker Ready β€” Two-command deployment with Docker Compose

πŸ› οΈ Deployment Guide

🐳 Docker Deployment

Deploy using Docker for easy containerized hosting:

Option 1: Using pre-built images from GitHub Container Registry

Available image tags:

  • :latest - Latest stable release (recommended for production)
  • :v1.0.0 - Specific version (use for pinned deployments)
  • :dev - Latest development build from main branch (bleeding edge, may be unstable)
  • :pr-123 - Pull request builds (for testing PRs before merge)
# Pull the latest stable release (recommended)
$ docker pull ghcr.io/pantelx/bettershift:latest

# Or pull the latest development build
$ docker pull ghcr.io/pantelx/bettershift:dev

# Or pull a specific version
$ docker pull ghcr.io/pantelx/bettershift:v1.0.0

# Run the container
$ docker run -d \
  -p 3000:3000 \
  -v ./data:/app/data \
  --name bettershift \
  ghcr.io/pantelx/bettershift:latest

# Apply database migrations
$ docker exec bettershift npm run db:migrate

Option 2: Build locally with docker-compose

# Clone the repository
$ git clone https://github.com/pantelx/bettershift.git && cd bettershift

# Copy the example environment file
$ cp .env.example .env

# Adjust .env settings as needed

# Build and start the container
$ docker-compose up -d --build

# Apply database migrations
$ docker compose exec bettershift npm run db:migrate

# Access the application at http://localhost:3000 (or your configured port)

πŸ—οΈ Production Build

# Build the application
$ npm run build

# Start production server
$ npm start

πŸ’» Local Development

# Clone the repository
$ git clone https://github.com/pantelx/bettershift.git && cd bettershift

# Install dependencies
$ npm install

# Copy the example environment file
$ cp .env.example .env

# Adjust .env settings as needed

# Set up the database
$ npm run db:migrate

# Start the development server
$ npm run dev

# Open your browser at http://localhost:3000

πŸ“¦ Versioning & Releases

Available Docker Tags

Stable Releases:

  • ghcr.io/pantelx/bettershift:latest - Always points to the latest stable release
  • ghcr.io/pantelx/bettershift:v1.0.1 - Specific version (immutable)
  • ghcr.io/pantelx/bettershift:v1.0 - Latest patch of minor version
  • ghcr.io/pantelx/bettershift:v1 - Latest minor of major version

Development Builds:

  • ghcr.io/pantelx/bettershift:dev - Latest development build from main branch (unstable)

πŸ—„οΈ Database Management

Available Commands

# Generate new migrations after schema changes
$ npm run db:generate

# Apply migrations to the database
$ npm run db:migrate

# Open Drizzle Studio (database GUI)
$ npm run db:studio

Note

Never run npm run db:push in production. Always use migrations (db:generate + db:migrate) for safe schema changes.


πŸ§ͺ Testing & Quality Assurance

Local Testing

Run these commands before submitting a pull request:

# Run all tests (lint + build with TypeScript check)
$ npm test

# Full CI test suite (includes database migration test)
$ npm run test:ci

# Run individual checks
$ npm run lint         # ESLint code quality check
$ npm run build        # Next.js production build (includes TypeScript validation)

Recommended Pre-Commit Workflow:

  1. Run npm test to catch issues early
  2. Fix any TypeScript or linting errors
  3. Ensure build completes successfully
  4. Commit and push your changes

πŸ’– Support the Project

Your support helps maintain and improve this project! Please consider:


🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ™ Credits

Special thanks to:

  • All contributors who have contributed through code, testing, and ideas
  • The community for their feedback, support, and patience
  • Project supporters who have financially supported this initiative

πŸ“„ License

MIT