Battle Stadium is the definitive Pokemon VGC Tournament Hosting website. This project is a Ruby on Rails API with a modern React frontend, utilizing the Devise gem for authentication.
Battle Stadium is designed to facilitate the hosting and management of Pokemon VGC tournaments. It features a robust backend built with Ruby on Rails and a dynamic frontend using NextJS. Authentication is handled via the Devise gem.
-
Install docker
-
Install bun
curl -fsSL https://bun.sh/install | bash
-
Install openssl. Windows users you're on your own
brew install openssl@3
-
Set up the correct ruby version with OpenSSL. Installing and setting up a ruby version manager is entirely up to you.
Use your favorite ruby version manager to set up the correct ruby version. Below are examples of some of the most popular ruby version managers
frum install --with-openssl-dir=$(brew --prefix openssl) RUBY_CONFIGURE_OPTS="--with-openssl-dir=$(brew --prefix openssl)" rbenv install RUBY_CONFIGURE_OPTS="--with-openssl-dir=$(brew --prefix openssl@3)" asdf install ruby rvm install 3.3.5 --with-openssl-dir=$(brew --prefix openssl@3) && rvm use
-
Initialize .env files
# from the root of the repo. ./init.sh # Uses default values for postgres username, password, db name, and port # optional custom values ./init.sh p_username p_password p_db p_port
-
Install docker
-
Install devcontainers cli using your favorite package manager
bun add -g @devcontainers/cli
-
Clone the repository:
git clone https://github.com/thatguyinabeanie/battle-stadium.git cd battle-stadium
-
Initialize .env files
# from the root of the repo. ./init.sh # Uses default values for postgres username, password, db name, and port # optional custom values ./init.sh p_username p_password p_db p_port
-
Build the docker container images
docker compose build
-
Initialize containers
docker compose up -d
-
Open devcontainer instances in Visual Studio Code
devcontainer open .
-
Rails API RSpec Tests
rspec
-
Front End Tests
cd frontend bun test
-
Rails API RSpec Tests
rspec
-
Front End Tests
bun test
-
Rails API RSpec Tests
# from the root of the repo docker compose run -rm backend bash -c "rspec"
-
Front End Tests
# from the root of the repo docker compose run -rm frontend bash -c "bun test"
-
Rails API Server
docker compose up -d db bundle exec rails server -b 0.0.0.0 -p 10000
-
NextJS Server
cd frontend bun dev
-
Start the database container
docker compose up -d
-
Start the Rails API Server
docker compose exec backend bash -c "bundle exec rails server -b 0.0.0.0 -p 10000"
-
Start the NextJS Server
docker compose exec frontend bash -c "bun dev"
We welcome contributions! Please see our CODE_OF_CONDUCT.md and CONTRIBUTING.md for guidelines.
This project is licensed under the Attribution-NonCommercial-ShareAlike 4.0 International Public License
. Please see LICENSE file for details.