IonBazan / transaction-admin

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Transaction Admin

PHP 8.0+ Tests codecov

This application provides a simple dashboard to manage companies and transactions

Installation

Prerequisites:

  • PHP 8.0+ with mongodb extension
  • Composer
  • MongoDB server
composer install # Install dependencies
bin/console doctrine:mongodb:fixtures:load -n

Using Docker-Compose

This app is shipped with easy to run Docker-Compose environment built on top of PHP 8 with Symfony CLI and MongoDB container.

cd docker
cp .env.dist .env # Customize expposed ports
docker-compose up # Run the app

Locally using Symfony CLI

Another easy way to run the app is to install Symfony CLI and run symfony serve. Please note that it requires you to install PHP and MongoDB locally.

Loading sample data

To import some dummy data for testing, you may want to run:

bin/console doctrine:mongodb:fixtures:load -n

Accessing the application

Application should be available at http://localhost:8000. To login, use test credentials:

  • username: admin
  • password: admin123

These credentials are currently stored using Symfony InMemoryUserProvider (see config/packages/security.yaml) just for sake of simplicity. This can be moved to a MongoDB UserProvider or any other implementation for production use.

Running tests

Application test suite consists mostly of functional tests because most of the logic is a simple CRUD. This can be refactored to use less framework-specific features and therefore allow to be unit-tested.

This repository uses Github Actions CI to run the test automatically. If you want to run them locally, simply execute:

bin/phpunit

Please note that it will purge your MongoDB database by default. You may avoid that by customizing database name in .env.test.local.

About

License:MIT License


Languages

Language:PHP 76.5%Language:Twig 20.3%Language:Dockerfile 1.7%Language:Shell 1.5%