gridiron

command module
v0.0.0-...-7fb4ca9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 28, 2024 License: ISC Imports: 12 Imported by: 0

README

Gridiron

GoLang Modular Monolith designed to track American Football data.

ChatGPT 3.5 was heavily used for "busy" or "repetitive" work.

Setup

Offline - Locally
  1. Configure Rabbit MQ

    Start docker container running Rabbit MQ local.

    docker compose --env-file ./.env.offline -f ./deployments/docker-compose.yml up gridiron-rabbitmq -d
    
  2. Configure Database

    Start docker container running Postgres local.

    docker compose --env-file ./.env.offline -f ./deployments/docker-compose.yml up gridiron-db -d
    
  3. Run Migrations

    Check .env.offline and verify the correct username, password, host, and db is being used in the below command.

    Run migrations

    docker run -v ./deployments/sql/migrations:/migrations migrate/migrate -path migrations/ -database "postgres://my_user:my_password@host.docker.internal/my_db?sslmode=disable" up
    
  4. Run Gridiron

    Run the Gridiron docker container with

    docker compose --env-file ./.env.offline -f ./deployments/docker-compose.yml up -d gridiron-service
    

    You can rebuild the and run the app with the following

    docker compose --env-file ./.env.offline -f ./deployments/docker-compose.yml up -d --no-deps --build gridiron-service
    
  5. Run Web (React UI)

    Run the Gridiron React App docker container

    docker compose --env-file ./.env.offline -f ./deployments/docker-compose.yml up gridiron-web -d
    

    You can visit the app at http://localhost:3000

Clean Up

You can easily clean up your local environment with the following...

  1. Mark the bash script as executable.

    chmod +x scripts/docker-nuke.sh
    
  2. Run script to nuke environment

    ./scripts/docker-nuke.sh
    

Testing

Due to time constraints, I've opted to skip writing unit tests and instead rely solely on integration tests. While unit tests are valuable for isolating components, the effort required to mock data stores and other classes in Go can be significant. Given that this project is a demo, integration tests should suffice for validating the functionality.

go test ./test/...

Technical Design

Technical Design Document

Contributing

This project follows Feature branch workflow

Migrations

This project uses Migrate to manage migrations.

The following command can be used to generate a new migration.

migrate create -ext sql -dir deployments/sql/migrations/ -seq <name>

License

ISC License

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
internal
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL