It is web app for pet owners to help them found theirs missing animals. It allows to publish found/lost pet announcement and browse already published ones.
Start app:
docker compose up
Set up DB:
docker compose exec web rails db:create
docker compose exec web rails db:migrate
docker compose exec web rails db:migrate RAILS_ENV=test
docker compose exec web rails test
docker compose exec web /bin/bash -c "cd auth; rake test"
docker compose exec web /bin/bash -c "cd announcements; rake test"
docker compose exec frontend npm run test:unit run
docker compose exec frontend npm run lint
docker compose exec frontend npm run type-check
It is not typical Rails way application but modular-monolith based on Ruby on Rails.
Ruby on Rails has resposibility of application layer exposing HTTP API and providing programming libraries like ActiveRecord
or tools like migrations.
All "domain" code which consists any kind of business logic (not http one) is spread around modules (done in form of gems - Ruby libraries).
There are two modules currently:
- auth - email, password authentication,
- announcements - managing user announcements,
- announcements_search - allows searching for announcements by location,
- events_bus - module which provides event communication between modules.
Modules are done in to make it possible to extracted every single one of them to separate service (server instance) if needed. To achive that, every one exposes its own Facade object:
- ./auth/lib/auth.rb,
- ./announcements/lib/announcements.rb, which list all possible operations provided by the module and return data as simple objects - DTO (similar like http requests on remote server).