Backend

Backend

Chorescore Backend

Chorescore is a Go-based backend service for a chore management and gamification system. Here's what it does:

Core Functionality

  • Chore Management: Create, manage, and track chores/tasks for teams and individuals
  • Team Collaboration: Enable teams to collaborate on shared tasks with different user roles
  • Score Tracking: Award points/scores for completed tasks, with various scoring intervals (daily, weekly, monthly, etc.)
  • Task Scheduling: Support for flexible task scheduling with multiple interval types

Key Features

  1. Authentication & Security

    • JWT-based token authentication
    • OAuth2 integration
    • Admin/moderator user roles
    • CSRF protection
    • Secure cookie handling
  2. Data Management

    • SQLite database for persistent storage
    • Redis for session management and caching
    • Session persistence with configurable timeouts
  3. Real-time Updates

    • WebSocket support for live updates
    • Event-driven architecture
  4. Analytics & Reporting

    • User score tracking and history
    • Task completion analytics
    • Performance metrics via Prometheus
  5. API Documentation

    • Auto-generated Swagger/OpenAPI documentation
    • Template-based API documentation generation

Architecture

  • Built with Gin web framework for HTTP routing and middleware
  • Redis for caching and session management
  • ZeroLog for structured logging
  • Cobra CLI for command-line interface
  • Modular server architecture with separate handlers for different concerns

Configuration Options

  • Highly configurable via environment variables
  • Support for multiple themes (mentioned Eastern theme in config)
  • Custom API documentation templates
  • Blog and documentation integration

Deployment

  • Can run with TLS/SSL for secure connections
  • Supports both development and production modes
  • Network exposure options for testing

The backend provides a RESTful API for frontend clients to interact with the chore management system, supporting operations like creating teams, assigning tasks, tracking user scores, and managing team rules.