A web application for tracking time and generating invoices.
The application architecture was designed with one primary goal: scalability. Every component of the application can scale linearly as the application grows. The application contains a web service in Flask with a MongoDB database. The MongoDB updates are streamed into hadoop for BI and batch reporting.
The web service is a Flask application with MongoDB.
The MongoDB event stream is implemented using mongo-connector and a custom DocManager that writes updates to Kafka topics.
The warehouse is implemented on a Hadoop cluster.
- Kafka (includes zookeeper)
- MongoDB
- This repository and its requirements
- Start the MongoDB server:
mongod --config /usr/local/etc/mongod.conf --replSet singleNodeRepl
(for demonstration purposes, I'm using a single node server here) - Enable the MongoDB optlog:
a.
mongo
b.rs.initiate()
- Start zookeeper:
bin/zookeeper-server-start.sh config/zookeeper.properties
- Start kafka:
bin/kafka-server-start.sh config/server.properties
- Create required topics:
bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic activity-app-updates
- Add this repo to your
PYTHONPATH
(if you don't do so, the next line will fail because it won't find thekafka_doc_manager
) - Start the MongoDB optlog tailer:
mongo-connector -m localhost:27017 -t localhost:9092 -d kafka_doc_manager
- Start the web server:
flask manage.py runserver
The API of the web service is documented in the doc folder. It allows you to add users, projects, activities and other data by sending JSON data to the server. The service can even generate an invoice for a given project.