Closed danrminds closed 6 years ago
API: I think to keep the API simple, and to assure that the functionality can be fully decentralized, we should initially focus it on providing the functionality for the app. So that’s transactions and validation.
Services: I think it will initially be the majority of the system. When we’re confident, we can start moving parts over to the API. We should take our time for this since I think architecting for blockchain and self-sovereign identity works a bit different than having a traditional database where we hold all the information. I also think since transactions in smart contracts are expencive and computers are getting faster and cheaper, in a decentralized world more processing will happen on the front-end vs. on the blockchain backend.
PHP/NodeJS for the services: a pro of using php is that we already have a lot of the functionality we need in kindpakkket 1.1 and we can use the native bunq php sdk (there is no nodejs sdk yet). The cons are that it might be harder to move the functionality from the services to the api or the frontend. Jusing javascript/json everywhere can be an advantage in the future.
I don’t know how much work it will be to move from php to nodejs, but it does seem like a good investment for the future, I think @danrminds should decide together with @dev-weget
For forus.io I think a good initial reference for the functionality that should eventually go in the API is: https://github.com/teamforus/forus/blob/master/docs/forus.io.md
So, we had couple of variations possible:
After researching the micro-service approach me and Valentin came with a conclusion / proposal.
Here you can see an architecture 100% built on micro-services:
That supposes a following structure in our case (1 core application with services to handle the rest of the functionality):
core [PROXY]
identities
medias
records
funds
validators
providers
sponsors
categories
products
offices
transactions
[pros]
[cons]
Building a monolith version is also not a good idea, because of our plan to extend and migrate to blockchain / nodejs in time. That is why we come with a proposal of building a hybrid system using services and divide the core application in repositories (modular, not github repositories):
Proposal:
1) Develop mvp on repositories and few services
Repositories:
- IdentityRepository
- MediaRepository
- RecordsRepository
- FundRepository
- ValidatorRepository
- ProviderRepository
- SponsorRepository
- CategoryRepository
- ProductRepository
- OfficeRepsoitory
- TransctionRepository
Services:
- Push notifications service
- Bunq service
- Sponsors/validators server applications
2) all MVp services will be accessed through proxy repositories
- BunqRepository
- PushNotificationRepository
- Other
3) Then MVP is ready, start building services to move business logic from repositories to service applications one by one. 4) Keep using repositories as a proxy for services.
Something like this for the repository names:
I would maybe add a -front- tag to the dashboards e.g:
Repositories:
- IdentityRepository
- MediaRepository
- RecordsRepository
- mysql
- FundRepository
- ValidatorRepository
- ProviderRepository
- SponsorRepository
- CategoryRepository
- ProductRepository
- AssetsRepository
- VouchersRepository - PHP
- TokenRepository - PHP
- TransactionRepository - PHP
Services:
- Transaction service - BLOCKCHAIN
- IPFS Records service
- IPFS Media service
- Push notifications service
- Bunq service
- Sponsors/validators server applications
- DB connection
- DigiD