Run the following command to start the project:
docker compose up
NOTE: This command could potentially take a while to finish on initial run as it'll have to install the dependencies, create a database and build the project.
After the project is running, you should compile the assets:
npm ci
npm run build
Now you can optionally run the following command to load the fixtures:
# When on host machine:
docker compose exec php sh -c "php bin/console doctrine:fixtures:load"
# When inside the container:
php bin/console doctrine:fixtures:load
BE AWARE: This will load the fixtures in the database, which means that the exchange rates will be set to the values defined in the CurrencyExchangeRateFixtures
class as opposed to the real-time exchange rates which have been loaded automatically after the migrations ran. This however can still be updated later (see Update Exchange Rates).
Once the project is running, you can access the following URLs:
- App: https://localhost
- App admin: https://localhost/admin
- Adminer: http://localhost:8081
- Mailpit: http://localhost:8025
Be aware that the application is protected by IP restrictions, if you want to access it from outside your current network, you'll have to add your IP address to the list of allowed IP addresses.
If you chose to load the fixtures, you can login with the following credentials:
- Admin: admin@example.com / admin
- User: test@example.com / password
To get a shell inside the container (eg. to run bin/console
commands), run the following command:
docker compose exec php sh
Before you run any tests, you need to make sure to setup a test database.
To do so, run the following command in your container:
bin/console --env=test doctrine:database:create
bin/console --env=test doctrine:migrations:migrate
bin/console --env=test doctrine:fixtures:load
To run the tests, run the following command:
./bin/phpunit.sh
The application can be managed from the admin area, found at https://yourdomain.com/admin. Besides that, you can also fully manage the application using the command line. This is especially usefull when initially setting up your application as you'll have to create an admin user via the command line before you even have access to the admin panel.
To add a new user, run the following command:
php bin/console app:access:user:add <email> <password> [--admin]
<email>
: The email of the user.<password>
: The password of the user.--admin
: (Optional) If provided, the user will be given admin privileges.
Example:
php bin/console app:access:user:add user@example.com password
php bin/console app:access:user:add admin@example.com admin --admin
To list all users, run the following command:
php bin/console app:access:user:list
This will display a table with the ID, email, and roles of each user.
To remove a user, run the following command:
php bin/console app:access:user:remove <email>
<email>
: The email of the user to remove.
To add a new IP address to the allowed list, run the following command:
php bin/console app:access:ip:add <ip>
<ip>
: The IP address to add.
Example:
php bin/console app:access:ip:add 192.168.1.100
# or an IP subnet
php bin/console app:access:ip:add 192.168.1.0/24
To list all allowed IP addresses, run the following command:
php bin/console app:access:ip:list
This will display a table with the ID and IP address of each allowed IP.
To remove an IP address from the allowed list, run the following command:
php bin/console app:access:ip:remove <ip>
<ip>
: The IP address to remove.
To list all currently supported currencies, run the following command:
php bin/console app:currencies:list
This will display a list of all supported currency codes.
To update the exchange rates for the given currencies, run the following command:
php bin/console app:currencies:update [<currency_codes>] [--all] [--async]
<currency_codes>
: (Optional) A list of currency codes to update. Separate multiple codes with a space.--all
: (Optional) If provided, updates all existing currencies.--async
: (Optional) If provided, updates currencies asynchronously.
Example:
php bin/console app:currencies:update USD EUR
php bin/console app:currencies:update --all
php bin/console app:currencies:update USD EUR --async