{"id":15808737,"url":"https://github.com/thiagomartins367/mc-code-challenge-backend-developer","last_synced_at":"2026-04-18T10:35:05.544Z","repository":{"id":180259562,"uuid":"664854094","full_name":"thiagomartins367/MC-code-challenge-backend-developer","owner":"thiagomartins367","description":"Code challenge de desenvolvimento da \"Multiverse Travels Booker API\", uma API que gerencia o planejamento de viagens no universo de Rick and Morty. Wubbalubbadubdub!","archived":false,"fork":false,"pushed_at":"2023-07-10T22:55:07.000Z","size":52,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-10-06T03:05:52.163Z","etag":null,"topics":["crystal","docker","jennifer","kemal"],"latest_commit_sha":null,"homepage":"","language":"Crystal","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thiagomartins367.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-07-10T22:49:05.000Z","updated_at":"2023-07-12T11:47:13.000Z","dependencies_parsed_at":null,"dependency_job_id":"7806c942-42c0-493f-a1ff-1943357d907c","html_url":"https://github.com/thiagomartins367/MC-code-challenge-backend-developer","commit_stats":null,"previous_names":["thiagomartins367/mc-code-challenge-backend-developer"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thiagomartins367%2FMC-code-challenge-backend-developer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thiagomartins367%2FMC-code-challenge-backend-developer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thiagomartins367%2FMC-code-challenge-backend-developer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thiagomartins367%2FMC-code-challenge-backend-developer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thiagomartins367","download_url":"https://codeload.github.com/thiagomartins367/MC-code-challenge-backend-developer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246552892,"owners_count":20795836,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["crystal","docker","jennifer","kemal"],"created_at":"2024-10-05T03:06:13.626Z","updated_at":"2025-10-18T11:45:52.990Z","avatar_url":"https://github.com/thiagomartins367.png","language":"Crystal","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Multiverse Travels Booker API\n\nThis documentation specifies the code for the Multiverse Travels Booker API, intended to manage travel plans in the Rick and Morty universe.\n\nOn the home page path `/` you can see the documentation of the API features in\n[Swagger](https://swagger.io/).\n\n## Installation and Usage\nNOTE: It is necessary to have installed the [Crystal](https://crystal-lang.org) language\nand the [MySQL](https://dev.mysql.com/downloads/mysql) database management system.\n\n1. Install dependencies\n```\n# Run command\nshards install\n```\n\n2. Build application\n```\n# Run command\ncrystal build --static --release src/api.cr -o bin/api\n```\n\n3. Configuring `Jennifer ORM` database connection settings\n```\n# File path: ./config/database.yml\n\ndefault: \u0026default\n  user: # database access user\n  password: # user password\n  adapter: mysql\n  skip_dumping_schema_sql: true\n\n# ...\n\nproduction:\n  \u003c\u003c: *default\n  db: multiverse_travels_booker # database name\n  host: # connection host (Ex: localhost)\n  port: # Connection port (Ex: \"3306\") [Warning: Port needs to be in `String` format]\n\n# ...\n\n```\n\n4. Creating the database and tables\nNOTE: The database and table creation commands use the commands listed in the `Makefile` file.\n\n```\n# Run command to create the database:\nmake sam db:create\n\n# Then run command to create the database tables:\nmake sam db:migrate\n\n# At the end, check that the database and tables were created\n``` \n\n4. Start API\n```\n# Run command\nKEMAL_ENV=production APP_ENV=production ./bin/api\n\n# The `KEMAL ENV` and `APP_ENV` variables are required to use the production version of the API.\n```\n\n5. Check logs in terminal\n```\n# If everything went well then you will see the logs below:\n\n# ...\n# [production] Kemal is ready to lead at http://0.0.0.0:3000\n# ...\n```\n\n## Usage in Docker \n\nIf you have both [Docker](https://www.docker.com)\nand [Docker compose](https://docs.docker.com/compose/install) installed,\nyou can save a lot of effort.\n\nTo start the API in the Docker, just run 1 command:\n```\n# Run command\ndocker-compose up -d\n\n# Container log:\n# ...\n# [production] Kemal is ready to lead at http://0.0.0.0:3000\n# ...\n```\nOnce the containers are working the API can be used.\n\n## Development\n\nTo develop new features or refactor it is recommended to use Docker, as it provides an isolated and properly configured environment in the `docker-compose.dev.yml` file.\n\n1. Definindo variáveis de ambiente e configurações de conexão\n  - Create a `./db/.env.development.local` file using the `./db/.env.development.local.example` file.\n  - Set a password for the `root` database user in the `MYSQL_ROOT_PASSWORD` environment variable which will be used in the database container.\n  - Create a `./.env.development.local` file using the `./.env.development.local.example` file.\n  - Set a value for each variable listed in the file.\n  - Create and configure the `Jennifer ORM` connection file in `./config/database.yml`.\n```\n# File path: ./config/database.yml\n\ndefault: \u0026default\n  user: root\n  password: # user password (Same as defined in MYSQL_ROOT_PASSWORD variable)\n  adapter: mysql\n  skip_dumping_schema_sql: true\n\n# ...\n\ndevelopment:\n  \u003c\u003c: *default\n  db: dev_multiverse_travels_booker\n  host: dev_db_multiverse_travels_booker # Container Docker\n  port: \"3306\" # Connection port [Warning: Port needs to be in `String` format]\n\n# ...\n\n```\n\n2. Starting the development environment\n\n  - To create the development Docker environment run the command below:\n```\n# Run command\ndocker-compose -f docker-compose.dev.yml up -d\n```\nAfter this process, both the API and the database will be working.\nNOTE: An initial command `seed` is run every time containers are built to populate the database with data for development.\nNOTE: The use of the `make` scripts/commands listed in the `Makefile` file is recommended in the development environment to speed up the development process.\n\n\u003c!-- ## Contributing\n\n1. Fork it (\u003chttps://github.com/your-github-user/6c428e8aeb720fd6309b7196f34aab636f27a3c2/fork\u003e)\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create a new Pull Request --\u003e\n\n## Contributors\n\n- [THIAGO MARTINS](https://github.com/thiagomartins367) - creator and maintainer\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthiagomartins367%2Fmc-code-challenge-backend-developer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthiagomartins367%2Fmc-code-challenge-backend-developer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthiagomartins367%2Fmc-code-challenge-backend-developer/lists"}