Skip to content

bbcCorp/WebInABottle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Web in a Bottle

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.

  1. 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.

  2. 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.

  3. A nearly complete user registration and login mechanism implemented using bottle-cork. Just plug in SMTP server configuration to get user registration emails.

Dependencies

It uses the following framework/packages/library


Application Setup

  • 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

Running the apiServer

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


How to run the application server

$ python web/app.wsgi

This starts standalone WSGI server that is listening to port 1337

Point your browser to localhost:1337


About

A simple boilerplate web app using Python Bottle framework

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages