Commit Graph

27 Commits

Author SHA1 Message Date
Ümit Tunç c20b900e33 Add .htaccess file for HTTPS redirection
- Introduced a new .htaccess file to enforce HTTPS by redirecting all HTTP requests to their HTTPS counterparts.
- This change enhances security by ensuring that all traffic to the application is encrypted.
2025-01-20 22:10:54 +03:00
Ümit Tunç 5c96b6b72e Update Docker configuration and Dockerfile for Laravel application
- Changed the Docker image for the app service to 'truncgil-finance-app' and updated the container name accordingly.
- Modified the web service to use 'truncgil-finance-web' and changed the port mapping to 8081.
- Upgraded the database image to MySQL 8.0 and updated the container name to 'truncgil-finance-db', adding a restart policy.
- Added environment variables for timezone and application settings in the app service.
- Updated the Dockerfile to use PHP 8.2, added necessary dependencies, and configured cron jobs for Laravel tasks.
- Enhanced file permission settings for the application directory to improve security and functionality.

These changes improve the overall configuration and performance of the Laravel application within the Docker environment.
2025-01-20 22:10:47 +03:00
Ümit Tunç 026ee3f85d Merge branch 'docker-version' of https://github.com/truncgil/truncgil_finance into docker-version 2025-01-20 16:26:44 +03:00
Ümit Tunç dace80dd79 Update currency and gold rates API endpoints with new data
- Updated response content for currency and gold rates to reflect the latest values as of January 20, 2025.
- Revised example values in URL parameters for `currencyName` and `goldName` to provide more realistic usage scenarios.
- Enhanced overall clarity and consistency in API responses, improving usability for developers interacting with financial data.

These changes ensure the API provides accurate and up-to-date information, facilitating better management of financial data.
2025-01-20 16:43:41 +03:00
Ümit Tunç f23743adab Enhance Dockerfile with file permission settings
- Added commands to set ownership and permissions for the /var/www directory and its subdirectories, ensuring proper access for the web server.
- This change improves security and functionality by configuring the environment for the Laravel application.
2025-01-20 16:25:22 +03:00
Ümit Tunç 944758a215 Add Docker configuration and Dockerfile for Laravel application 2025-01-18 18:58:24 +03:00
Ümit Tunç e305b8a77a Update API endpoint titles for currency and gold rates
- Revised endpoint titles to enhance clarity and consistency, including updates to titles for retrieving all merged currency rates, current currency rates, and gold rates.
- Adjusted example values in URL parameters for better guidance on usage, ensuring they reflect realistic scenarios.
- These changes improve the overall usability and organization of the API, facilitating better management of financial data.
2025-01-17 23:38:06 +03:00
Ümit Tunç ed0ff822ed Refactor CurrencyController to improve method documentation and simplify rate retrieval
- Updated PHPDoc comments for methods to enhance clarity, specifically for `getAllRates`, `getCurrentRates`, `getGoldRates`, `getCurrencyRateByName`, and `getGoldRateByName`.
- Removed commented-out job dispatching code to streamline the `getAllRates` method.
- Adjusted method descriptions to be more concise and focused on their functionality.

These changes enhance the maintainability and readability of the CurrencyController, facilitating better management of financial data.
2025-01-17 23:37:54 +03:00
Ümit Tunç 7bc63d0979 Update API endpoints for currency and gold rates
- Enhanced endpoint titles and descriptions for clarity, including detailed titles for retrieving merged currency rates, current currency rates, and gold rates.
- Added new endpoints for fetching current gold rates and specific gold rates by name, improving access to gold data.
- Updated response error messages to be more user-friendly and consistent.
- Improved example values in URL parameters for better guidance on usage.

These changes enhance the API's usability and organization, facilitating better management of financial data.
2025-01-17 23:33:16 +03:00
Ümit Tunç 2dee2f56b9 Refactor API routes for currency and gold rates
- Commented out the '/run-all-fetchs' endpoint to prevent its usage while maintaining the '/today.json' endpoint for fetching all rates.
- Rearranged the '/gold-rates' endpoint to ensure it is defined after the '/currency-rates' endpoints for better organization.
- Ensured all existing endpoints for currency and gold rates remain functional, enhancing the API's structure and maintainability.

These changes improve the clarity and organization of the API routes, facilitating better management of financial data.
2025-01-17 23:33:02 +03:00
Ümit Tunç 3217d8693e Enhance CurrencyController with detailed method documentation and new functionalities
- Added comprehensive PHPDoc comments to all methods in the CurrencyController for better code clarity and maintainability.
- Introduced new methods: `getAllRates`, `getCurrentRates`, `getGoldRates`, `getCurrencyRateByName`, and `getGoldRateByName` to improve data retrieval from JSON files.
- Ensured all methods return appropriate JSON responses, enhancing the API's usability.

These changes improve the overall documentation and functionality of the CurrencyController, facilitating better management of financial data.
2025-01-17 23:32:56 +03:00
Ümit Tunç 2aac301b29 Update API routes for currency and gold rates
- Replaced the '/today.json' endpoint with '/run-all-fetchs' to trigger fetching jobs for currency and gold rates.
- Updated the '/today.json' endpoint to now call 'getAllRates' for improved data retrieval.
- Added new endpoints for '/gold-rates' and '/gold-rates/{goldName}' to enhance access to gold rate data.
- Maintained existing '/currency-rates' and '/currency-rates/{currencyName}' endpoints for current currency rates.

These changes improve the API's functionality and organization, facilitating better management of financial data.
2025-01-17 23:28:37 +03:00
Ümit Tunç a26622c550 Refactor CurrencyController to enhance rate fetching and introduce new methods
- Replaced the `getCurrentRates` method with `runAllFetchs` to dispatch fetching jobs for currency and gold rates synchronously.
- Added `getAllRates`, `getGoldRates`, and `getGoldRateByName` methods to improve data retrieval from respective JSON files.
- Updated error messages for clarity and consistency.
- Streamlined JSON file handling by using variables for file paths, enhancing maintainability.

These changes improve the CurrencyController's functionality and organization, facilitating better management of financial data.
2025-01-17 23:28:29 +03:00
Ümit Tunç 7f09c56967 Enhance FetchGoldRates job to include update date and improve gold name formatting
- Added an 'Update_Date' field to store the current timestamp when fetching gold rates.
- Refactored gold name formatting to ensure consistency by converting names to uppercase and replacing specific substrings with standardized abbreviations.
- Improved maintainability by using a full name variable for gold types before abbreviation.

These changes enhance the data structure and clarity of the gold rates fetched by the application.
2025-01-17 23:28:17 +03:00
Ümit Tunç 6b5270f341 Add NumberFormatter helper class for number formatting
- Introduced a new helper class `NumberFormatter` with a method `commaToDot` to convert numbers formatted with commas to a dot notation.
- The method also trims whitespace and removes percentage signs for cleaner data handling.

This commit enhances the application's ability to process numerical data consistently, supporting future financial data operations.
2025-01-17 23:06:55 +03:00
Ümit Tunç 25327ac0cc Add RunAllFetchs command to execute currency and gold rate fetching jobs sequentially
- Introduced a new console command `RunAllFetchs` to streamline the execution of `FetchCurrencyRates`, `FetchGoldRates`, and `MergeCurrencyAndGoldRates` jobs.
- Implemented synchronous dispatching of jobs with timing results displayed in a table format for performance monitoring.
- This command enhances the application's ability to fetch and merge financial data efficiently in a single execution step.
2025-01-17 23:01:03 +03:00
Ümit Tunç 3d269c0261 Update scheduling in Console Kernel to run FetchCurrencyRates, FetchGoldRates, and MergeCurrencyAndGoldRates jobs every minute
- Changed the scheduling frequency of the FetchCurrencyRates job from hourly to every minute.
- Added FetchGoldRates and MergeCurrencyAndGoldRates jobs to the schedule, ensuring they also run every minute.
- Introduced a new method `runScheduledCommands` to encapsulate the scheduling logic for better organization and maintainability.

This commit enhances the application's ability to fetch and merge financial data in a timely manner.
2025-01-17 23:00:53 +03:00
Ümit Tunç aa03ed3706 Integrate FetchGoldRates and MergeCurrencyAndGoldRates jobs in CurrencyController
- Added the `FetchGoldRates` job to retrieve gold rates and the `MergeCurrencyAndGoldRates` job to combine currency and gold rates.
- Updated the `getCurrentRates` method to read from a new JSON file `merged/rates.json` instead of the previous `currency/today.json`.
- Commented out the synchronous dispatch of the fetching jobs for future implementation.

This commit enhances the CurrencyController's functionality by preparing it for integrated financial data management.
2025-01-17 22:59:11 +03:00
Ümit Tunç 11106995d4 Add MergeCurrencyAndGoldRates job to combine currency and gold rates
- Introduced a new job class `MergeCurrencyAndGoldRates` to handle the merging of currency and gold rate data.
- Implemented a method to retrieve data from JSON files stored in the application.
- Merged the fetched currency and gold data into a single array.
- Stored the combined data in a new JSON file for easy access and further processing.

This commit enhances the application's ability to manage and utilize financial data by integrating currency and gold rates into a unified format.
2025-01-17 22:58:51 +03:00
Ümit Tunç 8730465a42 Add FetchGoldRates job to retrieve and store gold rates
- Introduced a new job class `FetchGoldRates` to handle the fetching of gold rates from an external source.
- Implemented data extraction using DOM parsing to retrieve relevant gold rate information.
- Utilized `NumberFormatter` for consistent number formatting of the fetched values.
- Stored the processed gold rates in a JSON file for easy access and further processing.
- Enhanced the maintainability of the code by organizing the fetching logic and data handling.

This commit establishes a foundation for integrating gold rate data into the application.
2025-01-17 22:58:44 +03:00
Ümit Tunç 86f887a18b Refactor FetchCurrencyRates job to improve data fetching and processing
- Introduced a new helper method `fetchData` to streamline HTTP requests for currency data.
- Replaced direct HTTP calls with the new `fetchData` method for better code organization.
- Utilized `NumberFormatter` for consistent number formatting, replacing the previous `virgulToNokta` method.
- Enhanced data handling for currency rates, ensuring proper type casting and rounding for values.
- Removed commented-out code related to gold rates to clean up the implementation.

These changes enhance the maintainability and readability of the currency fetching logic.
2025-01-17 22:58:34 +03:00
Ümit Tunç 48da9891dc Refactor Truncgil Finance documentation and endpoints
- Updated the introduction in `intro.md` to provide a clearer overview of the application and its features.
- Added new API endpoints in `00.yaml` for retrieving today's currency rates and specific currency rates by name, enhancing the API's functionality.
- Removed outdated documentation files including `collection.json`, `index.html`, `openapi.yaml`, and associated CSS and JS files to streamline the project structure.
- Updated the `.filehashes` to reflect changes in the documentation files.

This commit improves the clarity and usability of the Truncgil Finance API documentation and expands its capabilities.
2025-01-17 21:46:08 +03:00
Ümit Tunç de00f293c9 Add method to retrieve currency rate by name in CurrencyController
Implemented a new method `getCurrencyRateByName` in the CurrencyController to fetch the currency rate based on the provided currency name from a JSON file. The method handles cases where the file does not exist or the currency is not found, returning appropriate JSON responses for each scenario.
2025-01-17 21:45:55 +03:00
Ümit Tunç c630e1ada6 Update Scribe configuration for Truncgil Finance: Set title and description, change documentation type to external_laravel, and update theme to scalar. Enhance user experience with additional features and a clear interface for accessing financial data. 2025-01-17 21:45:42 +03:00
Ümit Tunç 638513ab2c Add initial Scribe index view for Truncgil Finance 2025-01-17 21:45:33 +03:00
Ümit Tunç 9cb59d033a Update API routes to include new endpoints for today's currency rates and specific currency rates by name 2025-01-17 21:45:27 +03:00
Ümit Tunç f6ef9fafdc first commit 2025-01-17 21:38:08 +03:00