Api-First service design
- 2. @sponnet / #API_BE
Context
@Digipolis Antwerp, IT-partner city of Antwerp
Aims to build an open source and user-centric
city platform as a foundation layer for
personalised and any-device public services
- 3. @sponnet / #API_BE
Context
The architecture should be open, modular and layered to
allow optimal integration in existing environments and
scaling for performance.
Reusable services, an open SDK and API’s accelerate the
development, maximize integration and reduce the time to
market.
To be built in co-creation with freelancers, start-ups,
students, creatives...
You can participate! Go to http://antwerpen.digipolis.be
- 5. @sponnet / #API_BE
Built using
● PHP ( authentication / user management /
apps )
● NodeJS ( several apps )
● AngularJS (1.2 , but we’re migrating to 1.4)
Redis - MongoDB - nginx - Solr
- 7. @sponnet / #API_BE
And we want to make them public...
● API docs
● SDK
● code
snippets
● SASS kit
https://github.com/Antwerp-Operating-System
- 9. @sponnet / #API_BE
What is API-first development ?
Shared functionality ?
- expose this functionality as a
RESTful HTTP API
- … to all other developers &
stakeholders
No shared modules / code bases
- 11. @sponnet / #API_BE
Net result in a traditional approach
Centralized Engineered system
Subordinate parts serving as means
to deliberately designed ends
- 13. @sponnet / #API_BE
Net result using an API-First design
decentralized, organic and evolving ecosystem where
individual actors (API’s ) can be spontaneously
enfranchised or co-opted by any other actor / set of actors
to serve new purposes.
- 15. @sponnet / #API_BE
Opportunities of using well designed
& documented API’s
● speed of development
● stimulates re-use
● de-centralized
● evolves towards an ecosystem of services
● organic and always evolving
● easily co-opted by other actors
- 16. @sponnet / #API_BE
Benefits on productivity
With solid API’s
● Stakeholders can create or hack-together
production ready applications faster
● More secure
● More reliable
- 19. @sponnet / #API_BE
API in the product design process
1. well documented
2. easy to use
3. as conventional as possible
4. monitored
5. secure
6. versioned
7. has registry of subscribers
- 24. @sponnet / #API_BE
Swagger-codegen
Generates :
- API servers & clients in various languages
and for various frameworks
- C# / JavaScript ( NodeJS ) / GO / ...etc.
- Static HTML documentation
https://github.com/swagger-api/swagger-codegen
- 27. @sponnet / #API_BE
Stub your API right from the editor
generates your
endpoints and
exposes dummy data
explore and publish your API documentation
- 28. @sponnet / #API_BE
Deploy our stub to start
development
backend DEV starts
implementing
business logic for
your backend
frontend DEV uses stubbed API to design his
front-end / routing logic etc.
Towards a mutual result
- 29. @sponnet / #API_BE
So what do we have already ?
1. well documented
2. easy to use
3. as conventional as possible
4. monitored
5. secure
6. versioned
7. has registry of subscribers
- 30. @sponnet / #API_BE
So what about security / versioning / subscription ?
Out here - we use WSO2 API Manager
API publishing
API versioning
API subscriptions
OAuth2 + scopes
Routing to backend systems
Editor's Notes
- good busy ! = OCAPI ;)
- API-first development is the idea that whenever you are developing a piece of shared functionality for your organization it should be exposed as a RESTful HTTP API to all of your other developers. Rather than creating a library or module that needs to be added to all code bases requiring the functionality, developers can consume all the necessary functionality through the API