{"id":15105723,"url":"https://github.com/fecony/rates-app","last_synced_at":"2026-02-09T01:32:04.547Z","repository":{"id":251652628,"uuid":"838030853","full_name":"fecony/rates-app","owner":"fecony","description":"💱 Exchange rates app built with Laravel and Livewire","archived":false,"fork":false,"pushed_at":"2024-08-04T20:48:23.000Z","size":159,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-26T14:49:51.099Z","etag":null,"topics":["exchange-rates","laravel","livewire","tall-stack"],"latest_commit_sha":null,"homepage":"","language":"PHP","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/fecony.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}},"created_at":"2024-08-04T18:28:01.000Z","updated_at":"2024-08-04T20:48:25.000Z","dependencies_parsed_at":"2024-08-04T20:49:48.688Z","dependency_job_id":"f25e6509-774b-416e-b69a-ccd19815106e","html_url":"https://github.com/fecony/rates-app","commit_stats":null,"previous_names":["fecony/rates-app"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/fecony/rates-app","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fecony%2Frates-app","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fecony%2Frates-app/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fecony%2Frates-app/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fecony%2Frates-app/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fecony","download_url":"https://codeload.github.com/fecony/rates-app/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fecony%2Frates-app/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29252978,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-08T22:49:53.206Z","status":"ssl_error","status_checked_at":"2026-02-08T22:49:51.384Z","response_time":57,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["exchange-rates","laravel","livewire","tall-stack"],"created_at":"2024-09-25T20:42:24.711Z","updated_at":"2026-02-09T01:32:04.533Z","avatar_url":"https://github.com/fecony.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Rates\n\nApp to fetch, store and display rates from bank.lv\n\n\u003cp align=\"center\"\u003e\u003cimg src=\"https://github.com/user-attachments/assets/1f90e111-6901-4240-9044-00058d35b2ba\" width=\"800\" alt=\"Rates app\"\u003e\u003c/p\u003e\n\n## Prerequisites\n\nThings you will need:\n\n-   [Docker](https://docs.docker.com/get-docker/)\n\n### Getting Started\n\nClone the project\n\n```bash\ngit clone git@github.com:fecony/rates-app.git\n```\n\nGo to the project directory\n\n```bash\ncd rates-app\n```\n\nCopy .env.example file to .env on the root folder.\n\n```bash\ncp .env.example .env\n```\n\n### Running app ~ Docker 🐳\n\nBy default, application is configured to run in Docker container. You don't have to change any environment configuration\nsetting.\n\n\u003e [!IMPORTANT]\n\u003e This command will run Docker container to install application dependencies\n\n```bash\ndocker run --rm \\\n    -u \"$(id -u):$(id -g)\" \\\n    -v \"$(pwd):/var/www/html\" \\\n    -w /var/www/html \\\n    laravelsail/php83-composer:latest \\\n    composer install --ignore-platform-reqs\n```\n\n\u003e [!TIP]\n\u003e You can refer to [Laravel Sail documentation](https://laravel.com/docs/11.x/sail#installing-composer-dependencies-for-existing-projects) for other useful commands!\n\nTo run app in Docker container make sure that Docker is running.\n\n```bash\n./vendor/bin/sail up -d\n```\n\nRun `./vendor/bin/sail artisan key:generate` to generate app key.\n\nAfter you application is running in Docker container run `./vendor/bin/sail artisan migrate` to run migration files.\n\nBuild frontend assets.\n\n```bash\n./vendor/bin/sail npm run build\n```\n\nOnce the application's containers have been started, you may access the project in your web browser at: http://localhost.\n\n## Fetching rates\n\n### Command\n\nIn order to fetch exchange rates manually you can use artisan command `fetch:exchange-rates`.\nIt supports fetching data for a specific date or the last 7 days.\n\n\u003e Fetch Rates for a Specific Date\n\u003e Replace YYYY-MM-DD with the desired date in YYYY-MM-DD or yyyymmdd format.\n\n```bash\n./vendor/bin/sail artisan fetch:rates --date=YYYY-MM-DD\n```\n\n\u003e Fetch Rates for the Last 7 Days\n\u003e This will fetch the exchange rates for the last 7 days from the current date.\n\n```bash\n./vendor/bin/sail artisan fetch:rates --last-7-days\n```\n\n### Job\n\nThe job is responsible for running the fetch command on a daily basis. It's scheduled to run automatically at 17:15.\nUse [Laravel Horizon](https://laravel.com/docs/11.x/horizon) to monitor the job queue and ensure that the job is running as expected.\n\n## Plan\n\n\u003cdetails\u003e\n\n\u003csummary\u003eWhat technologies (other than Laravel) will you use and why?\u003c/summary\u003e\n\n-   [Redis](https://redis.io/) - Used for caching and queue management to ensure fast access to frequently requested data and to handle background jobs efficiently.\n-   [MySQL](https://www.mysql.com/) - Database to store exchage rates, chosen for reliability, performance, and compatibility with Laravel.\n-   [Docker](https://www.docker.com/) - Used for containerizing the application to ensure consistency across different environments, simplifying deployment and scaling.\n-   [Livewire](https://livewire.laravel.com/) - A Laravel library to create interactive web applications without leaving PHP or writing much JavaScript.\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003eWhat additional modules or libraries will you use to achieve the necessary results?\u003c/summary\u003e\n\n-   [Laravel Sail](https://laravel.com/docs/11.x/sail) - Lightweight command-line interface for interacting with Laravel's default Docker development environment.\n-   [Laravel Horizon](https://laravel.com/docs/11.x/horizon) - Dashboard to monitor and manage background jobs.\n-   [Laravel Pint](https://laravel.com/docs/11.x/pint) - PHP code style fixer.\n-   [XML Wrangler](https://github.com/saloonphp/xml-wrangler) - A PHP library designed to simplify the parsing and manipulation of XML data.\n-   [TALL Stack](https://tallstack.dev/)\n    -   [Tailwind CSS](https://tailwindcss.com/) - A utility-first CSS framework to build UI quickly and ensure a consistent look for the user interface.\n    -   [Alpine.js](https://alpinejs.dev/) - Is a lightweight JavaScript library used to add client-side interactivity.\n    -   [Laravel](https://laravel.com)\n    -   [Livewire](https://livewire.laravel.com/)\n-   [Carbon](https://carbon.nesbot.com/) - A PHP library for date and time manipulation.\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003eHow would you deal with non-functional requirements - security, reliability, availability, scalability, performance, and maintainability?\u003c/summary\u003e\n\n##### Security\n\nEnsure user inputs are validated and sanitized to prevent SQL injection, XSS attacks, and other vulnerabilities. Use Laravel's built-in validation mechanisms and secure query-building practices. Sensitive configuration details and credentials are managed securely using environment variables and Laravel's built-in encryption services. Keep Laravel and its dependencies updated to patch known security vulnerabilities.\n\n##### Reliability\n\nImplement error handling with try-catch blocks and proper logging. Use Laravel's logging system to capture and analyze errors. By using Laravel’s job and queue system with Horizon for monitoring, we ensure that tasks like fetching and storing exchange rates are retried if they fail, and issues are logged and addressed promptly. Do a regular backups of data to protect against data loss.\n\n##### Availability\n\nDeploy the application on multiple servers or use cloud-based load balancers to distribute traffic and ensure continuous availability. Implement database replication and backup strategies.\n\n##### Scalability\n\nIndex columns in the database to improve query performance, especially for frequently accessed data. Use load balancers to distribute traffic effectively. Implement caching mechanisms for frequently accessed data to reduce database load and improve response times.\n\n##### Performance\n\nWrite efficient SQL queries and use database indexing to speed up data retrieval. Optimize data insertion processes to handle bulk operations effectively. Use caching to minimize repetitive database queries and improve response times. Utilize a CDN to serve static assets (CSS, JavaScript, images) and reduce latency by distributing content geographically.\n\n##### Maintainability\n\nFollow best practices for coding standards, such as PSR standards and using Laravel’s recommended coding conventions. Write clean, well-documented, and modular code. Implement unit tests, integration tests, and end-to-end tests to ensure the application works as expected and to catch regressions early. Maintain documentation for both the codebase and the deployment process.\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003eWhat technical risks can you see? How would you mitigate them?\u003c/summary\u003e\n\n##### External\n\nOne significant technical risk involves the availability of exchange rate data. Since the data is updated daily and relies on an external API, there is a risk of data unavailability or delays. To mitigate this, we implement error handling and retry mechanisms in our background job, ensuring that it can handle temporary unavailability and retry fetching data if needed. Additionally, we use a fallback mechanism to ensure that data is fetched as soon as it becomes available.\n\n##### Queries\n\nAnother risk is performance degradation due to inefficient querying or high traffic. We address this by optimizing our database queries, using indexing, and implementing caching to reduce load on the database and improve response times. Regular performance monitoring and profiling would help us identify and resolve bottlenecks early.\n\n##### Scalability\n\nAs user demand grows, scalability becomes a key concern. To tackle this, we design the application to scale both horizontally and vertically. This approach utilizes load balancers and adaptable cloud infrastructure, ensuring that increased traffic and data volume are managed efficiently.\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003eHow would you split the task? What would be your priorities?\u003c/summary\u003e\n\nI would start by focusing on the core functionality of fetching and storing exchange rates. This involves setting up the command and job to handle data retrieval and database insertion. Once the core functionality is stable, I would move on to implementing data display features, ensuring that users can view and filter the rates as required.\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003eHow long would it take to implement each part of the solution?\u003c/summary\u003e\n\n### Project setup\n\n\u003e Estimated Time: 2 hours\n\nConfiguring the Laravel project, setting up migrations, and installing necessary packages.\n\n### Data gathering\n\n\u003e Estimated time: ~6 hours\n\n#### Data Retrieval and Storage\n\n\u003e Estimated time: 4 hours\n\nDeveloping the services, command and job to fetch exchange rates, schedule job, handle errors, and store the data.\n\n#### Caching \u0026 Indexing\n\n\u003e Estimated time: ~1 hour\n\nConfiguring caching and creating indexes to optimize database performance.\n\n#### Error Handling and Manual Testing\n\n\u003e Estimated time: 2 hour\n\nEnsuring data fetching service, job and command handle edge cases.\n\n### Data display\n\n\u003e Estimated time: 10 hours\n\n#### Developing Views\n\n\u003e Estimated time: 6 hours\n\nCreating responsive views and implementing filters\n\n#### Integrating with Backend\n\n\u003e Estimated time: 2 hours\n\nConnecting the front-end to the backend data via Livewire and Alpinejs data fetching.\n\n#### Manual Testing and Optimization\n\n\u003e Estimated time: 2 hours\n\nEnsuring responsiveness, functionality and optimizing performance.\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003eHow would you work on this task within a team?\u003c/summary\u003e\n\nIf working alone as a full-stack developer, I’d first work on the data gathering, storage, and caching. Once the backend is functional, I’d move on to the frontend to build and integrate the UI. This approach ensures that each part of the system is thoroughly developed and tested before moving on to the next.\n\nIn a team setting where I'm focused on the backend, I’d handle all server-side tasks. I'd collaborate with a frontend developer to provide the necessary APIs and support for integrating the data into the UI. Regular check-ins with the frontend developer would ensure that our work aligns seamlessly.\n\nIf I were the frontend developer, I would focus on designing and implementing the UI while the backend developer handles data fetching and storage. I’d work closely with them to ensure the API meets frontend requirements and that integration is smooth.\n\nIn both scenarios, we would also coordinate with a designer or product manager to align the development with user experience and business goals, ensuring that the final product is both functional and meets design standards.\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003eHow would you handle the testing?\u003c/summary\u003e\n\nFor testing, I would start with unit tests for individual components. In the backend, I’d write tests for data fetching, ensuring the services/command/job correctly handle different scenarios, including successful data retrieval and error handling. I’d also test database operations to confirm that data is correctly stored and retrieved.\nBy mocking I could avoid dependencies on external services or the database, allowing reliable and efficient testing of individual units.\n\nIn the frontend, I’d implement tests to verify that the UI components display data as expected and that user interactions, such as filtering and searching, function properly.\nFor end-to-end testing, I would simulate user interactions with the UI to ensure that the entire application functions as expected from the user's perspective. This includes testing data retrieval, filtering, and display functionalities.\n\nAdditionally, I’d perform manual testing to validate the end-to-end functionality, including edge cases and potential user errors. This comprehensive testing approach would help identify and address any issues before deployment.\n\nFinally, I would implement automated tests in a CI pipeline to catch issues early and maintain code quality throughout development. Regularly running these tests helps identify problems quickly and ensures that any changes or new features do not break existing functionality.\n\n\u003c/details\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffecony%2Frates-app","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffecony%2Frates-app","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffecony%2Frates-app/lists"}