Simple app for creating Magic the Gathering decks.
code highlights:
- stimulus controller with datatables with filtering
- view components for datatables
- simple MTG API client to get card data
- CommonController - a way to create new controllers with minimal configuration
- PathGenerator PORO - a helper to create url based on a passed object (for DRY purposes)
This project uses Rails 7.2, Ruby 3.4 and Postgresql.
-
Clone the repository:
git clone https://github.com/MateuszJanosik/mtg_decks.git cd mtg_decks
-
Install dependencies:
bundle install
-
Install RMagick dependencies: On macOS:
brew install imagemagick
On Ubuntu:
sudo apt-get install imagemagick libmagickwand-dev
-
Install Redis: On macOS:
brew install redis
On Ubuntu:
sudo apt-get install redis-server
-
Set up the database:
rails db:create rails db:migrate rails db:seed
When you run db:seed it downloads MTG card data from the API and creates cards with images in the database, so it may take a minute.
The seed file also creates two sample user profiles:
- Admin user:
[email protected]
with passwordpassword
- Player user:
[email protected]
with passwordpassword
- Admin user:
-
Start Redis server:
redis-server
-
Start Sidekiq:
bundle exec sidekiq
-
Run the Rails server:
rails server
-
Open your browser and navigate to:
http://localhost:3000