{"id":27946565,"url":"https://github.com/johlav/fulll-backend","last_synced_at":"2025-05-07T13:56:14.704Z","repository":{"id":291621229,"uuid":"971409225","full_name":"JohLav/fulll-backend","owner":"JohLav","description":"Fleet management system that manages vehicles and parking locations within a fleet.","archived":false,"fork":false,"pushed_at":"2025-05-05T17:12:33.000Z","size":121,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-07T13:56:08.338Z","etag":null,"topics":["chai","cucumber-js","docker-compose","eslint","gherkin","node","prettier","prisma","typescript","vitest","yargs"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JohLav.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null}},"created_at":"2025-04-23T13:31:47.000Z","updated_at":"2025-05-06T05:54:04.000Z","dependencies_parsed_at":"2025-05-05T18:00:46.987Z","dependency_job_id":"c52b51be-d7df-4413-b8eb-9433ba8e36ec","html_url":"https://github.com/JohLav/fulll-backend","commit_stats":null,"previous_names":["johlav/fulll-backend"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JohLav%2Ffulll-backend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JohLav%2Ffulll-backend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JohLav%2Ffulll-backend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JohLav%2Ffulll-backend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JohLav","download_url":"https://codeload.github.com/JohLav/fulll-backend/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252892520,"owners_count":21820646,"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":["chai","cucumber-js","docker-compose","eslint","gherkin","node","prettier","prisma","typescript","vitest","yargs"],"created_at":"2025-05-07T13:56:13.277Z","updated_at":"2025-05-07T13:56:14.695Z","avatar_url":"https://github.com/JohLav.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Fleet Management System - Fulll Technical Test\n\n## Overview\n\nThis technical test involves building a vehicle fleet management system. The goal was to create an application that manages vehicles and their parking locations within a fleet. Key operations include registering vehicles, parking them at specific locations, and ensuring vehicles cannot be registered or localized multiple times in the same fleet or location.\n\nPlease refer to the INSTRUCTIONS.md file for detailed test instructions.\n\n## Setup\n\n### Pre-requisites\n\n- Node v20 and later: https://nodejs.org/en\n\n#### Installations\n\nInstall the project dependencies:\n```shell\nnpm i\n```\n\nTo build the project:\n```shell\nnpm run build\n```\n\n#### Running the tests\n\nTo run the cucumber tests:\n```shell\nnpm run cucumber\n```\n\nTo run the vitest tests:\n```shell\nnpm run test\n```\n\n### MySQL with Docker\n\nTo start MySQL:\n```shell\ndocker compose up -d\n```\n\nTo stop MySQL:\n```shell\ndocker compose stop\n```\n\n### PhpMyAdmin with Docker\n\nYou can access PhpMyAdmin at http://localhost:8090 with the following credentials:\n```shell\n# Username: fulll\n# Password: fulll-backend\n```\n\n### Prisma\n\nTo create the database:\n```shell\nprisma migrate dev\n```\n\nThen generate the prisma client:\n```shell\nnpx prisma generate\n```\n\nIf you need to reset the database:\n```shell\nprisma migrate reset\n```\n\n### Command-Line Interface (CLI)\n\nYou can interact with the fleet management system using the following commands to modify the database.\n\n- **Create a fleet**: Returns a `\u003cfleetId\u003e` along with a random `\u003cuserId\u003e`:\n```shell\nnpm run fleet create 1234\n```\n\n- **Register a vehicle**: Adds a vehicle to the specified `\u003cfleetId\u003e` with a provided `\u003cvehiclePlateNumber\u003e` and `\u003cvehicleType\u003e` (e.g., CAR, TRUCK, MOTORCYCLE):\n```shell\nnpm run fleet register-vehicle ea10ff46-7729-4179-aabb-f3f89bbd2a3b AB-123-CD CAR\n```\n- **Localize a vehicle**: Updates the location of a vehicle with the specified `\u003cfleetId\u003e`, `\u003cvehiclePlateNumber\u003e`, `\u003clatitude\u003e`, `\u003clongitude\u003e`, and optional `[altitude]`:\n```shell\nnpm run fleet localize-vehicle ea10ff46-7729-4179-aabb-f3f89bbd2a3b AB-123-CD 48.8566 2.3522\n```\n\n## Code Quality\n\nFor code quality, I used ESLint and Prettier. ESLint helps catch bugs and enforce coding standards, while Prettier ensures consistent code formatting automatically.\n- ESLint: https://eslint.org/\n- Prettier: https://prettier.io/\n\n## CI/CD Process\n\nTo set up a CI/CD process, I would use GitHub Actions to automate the workflow. Key steps include:\n- Trigger the pipeline on each push or pull request.\n- Install dependencies (npm ci).\n- Run code quality checks (npm run lint).\n- Execute tests (npm test and npm run cucumber).\n- Optionally, build the project and deploy if tests pass.\n\n## Restrospective\n- Gained valuable insights into hexagonal architecture, DDD, and CQRS principles.\n- Enjoyed working without a framework, as it provided a deeper understanding of configurations.\n- Experienced some back-and-forth with unit testing setups, initially using Jest, then Mocha, and finally settling on Vitest.\n- Faced challenges with importing the Prisma client, requiring some trial and error.\n- Noticed the immediate benefits of CQRS \u0026 DDD, particularly when transitioning from in-memory to database persistence.\n- Both challenging and enjoyable at the same time!\n\n## Next Steps\n1. Clean up and organize imports:\n   - Replace messy relative imports with alias-based or consistent paths.\n   - Ensure all imports follow the same convention across the project.\n2. Fix CLI command parsing warning\n    - Investigate and resolve the warning that appears during CLI command parsing.\n3. Add more tests to cover edge cases\n4. Set up Continuous Integration (CI) pipeline using GitHub Actions to automate testing.\n5. Improve error handling mechanisms to provide clearer feedback in case of failures.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohlav%2Ffulll-backend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjohlav%2Ffulll-backend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohlav%2Ffulll-backend/lists"}