ultimate-backend
ultimate-backend copied to clipboard
NEW ARCHITECTURE PROPOSAL
I have a new proposal to change the entire architecture to decoupled services and by that, I mean services not tied to APIs directly. For example, in the current implementation and design, the services are closely tied to GraphQL and that was the plan from the beginning, but moving forward, that will change and doing so we can have better control of our services. and graphql should be one means of talking to the services. below is a diagram of how the new architecture should look like. I would need your contributions is you are willing to share
Again the to level Graphql gateways can be omitted in this design giving for flexibility .on how much of your API you need in graphs or rest and the likes @av8ta @fabiofdsantos would love to hear your take on this
You can like this new design
I believe this new architecture makes more sense to build a generic starter kit..
As of today I have migrated to project to the new architecture. I'm still writing tests. I will make a push to a V2 branch this weekend. Stay safe
Here is the new architecture https://github.com/juicycleff/ultimate-backend/tree/next . I Will add a multitenant project service to show multi-tenancy. You will notice things are more cleaner with a lot less boilerplate code. It should be out by tomorrow with test and DevOPS working. The GraphQL mutation API is also rewritten in a cleaner way mind you. In some circumstances, the mutation API structure in the master branch is better. Look at issues involved with GraphQL mutation namespace
Role-based access control, as well as tenant access token API, has been rewritten to match modern-day API key spec.
Who uses Kubernetes and CoreDNS as a service registry?
Note next branch has been merged to master
Any one tried with consul configration in docker-compose.yml?
Hi @juicycleff , I am stuck at configring consul in docker-compose.yml. Any directions?
@kamranblueeast for me, next steps solved issue:
-
Define network in docker-compose:
networks: backend: driver: bridge ipam: driver: default config: - subnet: 172.172.0.0/24
-
Setup IP address for consul and define env variable CONSUL_HOST like below: ` consul: networks: backend: ipv4_address: 172.172.0.201 container_name: consul ports:
- "8400:8400"
- "8500:8500"
- "8600:53/udp" image: consul command: ["agent", "-server", "-bootstrap", "-ui", "-bind={{ GetInterfaceIP "eth0" }}", "-client", "0.0.0.0"] environment:
- CONSUL_HOST={{ GetInterfaceIP "eth0" }} labels: kompose.service.type: nodeport kompose.service.expose: "true" kompose.image-pull-policy: "Always" `
-
In every apps/service/src/bootstrap-development.yaml, also need to replace localhost to ${{CONSUL_HOST}}:
consul: host: ${{CONSUL_HOST}} port: 8500
Note after change apps/service/bootstrap-development.yaml you must rebuild docker image. I am not expert in docker and in this repo, but this helped me.
@cemeheeb thanks, let me try with this one.
@cemeheeb, if you can explain point 1? and after setting networks:backend as you set in point 2, it prompts me network undefind error.
anyone still working on this ?