Architecture
Modular and resilient code
In a constantly evolving sector, adapting is essential. It's just as crucial to quickly take on board feedback from experts and users. But above all, because flexibility greatly stimulates creativity and innovation in a project such as BANGK, it is vital to develop code that is both robust and scalable.
BANGK distinguishes two levels of code:
Functional code (business logic): this is the most contextual code, corresponding to an extremely personalised and non-reusable part of the code, which will be widely read and modified but little used. It must therefore be extremely resilient and readable.
"Framework" code: this is the lowest-level tool code, consisting of well-defined reusable modules that are intended to be used by the functional code. This code must be solid and well tested; it will be modified only a little but used a lot.
Each of these levels has its own imperatives, and in general, everything is done to maximise the reusable 'framework' part and minimise the functional part.
These are just some of the measures put in place to ensure maximum modularity:
Building a modular architecture (monorepo):
Encourage the creation of reusable, delimited modules and components.
Share resources (constants, types, etc.) between all projects (backend, internal dashboard, ICO dashboard, website, etc.).
Share integration and continuous delivery processes (automated testing, generation of translations/resources, application deployment scripts, etc.).
Avoiding redundant or low value-added code:
Code generation scripts currently generate a large proportion of low value-added code.
Build scripts or preBuilds prepare resources so that they can be used in a more readable way in the code.
Putting the use of snippets (generated code fragments) and the power of the editor at the heart of the strategy.
Opt for extensive use of the power of typescript for documentation in the code and to promote discoverability and validation of "framework" code.
Colours, sizes, margins, constants (supported languages, supported currencies...), security rules... are always defined in a single place.
Combating technical debt
Up to 75% of a company's technology budget can be spent on paying off a project's technical debt (McKinsey digital, 2020). Like a bank loan, the more you accumulate, the harder it is to repay the initial capital in favour of interest payments. This is particularly true in a start-up environment, where short-term productivity often takes precedence over long-term qualitative productivity. That's why BANGK is committed from the outset to automating, modularising and adopting best practice to ensure that we are always as close as possible to zero debt.
Project architecture
In a world where technologies and methods are constantly evolving, choosing the best option can be complicated. BANGK subjects its technological decisions to rigorous evaluation, to ensure that it makes the wisest choice.
The main technologies used are: Typescript, Rust, Solana, NodeJs, React, React Native, Expo (mobile application), PandaCSS / Vite (web applications), MongoDB (database).
Below is an overview of the project's technical architecture:
Front-end applications
Each front-end project has its own imperatives, in terms of performance, SEO and above all security. To maximise the quality of the different applications and avoid redundant code, front-end applications share most of their code through modules: a common design system with shared components, management of translations, errors, local memory storage, cache, back-end SDK, types, etc.
Mobile app
The mobile application is the only project that runs on mobile technologies. However, given the current state of technology, choosing a technology with which to work on mobile is a real challenge. Where web technologies are fairly mature, mobile technologies, while promising, are still in the throes of change. New avenues are opening up thanks to the recent arrival on the market of multi-platform technologies that are tending to replace native technologies.
After an in-depth benchmark, react-native with the Expo framework proved to be the perfect combination, in line with the project's philosophy and with advantages that far outweigh the disadvantages. It's a proven technology (applications: Instagram, Pinterest, Uber Eats...) which, among other things, maximises code reuse with the web and the backend, which are all written in Typescript.
Other frontend projects
The other projects are based on web technologies and mainly use the PandaCss library to implement the design system:
Main website.
ICO Dashboard.
Management dashboard for project administrators.
Internal Dashboard (Business Intelligence, data visualisation, marketing automation, support, financial management, admin-side project validation, etc.).
Main backend
The main backend, built in NodeJs, is based on a proprietary architecture that has been tried and tested on numerous projects. Its advantages include
SDK generation
Simplified and automated authentication management.
Exposure of backend services via a simple front-end TypeScript service.
Simplified and automated cache management (integration of react-query into the SDK).
Direct exposure of authorised methods in database.
Strict typing, autocompletion, integrated documentation and type sharing.
Simple, concise security management in the form of a configuration file.
For each model, it is possible to configure security for any combination of user (role and properties) and data (masking of certain fields, data filtering, prohibition/authorisation of certain operations, etc.).
Incoming and outgoing data is automatically validated and cleaned exhaustively.
Models are defined only once, in a simple way, and their types and definitions are accessible in all projects (backend, frontend, etc.).
Security is restricted by default.
Backends for Financial Operations and Business Intelligence
These 2 backends are written in Rust, a language strictly adapted to the security of financial flows, thanks in particular to its robustness and the absence of memory problems, which represent one of the most significant sources of vulnerability.
Blockchain and the On-Chain program
Most of the business logic for financial operations is written in a Solana "On-Chain" program, which is divided into two main areas:
Management of investment project tokens (project creation, purchase, sale, exchange, dividend payments, project closure).
Management of BANGK stable coins (proof of reserve, mint & burn, transfers and exchanges).
Last updated