Skip to content

ryancheley/tatis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

656 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tatis

justforfunnoreally.dev badge

This is a project I created to troll my friend Barry. He's a huge Padres fan, and I'm a huge Dodgers fan.

The site can be found here

It answers one simple question:

Does Fernando Tatis Jr have an error today?

It will return either Yes or No

And it has a silly image of a throw that Tatis is making.

If you're a Padre fan you look at it and believe he's making an unbelievable throw to get someone out

If you're not, you know that Tatis is forking up the throw :)

Development Setup

Using Docker (Recommended)

The easiest way to get started is using Docker Compose:

  1. Clone the repository

  2. Copy the example environment file:

    cp .env.example .env

    Note: The .env.example file is configured for docker-compose with DATABASE_URL pointing to the db service. If you're running the app without Docker, change the host from db to localhost in your .env file.

  3. Start the services:

    docker-compose up
  4. The application will be available at http://localhost:8000

The Docker setup includes:

  • Django development server with live code reloading
  • PostgreSQL 16 database
  • Automatic database migrations on startup
  • Volume mounts for persistent data
  • Environment variables loaded from .env file

To stop the services:

docker-compose down

To rebuild after dependency changes:

docker-compose up --build

Traditional Setup (Without Docker)

If you prefer not to use Docker:

  1. Install Python 3.14+
  2. Install dependencies:
    uv pip install -e .
  3. Set up environment variables (create a .env file or export them)
  4. Run migrations:
    python manage.py migrate
  5. Start the development server:
    python manage.py runserver

Production Deployment

Deploying to Coolify

This application is ready for deployment to Coolify:

  1. In Coolify, create a new application from this Git repository
  2. Coolify will automatically detect and use the Dockerfile
  3. In Coolify's environment variables section, configure the following:
    • DATABASE_URL: Your production PostgreSQL connection string (Coolify can provision this)
      • Example: postgres://user:password@your-db-host:5432/tatis_prod
      • If using Coolify's managed PostgreSQL, it will inject this automatically
    • SECRET_KEY: Django secret key (generate a secure one)
    • DEBUG=False
    • ALLOWED_HOSTS: Your domain name(s) (e.g., yourdomain.com,www.yourdomain.com)
    • SECURE_SSL_REDIRECT=True
    • SESSION_COOKIE_SECURE=True
    • CSRF_COOKIE_SECURE=True
    • SECURE_HSTS_SECONDS=31536000
    • SECURE_HSTS_INCLUDE_SUBDOMAINS=True
    • SECURE_HSTS_PRELOAD=True
    • SECURE_PROXY_SSL_HEADER=HTTP_X_FORWARDED_PROTO,https

Important: Coolify injects environment variables directly into the container at runtime. Do NOT create a .env file in production - Coolify handles all environment configuration through its web interface. The .env.example file is only for local development reference.

The application includes:

  • Health check endpoint at /health/ for Coolify monitoring
  • Automatic database migrations on container startup
  • Static file collection during build
  • Gunicorn as the production WSGI server

Database Connection

  • Coolify can provision a PostgreSQL database and automatically inject the DATABASE_URL
  • Or you can connect to an external database by setting DATABASE_URL manually
  • The app uses django-environ to read the database connection from DATABASE_URL

Development Commands

Testing

pytest                    # Run all tests
pytest --cov              # Run with coverage
pytest --last-failed      # Run only failed tests

Code Quality

prek run --all-files     # Run pre-commit hooks
ruff format .            # Format code
ruff check --fix .       # Lint and fix
djhtml .                 # Format Django templates
ty                       # Type checking

Database

python manage.py migrate              # Run migrations
python manage.py makemigrations       # Create migrations
python manage.py loaddata fixture/*.json  # Load fixtures (if exist)

About

Does Tatis have an error today? You can check here

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages