This project is a Currency Converter application built with PHP using the Symfony framework and MySQL. The application allows users to convert an amount from one currency to various other currencies. It includes features such as IP-based access control, user authentication, and CRUD operations for managing users and IPs.
The assignment is designed to test PHP and MVC skills, focusing on backend functionalities and system architecture. The application also supports optional features like password reset and an admin dashboard for user
Clone the Repository
git clone https://github.com/SLoharkar/Currency-Converter-PHP-Symfony-Framework.git
cd Currency-Converter-PHP-Symfony-FrameworkInstall Dependencies
Ensure you have Composer installed and run:
composer installConfigure Environment Variables
Copy the .env.test file to set up your environment variables:
cp .env.test .envCopy the .env file and set up your database connection and application secret:
DATABASE_URL="mysql://db_user:[email protected]:3306/db_name"
APP_SECRET="your_random_app_secret_key"Update Composer Dependencies
After setting up the environment variables, you can update the Composer dependencies to ensure you have the latest versions:
composer updateImport the Database Schema and Initial Data
Import the .sql File
Use MySQL Workbench, phpMyAdmin, or XAMPP to run the xampp.sql file:
xampp.sql file into the new database.Run the Application
You can run the Symfony application using the built-in PHP server. Use the following command:
php -S localhost:3000 -t publicReplace localhost with your IP address if you want to access the application from another device on your network.
Access the Application
Open your web browser and navigate to http://localhost:3000 (or replace localhost with your IP address if applicable).
/login to access the login page./register to create a new user account./forgot_password to reset your password.Admin:
/admin/dashboard - Manage users operations like update and delete users.User:
/ - Main page of the application./user/currency-converter - Perform currency conversions.The application uses Monolog for logging activities and errors. Logs are stored in the var/log/ directory.
Monolog is configured in config/packages/monolog.yaml:
Log File Location: Logs are written to var/log/.
Log Levels: The application logs messages of various levels:
**debug**: Detailed debug information.**info**: General application information.**warning**: Exceptional occurrences that are not errors.**error**: Runtime errors that do not require immediate action.**critical**: Critical conditions, such as a component failing.level setting in monolog.yaml to debug, info, warning, error, or critical.Check out our trailer video to get a quick overview of the Currency Converter application: