This project runs Hanami Framework over Ruby 3.3.7.
- Ruby 3.3.X
- Bundler (Dependant on Ruby)
- Gem (Dependant on Ruby)
- Postgres 16.4 Database
- Docker and Docker Compose (optional)
You can install the dependencies manually in your system, but for simplicity and ease of use, it is recommended to use the docker-compose script included in this repo. Both appraches will be in this README anyway.
This is the recommended method as the Docker image and scripts included in this repo will always be updated and ready to automatically launch all the depencies and processes the server needs.
Whether you use Windows or Linux, you should always install Docker Desktop as it automatically installs Docker, Docker compose and runs the post-installation scripts included to make it work as intended. Installing Docker components is not recommended, thus this document will not follow that approach.
Follow the steps in the DOCKER Windows Setup Documentation to get Docker Desktop installed in your system.
- Activate Hyper-V
- Download the Docker Desktop installer .exe for x64 or ARM systems depending on your machine.
- Open the .exe and follow the instructions.
Follow the steps in the DOCKER Linux Setup Documentation to get Docker Desktop installed in your system. The process may vary depending of your distro, but it should follow this rough steps:
- Check if KVM is supported or active in your system and activate it.
- Download and install Docker Desktop from your distro's package repository (apt, pamac, yum, etc.)
- Launch Docker Desktop and start 'Hello World' machine to check it's working properly.
Open a Terminal (CMD in Windows) in the
We strongly advise not to follow this method as for future updates, it may be needed to update and install new dependencies manually, opposed to the Docker one. Thus, we will go over these steps quickly.
- Ruby 3.3.x Follow this link and choose your version depending on your OS (Windows will use RubyInstaller and Linux RBenv)
- Postgres 16 (Follow this link for Windows and this one for Linux
Follow this link for instructions on how to create Postgres Databases. Two databases must be created, backend_development and backend_test, one for each development environment.
- Clone this repository in your machine. (In the future, every version merged in the development branch will generates artifacts that can be downloaded directly from github. Additionally, master branch's merges will generate new stable versions with the same purpose.)
These files must include a line specificating the database used for each environment.
EX: DATABASE_URL=postgres://{user}:{password}@db:5432/{database}
Change user, password and database variables with your database data.
- Go to the cloned folder in your system.
- Open a terminal (CMD in Windows)
- Run the following commands:
3.1. If you followed the recommended Docker method:
docker compose up. This will launch all the dependencies, migrations and the server itself. 3.2. If you installed the dependencies manually:bundle install(this will install the server dependencies (gems)hanami db migrate(this will create the database tables and populate them)hanami server
After the first launch you can double click the container that is now shown in Docker Desktop and skip the terminal command whatsoever.
Once launched, the server will run on 0.0.0.0:2300 address and all the REQUESTS must be directed there.
Postman API documentation.
- API Sign Up Endpoint: you get the token
- API Login Endpoint: you login with your generated token
- Every other Endpoint: include the generated token within your request as an 'Authentication' header, otherwise they will return a 403 error.
To contribute follow the contributing guidelines.
The software is licensed under the terms of the MIT license.