This is a sample application build to serve as a boilerplate Bottle application. However unlike other sample applications, these goes a extra steps to demostrate how to build a scalable microservice architecture to seperate out various components that would otherwise be closely tied up in a monolithic application.
-
It uses a microservice architecture for its sample api. Web server does not know anything about how the data apis are served and stored. There is an external apiServer which handles that concern. The apiService is built using ZeroMQ and uses a multiprocessor architecture to host the service.
-
The web server connects to the apiServer to get its data. This allows having multiple versions of apiServer running parallelly or swapping out one service with another without affecting the web server.
-
A nearly complete user registration and login mechanism implemented using bottle-cork. Just plug in SMTP server configuration to get user registration emails.
It uses the following framework/packages/library
- Python
- MongoDB and pyMongo (3.4.0)
- ZeroMQ and pyzmq
- Bottle web framework and the SimpleTemplate Engine
- Bootstrap and the Bootswatch Yeti
- jQuery
- FontAwesome
- Bottle-Cork for authentication and authorization
- Make sure the python dependencies and MongoDB is installed. Check out the scripts in the setup directory
- Update the application configuration file: api/appconfig.py
- Update the file setup/authSetup.py with your credentials and execute the script
To start the apiServer use the following command. This will start a ZMQ-based server with 2 worker nodes listening to port 7000
$ python apiServer/runServer.py
$ python web/app.wsgi
This starts standalone WSGI server that is listening to port 1337
Point your browser to localhost:1337