Climbing Route Registration and Tracking Application. An application that allows users to register and visualize the climbing routes they have completed.
Each route should have information such as: location, difficulty level, date climbed, comments.
Users should be able to view statistics and averages of their ascents.
Project board: https://github.com/users/ferminhg/projects/1/views/1
- Ruby: https://www.ruby-lang.org/en/documentation/installation/
- Rails: https://guides.rubyonrails.org/v5.0/getting_started.html
- node: https://nodejs.org/en/download
- npm: https://docs.npmjs.com/downloading-and-installing-node-js-and-npm
This project is a web application that allows users to register and visualize the climbing routes they have completed. It should apply the hexagonal architecture and the SOLID principles.
The application uses the following technologies:
- Web-app:
- React
- Next.js
- Typescript
- Backend:
- RoR
- SQLite
- Docker
$ tree -L 4 api
api/
βββ Dockerfile
βββ Gemfile
βββ app
β βββ application // the aplication layer contains all the uses cases of the application. They use ports, are agnostic to the infra implementation
β β βββ create_route_handler.rb
β β βββ populate_data_storage_on_route_created.rb
β β βββ search_all_routes_query_handler.rb
β βββ controllers // the controllers layer contains the entry points of the application. They use the application layer and define the infra implementation
β β βββ application_controller.rb
β βββ domain
β β βββ create_route_dto.rb //DTOs are used to pass data between layers
β β βββ difficult_level.rb // Value object that contains their logic
β β βββ params_route_sanitizer.rb // Sanitizes the params from the controller
β β βββ route.rb // Entity that contains their logic
β β βββ route_created_event.rb // Event that is used to notify the application layer
β β βββ route_error.rb // Domin Error, add semantic to the errors
β βββ infrastructure
β β βββ in_memory_event_store.rb // Memory implementation of the event store, used for testing
β β βββ in_memory_route_repository.rb // Memory implementation of the route repository, used for testing
β β βββ sqlite_route_repository.rb // SQLite implementation of the route repository
β βββ models
β βββ route_model.rb // Not used
βββ config
β βββ database.yml
β βββ initializers
β β βββ rails_event_store.rb // Configures the event store. Connect events and subscribers
β β βββ sentry.rb // Observability tool
β βββ routes.rb
βββ db
β βββ migrate // Migrations
β β βββ 20230529185421_create_route_models.rb
β β βββ 20230529191822_change_climbing_time_to_integer.rb
β β βββ 20230607075003_create_event_store_events.rb
βββ docker-compose.yml
βββ spec // Tests
β βββ application
β β βββ create_route_handler_spec.rb
β β βββ search_all_routes_query_handler_spec.rb
β βββ controllers // Integration tests
β β βββ application_controller_spec.rb
β βββ domain
β β βββ calculator_spec.rb
β β βββ create_route_dto_mother.rb
β β βββ params_route_sanitizer_spec.rb
β β βββ route_object_mother.rb
β β βββ route_spec.rb
βββ
$ tree -L 4 web-app
web-app/
βββ README.md
βββ jest.config.mjs
βββ next-env.d.ts
βββ next.config.js
βββ package.json
βββ pages // Entry points of the application
β βββ _app.tsx
β βββ index.tsx // Dashboard
β βββ route
β βββ new.tsx // New route form
βββ pnpm-lock.yaml
βββ public
βββ sentry.client.config.ts // Observability tool
βββ src
β βββ app
β β βββ globals.css
β β βββ layout.tsx
β βββ components
β β βββ dashboard
β β β βββ ClimingTime.tsx
β β β βββ Dashboard.tsx // Dashboard component
β β β βββ DashboardFactory.tsx // Factory that creates the dashboard
β β β βββ dashboard.module.css
β β β βββ useRouteRepository.ts // Hook that uses the route repository
β β βββ layout
β β β βββ Header.tsx
β β β βββ Layout.tsx
β β β βββ header.module.css
β β βββ newRouteForm
β β βββ NewRouteForm.tsx // New route form component
β β βββ newrouteform.module.css
β βββ domain
β β βββ Route.ts // Entity that contains their logic
β β βββ RouteRepository.ts // Port that defines the repository
β βββ infrastructure
β β βββ ApiRouteRepository.ts // API implementation of the route repository
β β βββ InMemoryRouteRepository.ts // Memory implementation of the route repository, used for testing
β βββ tests
β βββ dummy.test.ts
β βββ index.test.tsx
βββ tsconfig.json
βββ utils
βββ routes_responses.ts // Contains the responses of the API for testing purposes
π‘ Some inspiration:
- https://github.com/CodelyTV/typescript-ddd-example
- https://github.com/CodelyTV/typescript-ddd-skeleton
The app is monitored using sentry.io:
2023-05-25
- Doing the refinement of #4 I decided to know use activeRecord model on Rails and try to use the repository pattern. The goals is create layers between domain models and infra persistence.