Giter Club home page Giter Club logo

bank-simulator-api's Introduction

Introduction

This project was developed and structured based on the following expectation but also there are additional classes and APIs to be more familiar with my programming knowledge

1- authentication method 

2- migrations and database seeders 

3- models 

4- base repository and model repository 

5- query builder 

6- services and chain checkers classes 

###installation

1- authentication method

The project use sanctum to authenticate API user

2- migrations and database seeders

All tables migration columns are too clear but 2 complexes have static data, this means after migrating these tables data will automatically insert into these tables, the reason is that these tables' data always are static and never won't change

3 - Models

All data models stored in App\Models

  • #####UserModel : user or customer of api

  • ####AccountModel : represent the bank account of the user and users can have multiple accounts

######NOTE: Balance of account also store in Account model

each account is related to a specific account type (account types are static)
  • ####AccountTypeModel : represent available types of account

######NOTE: Account types data read from enums and insert into the database during migration

  • #####TransactionModel : represent account transactions

######NOTE: - Every tranaction has an receiver and a sender but sender could be null in some type of transaction - After creating a transaction, the TransactionCreatedEvent will call

  • #####TransactionTypeModel : represent all transaction types such as internal, external, create account reward and etc... ######NOTE: Transaction types data read from enums and insert into the database during migration

4 - Base repository and model repository

All database transactions should handle in the corresponding repository of model, all repos are extend from a parent one that has general functions such as (find , findBy , Create , CreateWithingModel , Update and etc.... )

5 - Query builder (my favorite part)

The main reason of using query builders is that it can filter list data and sorting them is right order with few line of codes

6 - services and chain checkers classes

  • ApiResponseService: The ApiResponseService class handles all the API responses it can help us to have one structure for all responses
  • TransactionService: The TransactionService class manages all transaction that the user wants to create it checks the availaibility of the account and check requirements to reassure that everything work well

bank-simulator-api's People

Contributors

amirbesharati avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.