How we are building complex software solutions for an accounting company

SAAS platform for Fintech industry banner

DAS is a cloud-based platform that meets the needs of businesses and accounting agencies for programs and services that will help them to efficiently manage their finances.
In addition to popular programs for invoicing, accounting, inventory, payroll, and expense management, hundreds of industry-specific solutions from other suppliers are integrated into the platform.
What makes it really functional, is that everything you do is available everywhere and any time on only one platform. It is a perfect solution for collaborating with an accounting agency and sharing your work. It is very suitable even when you are traveling and want to work via the DAS app on your mobile phone.

Technology used

  • Docker and Docker Compose
  • Laravel
  • VueJS
  • SASS
  • Redis
  • Mysql
  • Webpack

File Structure

The image below is a structure of project files and folders in development mode:

Important files and folders

dockerthis folder contains docker containers
logsthis folder contains docker containers logs 
srcthis folder contains project
.envthis file contains environment variables for docker and pre-installation 
docker-compose.ymlthis file defining and running multi-container Docker applications
Makefilethis file is shell commands which makes it easy to start or stop the server
Source of projectDocker Containers

Project Structure

The structure of the project is shown in the picture above. The peculiarity of this structure is that the shared files with the project name “das” contain the project structure such as controllers, models, repository, services, etc. Due to the laravel upgrade, the peculiarity of this structure is different from the laravel structure. We have had such cases where the laravel structure has changed from version to version and this has affected the project or the organization of the project for browsing files.

Features

Multi Tenancy

DAS is a reference to the mode of operation of software where multiple independent instances of one or multiple applications operate in a shared environment. The instances (tenants) are logically isolated, but physically integrated.

Clean Code

Writing clean code is important because it allows you to clearly communicate with the next person who works with what you’ve written. Returning to previously written code and understanding what it does is key, especially in the software development world.

public function create(CreateVoucherRequest $request)
{
    return $this->apiResponse(
          __("Voucher has been created"), 
          $this->repository->create($request->validated())->toArray()
    )->asApiSuccess();
}

as seen above the code is clean and understandable.

Modular

This is what modular is trying to resolve. You split the business logic into different parts, which belong together. If you’re into Domain Driven Design, you can consider a module an aggregate. Every module has its own routes/controllers/models/views/business logic/etc. Meaning every module contains a group of classes that all are related to each other in some way.

Design Pattern

DAS is built with a design pattern that establishes solutions to common problems, which help keep the code maintainable, extensible, and loosely coupled. Developers have given a name to solutions that solve a particular type of problem.

namespace Das\Modules\Vouchers;

use Das\Database\TenantEloquents\Vouchers\Vouchers;
use Illuminate\Database\Eloquent\Collection;

interface VoucherTransactionServiceInterface
{
    /**
     * Set Voucher Model
     * @param Vouchers $model
     * @return VoucherTransactionService
     */
public function setModel(Vouchers $model): VoucherTransactionService;

    /**
     * Set Transactions
     * @param array $data
     * @return VoucherTransactionService
     */
public function setTransactions(array $data): VoucherTransactionService;

    /**
     * Create Voucher Transactions from data
     * @return Collection
     * @throws \Exception
     */
public function create(): Collection;
}
namespace Das\Modules\Vouchers;


use Das\Database\TenantEloquents\Vouchers\Vouchers;
use Illuminate\Database\Eloquent\Collection;
use Exception;

class VoucherTransactionService implements VoucherTransactionServiceInterface
{

    private Vouchers $model;
    protected array $transactions = [];

    /**
     * Set Voucher Model
     * @param Vouchers $model
     * @return $this
     */
public function setModel(Vouchers $model) : self
    {
        $this->model = $model;
        return $this;
    }

    /**
     * Set Transactions
     * @param array $data
     * @return $this
     */
public function setTransactions(array $data) : self
    {
        $this->transactions = $data;
        return $this;
    }

    /**
     * Create Voucher Transactions from data
     * @return Collection
     * @throws \Exception
     */
public function create() : Collection
    {
        // logic of code...
    }
}

Docblocks

DocBlocks are blocks of texts which are used to generate documentation using phpDocumentor, also known as phpDoc. Interestingly, they are very important to use when we developing a complex software product. In this case, everything must be documented.

How is a new tenant company created?

When a company that will create the multi-tenancy architecture is created, the client database is independent from the application database. This means that if a client experiences a data problem, it will not affect other clients.
Below you will find our how to create a company based on multi-tenancy.

These were some features of this platform.

Along with this project, we have some different challenges that Kutia has overcome to function properly. Unfortunatly, for authorial reasons, not all features can be published.

It has been a pleasure to share our solution with you. We are grateful for our back-end developer Sami Maxhuni, who worked on this project and made it possible for us to share it with you by putting all the work into words.