{"id":28803245,"url":"https://github.com/johlav/fleet-management","last_synced_at":"2026-04-11T18:02:26.095Z","repository":{"id":291621229,"uuid":"971409225","full_name":"JohLav/fleet-management","owner":"JohLav","description":"Fleet management system that manages vehicles and parking locations within a fleet.","archived":false,"fork":false,"pushed_at":"2025-06-11T09:18:17.000Z","size":179,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-11T10:28:52.821Z","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-06-11T09:18:15.000Z","dependencies_parsed_at":"2025-05-05T18:00:46.987Z","dependency_job_id":"c52b51be-d7df-4413-b8eb-9433ba8e36ec","html_url":"https://github.com/JohLav/fleet-management","commit_stats":null,"previous_names":["johlav/fulll-backend","johlav/fleet-management"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/JohLav/fleet-management","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JohLav%2Ffleet-management","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JohLav%2Ffleet-management/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JohLav%2Ffleet-management/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JohLav%2Ffleet-management/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JohLav","download_url":"https://codeload.github.com/JohLav/fleet-management/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JohLav%2Ffleet-management/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260523576,"owners_count":23021966,"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-06-18T09:00:46.939Z","updated_at":"2026-04-11T18:02:26.014Z","avatar_url":"https://github.com/JohLav.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Fleet Management System\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](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\nCreate the database:\n```shell\nprisma migrate dev\n```\n\nGenerate the prisma client:\n```shell\nnpx prisma generate\n```\n\nTo reset the database (if any):\n```shell\nprisma migrate reset\n```\n\n### Command-Line Interface (CLI)\n\nInteract with the fleet management system using the following commands:\n\n- **Create a new fleet**: creates a fleet associated with a user. Returns a `\u003cfleetId\u003e`:\n\n```shell\n# Syntax\nnpm run fleet create \u003cuserId\u003e\n\n# Example\nnpm run fleet create 1234\n```\n\n- **Register a vehicle to a fleet**: adds a vehicle to an existing fleet:\n\n```shell\n# Syntax\nnpm run fleet register-vehicle \u003cfleetId\u003e \u003cvehiclePlateNumber\u003e\n\n# Example\nnpm run fleet register-vehicle 58394350-99b9-4764-8423-8fcda3223d3f AB-123-CD\n```\n\n- **Update a vehicle’s location**: updates the GPS position of a vehicle in a fleet:\n\n```shell\n# Syntax\nnpm run fleet update-location \u003cfleetId\u003e \u003cvehiclePlateNumber\u003e \u003clatitude\u003e \u003clongitude\u003e [altitude]\n\n# Example (without altitude)\nnpm run fleet update-location 58394350-99b9-4764-8423-8fcda3223d3f AB-123-CD 48.8566 2.3522\n\n# Example (with altitude)\nnpm run fleet update-location 58394350-99b9-4764-8423-8fcda3223d3f AB-123-CD 48.8566 2.3522 35\n```\n\n- **Localize a vehicle**: retrieves the last known location of a vehicle in a fleet:\n\n```shell\n# Syntax\nnpm run fleet localize-vehicle \u003cfleetId\u003e \u003cvehiclePlateNumber\u003e\n\n# Example\nnpm run fleet localize-vehicle 58394350-99b9-4764-8423-8fcda3223d3f AB-123-CD\n```\n\n#### 🆘 View Help Menu\n\nDisplays a list of all available fleet CLI commands with their usage and descriptions.\n\n```shell\n# Syntax\nnpm run fleet -- --help\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## Retrospective\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%2Ffleet-management","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjohlav%2Ffleet-management","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohlav%2Ffleet-management/lists"}