SlideShare a Scribd company logo
1 of 25
Download to read offline
BASE3
https://base3.dev
Nikola Milisavljevic
Digital CUBE, Belgrade
What is BASE?
- BASE3 is a Python web framework based on Tornado asynchronous networking library,
developed by Digital Cube team for internal use. It is also available to the open source
community to use and contribute to the project.
- We noticed we needed to write a lot of boilerplate code to start working on our
applications
- Solution: create a BASE framework
- BASE principles:
- Implementation of code reusability for common operations (user management,
registration, email sending, PDF generation)
- Simple to use and get going
- Great for onboarding new programmers (with and without Python experience)
- Scalability and microservices
BASE / main features
- Methods and recipes for making REST API based application
- Bundled Python tools for a seamless start
- Python decorators for code reusability and common functionalities
- Authentication using different identity providers (Google, Facebook…)
- Tool for generating source code templates
- Auto-generation of API specification
- Flexibility in the scale and purpose of the application (small, template driven websites to
complex async microservice application)
- Education
Main goals
- Making of REST APIs with focus on business and underlying logic rather than the tools
themselves
- Reduction of the amount of effort needed to bootstrap
- Microservice organized architecture with common microservices already written and
maintained for current and future projects
- Automatic parameter validation with using Models as the schema
- Test Driven Development
- Use of template engines for simple server-side rendered websites
Common services
- Implementation and maintenance of common microservices to encourage code reuse:
- Users / Authentication
https://github.com/digital-cube/base3service-users.git
- Sending emails
https://github.com/digital-cube/base3service-mailer.git
- PDF generator
- Multitenancy
- Blog
Technologies
- Python 3.x
- tornadoweb (web framework and asynchronous networking library)
- Database:
- Currently implemented PostgreSQL using SQLAlchemy ORM, but also other
popular open source RDBMS will be supported soon
- CRUD implementation in API calls (with the use of Models as types)
- Reduction of the amount of duplicated code for simple CRUD operations
- Redis
- Docker
Implemented decorators
- @route
- decorate Handler class and define route where methods can be reachable
- @api
- decorate a method to process input arguments, fetching models
- @auth
- decorate a method to allow only authorized users to access
Handling input parameters
- Input parameters can be passed through URI or Request Body, both of them are read as
parameters in the Handler class
- With Python typing, we can automatically check and validate parameters
- Currently supported types are str, int, bool, float
- Also any defined database Model can be considered as a type
- For storing Models in Database, use the Model type
- For fetching Models from database use Id attribute of Model
- Parameters can be mandatory or optional
- For optional parameters set the default value for this parameter
- None can be used as default value as well
Models as Types
import base
import models
@base.route("/")
class RegisterUserHandler(base.Base):
@base.api()
async def post(self, user: models.User):
self.orm_session.add(user)
self.orm_session.commit()
return {"id": user.id}, base.http.status.CREATED
if __name__ == "__main__":
base.run()
Models as Types
import base
import models
import lookup.permissions as perm
@base.route("/:id_user")
class SingleUserHandler(base.Base):
@base.auth(permissions=perm.ADMIN)
@base.api()
async def get(self, user: models.User.id):
return {"user": user.serialize()}
if __name__ == "__main__":
base.run()
Handling responses
- Since the main goal of BASE is to build a REST API, default response headers are
application/json, but also any other output can be sent (HTML, text or binary)
- To provide the result, just return an object which can be serialized into JSON (dict, list,
string) and this object will be returned to the caller
- Default status code is HTTP code 200 OK, but any other code can be specified as a
second parameter, for example, if you want to return 201 (Created) write:
- return {“id”: obj.id}, http.status.CREATED
- If the method returns None, or if there is no return statement, the default status code will
be 204 (No Content)
Handling exceptions and errors
- Errors, like any other response, can be sent back using a return statement with one of
4XX response code (NOT_FOUND, UNAUTHORIZED, BAD_REQUEST, …)
- We can throw an exception which will be caught in the @api decorator and immediately
the API call will return an error with an error message and id_message (for translation
purposes)
- These errors cascade all the way back to the initial service in the case of calls requiring
multiple services
Inter Process Communication (IPC)
- Services communicate with each other by using our IPC method
- Complex request chains are handled by cascading requests onto different services
(if needed)
- Allows services to have separation of concerns and communicate between themselves
for sharing data and logic
- In BASE we share business logic and data between services through using REST APIs
of the services themselves
- Currently AsyncHTTP request is the only supported method for IPC, and we are planning
to introduce other methods and ways
Concurrency and bottleneck optimization
- We recommend the use of async/await methods to avoid blocking service by multiple
requests
- BASE supports threading coroutine mechanism which will process API calls in multiple
threads
- External workers using message queuing
- Creating multiple instance of the microservice which is a bottleneck
Testing
- Test Driven Development is one of the key concepts of using this framework
- Services can be tested independently by mocking results from other services
- Services can be tested all together in a single integration test
- For this feature, developer needs to follow additional rules (routes throughout all
services should be unique, as well as class name of handler) and additional
configuration setup, documented in example
Try it (source code)
https://base3.dev/examples/hello_world/hello_world.py
import base
@base.route("/")
class IndexHandler(base.Base):
@base.api()
async def get(self):
return {"message": "Hello World"}
if __name__ == "__main__":
base.run()
Try it (using local python3 installation and venv)
Open browser and visit http://localhost:9000
mkdir base-demo && cd base-demo
python3 -m venv .venv
source .venv/bin/activate
pip install wheel base3
curl https://base3.dev/examples/hello_world/hello_world.py -o hello_world.py
python hello_world.py
Try it (using docker / docker-compose)
mkdir base-demo && cd base-demo
curl https://base3.dev/examples/hello_world/hello_world.py -o hello_world.py
curl https://base3.dev/examples/hello_world/docker-compose.yaml -o docker-compose.yaml
curl https://base3.dev/examples/hello_world/Dockerfile -o Dockerfile
docker-compose up
Open browser and visit http://localhost:9000
Microservice based example (using docker / docker-compose)
git clone https://github.com/digital-cube/base3example-contacts.git
cd base3example-contacts
docker-compose up
Open browser or postman and visit http://localhost:9000
Todo:.. Add more links..
app.sfscon.it
Next steps:
- CLI
- Project configuration
- Managing services
- Creating service from a pre-existing template
- Support for other databases except PostgreSQL
- Write more common services
- Automatic documentation generator
Digital Cube
- We have been in business for 5 years and delivered over 30 projects for clients across Europe and North
America.
- We have collaborated with start-ups, mid-markets, and large enterprises.
- Some of our clients include:
- Telmekom Networks (South Tyrol, Italy), OOB (Denmark), 3DSystem (USA/Switzerland), Serbian
Academy of Sciences and Arts (Serbia)...
-
We employ experienced developers, designers and engineers with the main goal of providing the best
possible products and services
- The experience we have gained has enabled us to offer a wide range of software solutions and services
that meet the needs of our clients
- Our focus is constantly on our clients' business challenges and we provide innovative ideas for them
- Our abundant technical expertise is at their disposal around the clock.
Digital Cube provide services in:
- Advisory:
- Product Design
- Business Process, Optimisation and Analysis
- Engineering:
- Web Application Development
- Mobile Application Development
- Desktop Application Development
- Assurance:
- Software Testing and Quality Assurance
- Technical Support
Contribute:
https://base3.dev
https://pypi.org/project/base3/
https://github.com/digital-cube/BASE
BASE3
https://base3.dev
https://pypi.org/project/base3/
https://github.com/digital-cube/BASE
nikola.milisavljevic@digitalcube.rs
Thank you for listening!

More Related Content

What's hot

Project Fedena and Why Ruby on Rails - ArvindArvind G S
Project Fedena and Why Ruby on Rails - ArvindArvind G SProject Fedena and Why Ruby on Rails - ArvindArvind G S
Project Fedena and Why Ruby on Rails - ArvindArvind G SThoughtWorks
 
]po[ Sencha File-Storage Specs
]po[ Sencha File-Storage Specs]po[ Sencha File-Storage Specs
]po[ Sencha File-Storage SpecsKlaus Hofeditz
 
Create Home Directories on Storage Using WFA and ServiceNow integration
Create Home Directories on Storage Using WFA and ServiceNow integrationCreate Home Directories on Storage Using WFA and ServiceNow integration
Create Home Directories on Storage Using WFA and ServiceNow integrationRutul Shah
 
Hadoop introduction
Hadoop introductionHadoop introduction
Hadoop introductionDong Ngoc
 
Jsf login logout project
Jsf login logout projectJsf login logout project
Jsf login logout projectGagandeep Singh
 
Introduction to RESTful Webservice
Introduction to RESTful WebserviceIntroduction to RESTful Webservice
Introduction to RESTful WebserviceEftakhairul Islam
 
Drupal - short introduction.
Drupal - short introduction.Drupal - short introduction.
Drupal - short introduction.Diana Falkowska
 
Application server vs Web Server
Application server vs Web ServerApplication server vs Web Server
Application server vs Web ServerGagandeep Singh
 
SenchaCon 2016: Learn the Top 10 Best ES2015 Features - Lee Boonstra
SenchaCon 2016: Learn the Top 10 Best ES2015 Features - Lee Boonstra  SenchaCon 2016: Learn the Top 10 Best ES2015 Features - Lee Boonstra
SenchaCon 2016: Learn the Top 10 Best ES2015 Features - Lee Boonstra Sencha
 
MuleSoft Consuming Soap Web Service - CXF jax-ws-client Module
MuleSoft Consuming Soap Web Service - CXF jax-ws-client ModuleMuleSoft Consuming Soap Web Service - CXF jax-ws-client Module
MuleSoft Consuming Soap Web Service - CXF jax-ws-client ModuleVince Soliza
 
Web ,app and db server presentation
Web ,app and db server presentationWeb ,app and db server presentation
Web ,app and db server presentationParth Godhani
 
Web servers (l6)
Web servers (l6)Web servers (l6)
Web servers (l6)Nanhi Sinha
 
Introduction to RESTful Webservices in JAVA
Introduction to RESTful Webservices  in JAVA Introduction to RESTful Webservices  in JAVA
Introduction to RESTful Webservices in JAVA psrpatnaik
 
Easy rest service using PHP reflection api
Easy rest service using PHP reflection apiEasy rest service using PHP reflection api
Easy rest service using PHP reflection apiMatthieu Aubry
 
Web services - A Practical Approach
Web services - A Practical ApproachWeb services - A Practical Approach
Web services - A Practical ApproachMadhaiyan Muthu
 
The content manager loves the tree
The content manager loves the treeThe content manager loves the tree
The content manager loves the treeMaximilian Berghoff
 

What's hot (20)

Project Fedena and Why Ruby on Rails - ArvindArvind G S
Project Fedena and Why Ruby on Rails - ArvindArvind G SProject Fedena and Why Ruby on Rails - ArvindArvind G S
Project Fedena and Why Ruby on Rails - ArvindArvind G S
 
]po[ Sencha File-Storage Specs
]po[ Sencha File-Storage Specs]po[ Sencha File-Storage Specs
]po[ Sencha File-Storage Specs
 
Create Home Directories on Storage Using WFA and ServiceNow integration
Create Home Directories on Storage Using WFA and ServiceNow integrationCreate Home Directories on Storage Using WFA and ServiceNow integration
Create Home Directories on Storage Using WFA and ServiceNow integration
 
Web server
Web serverWeb server
Web server
 
Hadoop introduction
Hadoop introductionHadoop introduction
Hadoop introduction
 
Jsf login logout project
Jsf login logout projectJsf login logout project
Jsf login logout project
 
Introduction to RESTful Webservice
Introduction to RESTful WebserviceIntroduction to RESTful Webservice
Introduction to RESTful Webservice
 
Excellent rest using asp.net web api
Excellent rest using asp.net web apiExcellent rest using asp.net web api
Excellent rest using asp.net web api
 
Drupal - short introduction.
Drupal - short introduction.Drupal - short introduction.
Drupal - short introduction.
 
Application server vs Web Server
Application server vs Web ServerApplication server vs Web Server
Application server vs Web Server
 
SenchaCon 2016: Learn the Top 10 Best ES2015 Features - Lee Boonstra
SenchaCon 2016: Learn the Top 10 Best ES2015 Features - Lee Boonstra  SenchaCon 2016: Learn the Top 10 Best ES2015 Features - Lee Boonstra
SenchaCon 2016: Learn the Top 10 Best ES2015 Features - Lee Boonstra
 
Advaced training-wso2-esb
Advaced training-wso2-esbAdvaced training-wso2-esb
Advaced training-wso2-esb
 
Google App Engine
Google App EngineGoogle App Engine
Google App Engine
 
MuleSoft Consuming Soap Web Service - CXF jax-ws-client Module
MuleSoft Consuming Soap Web Service - CXF jax-ws-client ModuleMuleSoft Consuming Soap Web Service - CXF jax-ws-client Module
MuleSoft Consuming Soap Web Service - CXF jax-ws-client Module
 
Web ,app and db server presentation
Web ,app and db server presentationWeb ,app and db server presentation
Web ,app and db server presentation
 
Web servers (l6)
Web servers (l6)Web servers (l6)
Web servers (l6)
 
Introduction to RESTful Webservices in JAVA
Introduction to RESTful Webservices  in JAVA Introduction to RESTful Webservices  in JAVA
Introduction to RESTful Webservices in JAVA
 
Easy rest service using PHP reflection api
Easy rest service using PHP reflection apiEasy rest service using PHP reflection api
Easy rest service using PHP reflection api
 
Web services - A Practical Approach
Web services - A Practical ApproachWeb services - A Practical Approach
Web services - A Practical Approach
 
The content manager loves the tree
The content manager loves the treeThe content manager loves the tree
The content manager loves the tree
 

Similar to SFScon 2020 - Nikola Milisavljevic - BASE - Python REST API framework

mu.semte.ch - A journey from TenForce's perspective - SEMANTICS2016
mu.semte.ch - A journey from TenForce's perspective - SEMANTICS2016mu.semte.ch - A journey from TenForce's perspective - SEMANTICS2016
mu.semte.ch - A journey from TenForce's perspective - SEMANTICS2016Aad Versteden
 
Design Summit - RESTful API Overview - John Hardy
Design Summit - RESTful API Overview - John HardyDesign Summit - RESTful API Overview - John Hardy
Design Summit - RESTful API Overview - John HardyManageIQ
 
Ruby On Rails Basics
Ruby On Rails BasicsRuby On Rails Basics
Ruby On Rails BasicsAmit Solanki
 
Drupal South 2015: Introduction to Web Services. Services in Drupal 8.
Drupal South 2015: Introduction to Web Services.  Services in Drupal 8.Drupal South 2015: Introduction to Web Services.  Services in Drupal 8.
Drupal South 2015: Introduction to Web Services. Services in Drupal 8.TechnocratAu
 
High quality ap is with api platform
High quality ap is with api platformHigh quality ap is with api platform
High quality ap is with api platformNelson Kopliku
 
Code igniter - A brief introduction
Code igniter - A brief introductionCode igniter - A brief introduction
Code igniter - A brief introductionCommit University
 
The next step from Microsoft - Vnext (Srdjan Poznic)
The next step from Microsoft - Vnext (Srdjan Poznic)The next step from Microsoft - Vnext (Srdjan Poznic)
The next step from Microsoft - Vnext (Srdjan Poznic)Geekstone
 
Semantic technologies in practice - KULeuven 2016
Semantic technologies in practice - KULeuven 2016Semantic technologies in practice - KULeuven 2016
Semantic technologies in practice - KULeuven 2016Aad Versteden
 
The Moving Code Project - Matthias Müller
The Moving Code Project - Matthias MüllerThe Moving Code Project - Matthias Müller
The Moving Code Project - Matthias MüllerLuis_de_Sousa
 
Building Your First App with MongoDB
Building Your First App with MongoDBBuilding Your First App with MongoDB
Building Your First App with MongoDBMongoDB
 
2.28.17 Introducing DSpace 7 Webinar Slides
2.28.17 Introducing DSpace 7 Webinar Slides2.28.17 Introducing DSpace 7 Webinar Slides
2.28.17 Introducing DSpace 7 Webinar SlidesDuraSpace
 
muCon 2017 - 12 Factor Serverless Applications
muCon 2017 - 12 Factor Serverless ApplicationsmuCon 2017 - 12 Factor Serverless Applications
muCon 2017 - 12 Factor Serverless ApplicationsChris Munns
 
Hia 1691-using iib-to_support_api_economy
Hia 1691-using iib-to_support_api_economyHia 1691-using iib-to_support_api_economy
Hia 1691-using iib-to_support_api_economyAndrew Coleman
 
Nasdanika Foundation Server
Nasdanika Foundation ServerNasdanika Foundation Server
Nasdanika Foundation ServerPavel Vlasov
 

Similar to SFScon 2020 - Nikola Milisavljevic - BASE - Python REST API framework (20)

mu.semte.ch - A journey from TenForce's perspective - SEMANTICS2016
mu.semte.ch - A journey from TenForce's perspective - SEMANTICS2016mu.semte.ch - A journey from TenForce's perspective - SEMANTICS2016
mu.semte.ch - A journey from TenForce's perspective - SEMANTICS2016
 
Design Summit - RESTful API Overview - John Hardy
Design Summit - RESTful API Overview - John HardyDesign Summit - RESTful API Overview - John Hardy
Design Summit - RESTful API Overview - John Hardy
 
Ruby On Rails Basics
Ruby On Rails BasicsRuby On Rails Basics
Ruby On Rails Basics
 
Drupal South 2015: Introduction to Web Services. Services in Drupal 8.
Drupal South 2015: Introduction to Web Services.  Services in Drupal 8.Drupal South 2015: Introduction to Web Services.  Services in Drupal 8.
Drupal South 2015: Introduction to Web Services. Services in Drupal 8.
 
High quality ap is with api platform
High quality ap is with api platformHigh quality ap is with api platform
High quality ap is with api platform
 
Code igniter - A brief introduction
Code igniter - A brief introductionCode igniter - A brief introduction
Code igniter - A brief introduction
 
The next step from Microsoft - Vnext (Srdjan Poznic)
The next step from Microsoft - Vnext (Srdjan Poznic)The next step from Microsoft - Vnext (Srdjan Poznic)
The next step from Microsoft - Vnext (Srdjan Poznic)
 
Semantic technologies in practice - KULeuven 2016
Semantic technologies in practice - KULeuven 2016Semantic technologies in practice - KULeuven 2016
Semantic technologies in practice - KULeuven 2016
 
Http and REST APIs.
Http and REST APIs.Http and REST APIs.
Http and REST APIs.
 
Databasecentricapisonthecloudusingplsqlandnodejscon3153oow2016 160922021655
Databasecentricapisonthecloudusingplsqlandnodejscon3153oow2016 160922021655Databasecentricapisonthecloudusingplsqlandnodejscon3153oow2016 160922021655
Databasecentricapisonthecloudusingplsqlandnodejscon3153oow2016 160922021655
 
The Moving Code Project - Matthias Müller
The Moving Code Project - Matthias MüllerThe Moving Code Project - Matthias Müller
The Moving Code Project - Matthias Müller
 
Building Your First App with MongoDB
Building Your First App with MongoDBBuilding Your First App with MongoDB
Building Your First App with MongoDB
 
SharePoint 2013 - What's New
SharePoint 2013 - What's NewSharePoint 2013 - What's New
SharePoint 2013 - What's New
 
Codeignitor
Codeignitor Codeignitor
Codeignitor
 
Workshop 16: EmberJS Parte I
Workshop 16: EmberJS Parte IWorkshop 16: EmberJS Parte I
Workshop 16: EmberJS Parte I
 
EMEA Airheads - Configuring different APIs in Aruba 8.x
EMEA Airheads - Configuring different APIs  in Aruba 8.x EMEA Airheads - Configuring different APIs  in Aruba 8.x
EMEA Airheads - Configuring different APIs in Aruba 8.x
 
2.28.17 Introducing DSpace 7 Webinar Slides
2.28.17 Introducing DSpace 7 Webinar Slides2.28.17 Introducing DSpace 7 Webinar Slides
2.28.17 Introducing DSpace 7 Webinar Slides
 
muCon 2017 - 12 Factor Serverless Applications
muCon 2017 - 12 Factor Serverless ApplicationsmuCon 2017 - 12 Factor Serverless Applications
muCon 2017 - 12 Factor Serverless Applications
 
Hia 1691-using iib-to_support_api_economy
Hia 1691-using iib-to_support_api_economyHia 1691-using iib-to_support_api_economy
Hia 1691-using iib-to_support_api_economy
 
Nasdanika Foundation Server
Nasdanika Foundation ServerNasdanika Foundation Server
Nasdanika Foundation Server
 

More from South Tyrol Free Software Conference

SFSCON23 - Rufai Omowunmi Balogun - SMODEX – a Python package for understandi...
SFSCON23 - Rufai Omowunmi Balogun - SMODEX – a Python package for understandi...SFSCON23 - Rufai Omowunmi Balogun - SMODEX – a Python package for understandi...
SFSCON23 - Rufai Omowunmi Balogun - SMODEX – a Python package for understandi...South Tyrol Free Software Conference
 
SFSCON23 - Roberto Innocenti - From the design to reality is here the Communi...
SFSCON23 - Roberto Innocenti - From the design to reality is here the Communi...SFSCON23 - Roberto Innocenti - From the design to reality is here the Communi...
SFSCON23 - Roberto Innocenti - From the design to reality is here the Communi...South Tyrol Free Software Conference
 
SFSCON23 - Martin Rabanser - Real-time aeroplane tracking and the Open Data Hub
SFSCON23 - Martin Rabanser - Real-time aeroplane tracking and the Open Data HubSFSCON23 - Martin Rabanser - Real-time aeroplane tracking and the Open Data Hub
SFSCON23 - Martin Rabanser - Real-time aeroplane tracking and the Open Data HubSouth Tyrol Free Software Conference
 
SFSCON23 - Marianna d'Atri Enrico Zanardo - How can Blockchain technologies i...
SFSCON23 - Marianna d'Atri Enrico Zanardo - How can Blockchain technologies i...SFSCON23 - Marianna d'Atri Enrico Zanardo - How can Blockchain technologies i...
SFSCON23 - Marianna d'Atri Enrico Zanardo - How can Blockchain technologies i...South Tyrol Free Software Conference
 
SFSCON23 - Lucas Lasota - The Future of Connectivity, Open Internet and Human...
SFSCON23 - Lucas Lasota - The Future of Connectivity, Open Internet and Human...SFSCON23 - Lucas Lasota - The Future of Connectivity, Open Internet and Human...
SFSCON23 - Lucas Lasota - The Future of Connectivity, Open Internet and Human...South Tyrol Free Software Conference
 
SFSCON23 - Giovanni Giannotta - Intelligent Decision Support System for trace...
SFSCON23 - Giovanni Giannotta - Intelligent Decision Support System for trace...SFSCON23 - Giovanni Giannotta - Intelligent Decision Support System for trace...
SFSCON23 - Giovanni Giannotta - Intelligent Decision Support System for trace...South Tyrol Free Software Conference
 
SFSCON23 - Elena Maines - Embracing CI/CD workflows for building ETL pipelines
SFSCON23 - Elena Maines - Embracing CI/CD workflows for building ETL pipelinesSFSCON23 - Elena Maines - Embracing CI/CD workflows for building ETL pipelines
SFSCON23 - Elena Maines - Embracing CI/CD workflows for building ETL pipelinesSouth Tyrol Free Software Conference
 
SFSCON23 - Charles H. Schulz - Why open digital infrastructure matters
SFSCON23 - Charles H. Schulz - Why open digital infrastructure mattersSFSCON23 - Charles H. Schulz - Why open digital infrastructure matters
SFSCON23 - Charles H. Schulz - Why open digital infrastructure mattersSouth Tyrol Free Software Conference
 
SFSCON23 - Thomas Aichner - How IoT and AI are revolutionizing Mass Customiza...
SFSCON23 - Thomas Aichner - How IoT and AI are revolutionizing Mass Customiza...SFSCON23 - Thomas Aichner - How IoT and AI are revolutionizing Mass Customiza...
SFSCON23 - Thomas Aichner - How IoT and AI are revolutionizing Mass Customiza...South Tyrol Free Software Conference
 
SFSCON23 - Mirko Boehm - European regulators cast their eyes on maturing OSS ...
SFSCON23 - Mirko Boehm - European regulators cast their eyes on maturing OSS ...SFSCON23 - Mirko Boehm - European regulators cast their eyes on maturing OSS ...
SFSCON23 - Mirko Boehm - European regulators cast their eyes on maturing OSS ...South Tyrol Free Software Conference
 
SFSCON23 - Marco Pavanelli - Monitoring the fleet of Sasa with free software
SFSCON23 - Marco Pavanelli - Monitoring the fleet of Sasa with free softwareSFSCON23 - Marco Pavanelli - Monitoring the fleet of Sasa with free software
SFSCON23 - Marco Pavanelli - Monitoring the fleet of Sasa with free softwareSouth Tyrol Free Software Conference
 
SFSCON23 - Marco Cortella - KNOWAGE and AICS for 2030 agenda SDG goals monito...
SFSCON23 - Marco Cortella - KNOWAGE and AICS for 2030 agenda SDG goals monito...SFSCON23 - Marco Cortella - KNOWAGE and AICS for 2030 agenda SDG goals monito...
SFSCON23 - Marco Cortella - KNOWAGE and AICS for 2030 agenda SDG goals monito...South Tyrol Free Software Conference
 
SFSCON23 - Lina Ceballos - Interoperable Europe Act - A real game changer
SFSCON23 - Lina Ceballos - Interoperable Europe Act - A real game changerSFSCON23 - Lina Ceballos - Interoperable Europe Act - A real game changer
SFSCON23 - Lina Ceballos - Interoperable Europe Act - A real game changerSouth Tyrol Free Software Conference
 
SFSCON23 - Johannes Näder Linus Sehn - Let’s monitor implementation of Free S...
SFSCON23 - Johannes Näder Linus Sehn - Let’s monitor implementation of Free S...SFSCON23 - Johannes Näder Linus Sehn - Let’s monitor implementation of Free S...
SFSCON23 - Johannes Näder Linus Sehn - Let’s monitor implementation of Free S...South Tyrol Free Software Conference
 
SFSCON23 - Gabriel Ku Wei Bin - Why Do We Need A Next Generation Internet
SFSCON23 - Gabriel Ku Wei Bin - Why Do We Need A Next Generation InternetSFSCON23 - Gabriel Ku Wei Bin - Why Do We Need A Next Generation Internet
SFSCON23 - Gabriel Ku Wei Bin - Why Do We Need A Next Generation InternetSouth Tyrol Free Software Conference
 
SFSCON23 - Davide Vernassa - Empowering Insights Unveiling the latest innova...
SFSCON23 - Davide Vernassa - Empowering Insights  Unveiling the latest innova...SFSCON23 - Davide Vernassa - Empowering Insights  Unveiling the latest innova...
SFSCON23 - Davide Vernassa - Empowering Insights Unveiling the latest innova...South Tyrol Free Software Conference
 

More from South Tyrol Free Software Conference (20)

SFSCON23 - Rufai Omowunmi Balogun - SMODEX – a Python package for understandi...
SFSCON23 - Rufai Omowunmi Balogun - SMODEX – a Python package for understandi...SFSCON23 - Rufai Omowunmi Balogun - SMODEX – a Python package for understandi...
SFSCON23 - Rufai Omowunmi Balogun - SMODEX – a Python package for understandi...
 
SFSCON23 - Roberto Innocenti - From the design to reality is here the Communi...
SFSCON23 - Roberto Innocenti - From the design to reality is here the Communi...SFSCON23 - Roberto Innocenti - From the design to reality is here the Communi...
SFSCON23 - Roberto Innocenti - From the design to reality is here the Communi...
 
SFSCON23 - Martin Rabanser - Real-time aeroplane tracking and the Open Data Hub
SFSCON23 - Martin Rabanser - Real-time aeroplane tracking and the Open Data HubSFSCON23 - Martin Rabanser - Real-time aeroplane tracking and the Open Data Hub
SFSCON23 - Martin Rabanser - Real-time aeroplane tracking and the Open Data Hub
 
SFSCON23 - Marianna d'Atri Enrico Zanardo - How can Blockchain technologies i...
SFSCON23 - Marianna d'Atri Enrico Zanardo - How can Blockchain technologies i...SFSCON23 - Marianna d'Atri Enrico Zanardo - How can Blockchain technologies i...
SFSCON23 - Marianna d'Atri Enrico Zanardo - How can Blockchain technologies i...
 
SFSCON23 - Lucas Lasota - The Future of Connectivity, Open Internet and Human...
SFSCON23 - Lucas Lasota - The Future of Connectivity, Open Internet and Human...SFSCON23 - Lucas Lasota - The Future of Connectivity, Open Internet and Human...
SFSCON23 - Lucas Lasota - The Future of Connectivity, Open Internet and Human...
 
SFSCON23 - Giovanni Giannotta - Intelligent Decision Support System for trace...
SFSCON23 - Giovanni Giannotta - Intelligent Decision Support System for trace...SFSCON23 - Giovanni Giannotta - Intelligent Decision Support System for trace...
SFSCON23 - Giovanni Giannotta - Intelligent Decision Support System for trace...
 
SFSCON23 - Elena Maines - Embracing CI/CD workflows for building ETL pipelines
SFSCON23 - Elena Maines - Embracing CI/CD workflows for building ETL pipelinesSFSCON23 - Elena Maines - Embracing CI/CD workflows for building ETL pipelines
SFSCON23 - Elena Maines - Embracing CI/CD workflows for building ETL pipelines
 
SFSCON23 - Christian Busse - Free Software and Open Science
SFSCON23 - Christian Busse - Free Software and Open ScienceSFSCON23 - Christian Busse - Free Software and Open Science
SFSCON23 - Christian Busse - Free Software and Open Science
 
SFSCON23 - Charles H. Schulz - Why open digital infrastructure matters
SFSCON23 - Charles H. Schulz - Why open digital infrastructure mattersSFSCON23 - Charles H. Schulz - Why open digital infrastructure matters
SFSCON23 - Charles H. Schulz - Why open digital infrastructure matters
 
SFSCON23 - Andrea Vianello - Achieving FAIRness with EDP-portal
SFSCON23 - Andrea Vianello - Achieving FAIRness with EDP-portalSFSCON23 - Andrea Vianello - Achieving FAIRness with EDP-portal
SFSCON23 - Andrea Vianello - Achieving FAIRness with EDP-portal
 
SFSCON23 - Thomas Aichner - How IoT and AI are revolutionizing Mass Customiza...
SFSCON23 - Thomas Aichner - How IoT and AI are revolutionizing Mass Customiza...SFSCON23 - Thomas Aichner - How IoT and AI are revolutionizing Mass Customiza...
SFSCON23 - Thomas Aichner - How IoT and AI are revolutionizing Mass Customiza...
 
SFSCON23 - Stefan Mutschlechner - Smart Werke Meran
SFSCON23 - Stefan Mutschlechner - Smart Werke MeranSFSCON23 - Stefan Mutschlechner - Smart Werke Meran
SFSCON23 - Stefan Mutschlechner - Smart Werke Meran
 
SFSCON23 - Mirko Boehm - European regulators cast their eyes on maturing OSS ...
SFSCON23 - Mirko Boehm - European regulators cast their eyes on maturing OSS ...SFSCON23 - Mirko Boehm - European regulators cast their eyes on maturing OSS ...
SFSCON23 - Mirko Boehm - European regulators cast their eyes on maturing OSS ...
 
SFSCON23 - Marco Pavanelli - Monitoring the fleet of Sasa with free software
SFSCON23 - Marco Pavanelli - Monitoring the fleet of Sasa with free softwareSFSCON23 - Marco Pavanelli - Monitoring the fleet of Sasa with free software
SFSCON23 - Marco Pavanelli - Monitoring the fleet of Sasa with free software
 
SFSCON23 - Marco Cortella - KNOWAGE and AICS for 2030 agenda SDG goals monito...
SFSCON23 - Marco Cortella - KNOWAGE and AICS for 2030 agenda SDG goals monito...SFSCON23 - Marco Cortella - KNOWAGE and AICS for 2030 agenda SDG goals monito...
SFSCON23 - Marco Cortella - KNOWAGE and AICS for 2030 agenda SDG goals monito...
 
SFSCON23 - Lina Ceballos - Interoperable Europe Act - A real game changer
SFSCON23 - Lina Ceballos - Interoperable Europe Act - A real game changerSFSCON23 - Lina Ceballos - Interoperable Europe Act - A real game changer
SFSCON23 - Lina Ceballos - Interoperable Europe Act - A real game changer
 
SFSCON23 - Johannes Näder Linus Sehn - Let’s monitor implementation of Free S...
SFSCON23 - Johannes Näder Linus Sehn - Let’s monitor implementation of Free S...SFSCON23 - Johannes Näder Linus Sehn - Let’s monitor implementation of Free S...
SFSCON23 - Johannes Näder Linus Sehn - Let’s monitor implementation of Free S...
 
SFSCON23 - Gabriel Ku Wei Bin - Why Do We Need A Next Generation Internet
SFSCON23 - Gabriel Ku Wei Bin - Why Do We Need A Next Generation InternetSFSCON23 - Gabriel Ku Wei Bin - Why Do We Need A Next Generation Internet
SFSCON23 - Gabriel Ku Wei Bin - Why Do We Need A Next Generation Internet
 
SFSCON23 - Edoardo Scepi - The Brand-New Version of IGis Maps
SFSCON23 - Edoardo Scepi - The Brand-New Version of IGis MapsSFSCON23 - Edoardo Scepi - The Brand-New Version of IGis Maps
SFSCON23 - Edoardo Scepi - The Brand-New Version of IGis Maps
 
SFSCON23 - Davide Vernassa - Empowering Insights Unveiling the latest innova...
SFSCON23 - Davide Vernassa - Empowering Insights  Unveiling the latest innova...SFSCON23 - Davide Vernassa - Empowering Insights  Unveiling the latest innova...
SFSCON23 - Davide Vernassa - Empowering Insights Unveiling the latest innova...
 

Recently uploaded

How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 

Recently uploaded (20)

How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 

SFScon 2020 - Nikola Milisavljevic - BASE - Python REST API framework

  • 2. What is BASE? - BASE3 is a Python web framework based on Tornado asynchronous networking library, developed by Digital Cube team for internal use. It is also available to the open source community to use and contribute to the project. - We noticed we needed to write a lot of boilerplate code to start working on our applications - Solution: create a BASE framework - BASE principles: - Implementation of code reusability for common operations (user management, registration, email sending, PDF generation) - Simple to use and get going - Great for onboarding new programmers (with and without Python experience) - Scalability and microservices
  • 3. BASE / main features - Methods and recipes for making REST API based application - Bundled Python tools for a seamless start - Python decorators for code reusability and common functionalities - Authentication using different identity providers (Google, Facebook…) - Tool for generating source code templates - Auto-generation of API specification - Flexibility in the scale and purpose of the application (small, template driven websites to complex async microservice application) - Education
  • 4. Main goals - Making of REST APIs with focus on business and underlying logic rather than the tools themselves - Reduction of the amount of effort needed to bootstrap - Microservice organized architecture with common microservices already written and maintained for current and future projects - Automatic parameter validation with using Models as the schema - Test Driven Development - Use of template engines for simple server-side rendered websites
  • 5. Common services - Implementation and maintenance of common microservices to encourage code reuse: - Users / Authentication https://github.com/digital-cube/base3service-users.git - Sending emails https://github.com/digital-cube/base3service-mailer.git - PDF generator - Multitenancy - Blog
  • 6. Technologies - Python 3.x - tornadoweb (web framework and asynchronous networking library) - Database: - Currently implemented PostgreSQL using SQLAlchemy ORM, but also other popular open source RDBMS will be supported soon - CRUD implementation in API calls (with the use of Models as types) - Reduction of the amount of duplicated code for simple CRUD operations - Redis - Docker
  • 7. Implemented decorators - @route - decorate Handler class and define route where methods can be reachable - @api - decorate a method to process input arguments, fetching models - @auth - decorate a method to allow only authorized users to access
  • 8. Handling input parameters - Input parameters can be passed through URI or Request Body, both of them are read as parameters in the Handler class - With Python typing, we can automatically check and validate parameters - Currently supported types are str, int, bool, float - Also any defined database Model can be considered as a type - For storing Models in Database, use the Model type - For fetching Models from database use Id attribute of Model - Parameters can be mandatory or optional - For optional parameters set the default value for this parameter - None can be used as default value as well
  • 9. Models as Types import base import models @base.route("/") class RegisterUserHandler(base.Base): @base.api() async def post(self, user: models.User): self.orm_session.add(user) self.orm_session.commit() return {"id": user.id}, base.http.status.CREATED if __name__ == "__main__": base.run()
  • 10. Models as Types import base import models import lookup.permissions as perm @base.route("/:id_user") class SingleUserHandler(base.Base): @base.auth(permissions=perm.ADMIN) @base.api() async def get(self, user: models.User.id): return {"user": user.serialize()} if __name__ == "__main__": base.run()
  • 11. Handling responses - Since the main goal of BASE is to build a REST API, default response headers are application/json, but also any other output can be sent (HTML, text or binary) - To provide the result, just return an object which can be serialized into JSON (dict, list, string) and this object will be returned to the caller - Default status code is HTTP code 200 OK, but any other code can be specified as a second parameter, for example, if you want to return 201 (Created) write: - return {“id”: obj.id}, http.status.CREATED - If the method returns None, or if there is no return statement, the default status code will be 204 (No Content)
  • 12. Handling exceptions and errors - Errors, like any other response, can be sent back using a return statement with one of 4XX response code (NOT_FOUND, UNAUTHORIZED, BAD_REQUEST, …) - We can throw an exception which will be caught in the @api decorator and immediately the API call will return an error with an error message and id_message (for translation purposes) - These errors cascade all the way back to the initial service in the case of calls requiring multiple services
  • 13. Inter Process Communication (IPC) - Services communicate with each other by using our IPC method - Complex request chains are handled by cascading requests onto different services (if needed) - Allows services to have separation of concerns and communicate between themselves for sharing data and logic - In BASE we share business logic and data between services through using REST APIs of the services themselves - Currently AsyncHTTP request is the only supported method for IPC, and we are planning to introduce other methods and ways
  • 14. Concurrency and bottleneck optimization - We recommend the use of async/await methods to avoid blocking service by multiple requests - BASE supports threading coroutine mechanism which will process API calls in multiple threads - External workers using message queuing - Creating multiple instance of the microservice which is a bottleneck
  • 15. Testing - Test Driven Development is one of the key concepts of using this framework - Services can be tested independently by mocking results from other services - Services can be tested all together in a single integration test - For this feature, developer needs to follow additional rules (routes throughout all services should be unique, as well as class name of handler) and additional configuration setup, documented in example
  • 16. Try it (source code) https://base3.dev/examples/hello_world/hello_world.py import base @base.route("/") class IndexHandler(base.Base): @base.api() async def get(self): return {"message": "Hello World"} if __name__ == "__main__": base.run()
  • 17. Try it (using local python3 installation and venv) Open browser and visit http://localhost:9000 mkdir base-demo && cd base-demo python3 -m venv .venv source .venv/bin/activate pip install wheel base3 curl https://base3.dev/examples/hello_world/hello_world.py -o hello_world.py python hello_world.py
  • 18. Try it (using docker / docker-compose) mkdir base-demo && cd base-demo curl https://base3.dev/examples/hello_world/hello_world.py -o hello_world.py curl https://base3.dev/examples/hello_world/docker-compose.yaml -o docker-compose.yaml curl https://base3.dev/examples/hello_world/Dockerfile -o Dockerfile docker-compose up Open browser and visit http://localhost:9000
  • 19. Microservice based example (using docker / docker-compose) git clone https://github.com/digital-cube/base3example-contacts.git cd base3example-contacts docker-compose up Open browser or postman and visit http://localhost:9000 Todo:.. Add more links..
  • 21. Next steps: - CLI - Project configuration - Managing services - Creating service from a pre-existing template - Support for other databases except PostgreSQL - Write more common services - Automatic documentation generator
  • 22. Digital Cube - We have been in business for 5 years and delivered over 30 projects for clients across Europe and North America. - We have collaborated with start-ups, mid-markets, and large enterprises. - Some of our clients include: - Telmekom Networks (South Tyrol, Italy), OOB (Denmark), 3DSystem (USA/Switzerland), Serbian Academy of Sciences and Arts (Serbia)... - We employ experienced developers, designers and engineers with the main goal of providing the best possible products and services - The experience we have gained has enabled us to offer a wide range of software solutions and services that meet the needs of our clients - Our focus is constantly on our clients' business challenges and we provide innovative ideas for them - Our abundant technical expertise is at their disposal around the clock.
  • 23. Digital Cube provide services in: - Advisory: - Product Design - Business Process, Optimisation and Analysis - Engineering: - Web Application Development - Mobile Application Development - Desktop Application Development - Assurance: - Software Testing and Quality Assurance - Technical Support