For my next feature its time to build my production ready version of my api handler. I’m very proud of this framework. I have been building apis on Salesforce for 10+ years and I have just the coolest framework that I use for managing custom APIs on the platform.
Here are the requirements:
- Enterprise ready framework (think something like Express or Koa for Salesforce) for creating salesforce api. My goal is to make the framework compatible with modern api tools like swagger.
- New APIs can be dynamically added and injected to the platform using metadata setup and a simple handler class that will add it to the correct route on the API
- API is an INTERNAL implementation on the platform. This supports my architectural principal of API driven development. The api’s can be called internally from other apex classes, or via a web front end via remote methods or aura enabled classes.
- API is privately available via external Rest Endpoints on the platform for any authenticated user.
- API is publically available via a force.com site that has been properly configured (webhooks anyone?)
- Visualforce test harness
- Lightning component test harness to access the API from lightning
- Robust Logging on all api requests with the fine grained control over the logging
Future Roadmap Requirements:
- APIs can be generated and added to the framework very easily. Future tooling can be built on top of this to allow those APIs to be quickly generated and added to the stack.
- Denial of Service and other tools to support monitoring and eventing
Why all this work?
- First of all my goal in life is to retire as a self-made independent software architect who gives away my secrets for free and this is a big one
- My work on the Reactforce project has required me to optimize the backend work that is ever required to get a new Reactforce application up and running. The proper API driven development model is just good separation of concerns anyway. My projects that are designed on api driven development are incredibly clean, robust, and easy to maintain.
- The architecture for this API is globally scalable across your salesforce implementation. This puts Salesforce.com as the primary owner of critical data AND providing enterprise tooling that is necessary to scale a large app (sorry mulesoft but there is a sexier kid in town!)
Here is what I will be building this weekend!
This feature shall hence be known as feature/ENT-19
Happy Coding…. I’ll update this entry when its done…