Application to assist with bi-weekly budget planning and execution
All required Python libraries can be installed by leveraging the included requirements.txt file.
sudo pip install -r requirements.txt
Run newrelic-admin run-program python runserver.py
funtional_test.py Selenium -requires https://code.google.com/p/selenium/wiki/ChromeDriver Using ChromeDriver -Robert python functional_test.py
Ref. 1: https://www.digitalocean.com/community/tutorials/docker-explained-how-to-containerize-python-web-applications Ref. 2: https://www.digitalocean.com/community/tutorials/how-to-serve-flask-applications-with-uwsgi-and-nginx-on-ubuntu-14-04 Ref. 3: https://medium.com/@rodkey/deploying-a-flask-application-on-aws-a72daba6bb80
-
Setup the application to use uWSGI and talk with Nginx
Rebuild the Docker image process
- log in to docker base
Docker Cleaners
Containers
docker stop
docker run -d -p 80:80 -i -t --name web -v /src/webapp:/opt/webapp training/webapp python app.py
Deploying.
- SSH into Dockerbase
- Build a new Docker container
- sudo docker build --rm -t 2weeks --no-cache .
- Run the container
- sudo docker run --name 2weeks_cnt -p 80:80 -i -t 2weeks:latest
5a. Check container sudo docker run -t -i 2weeks:latest /bin/bash
Setup of Webservice Use Docker offical Nginx Docker Image
- docker run --name mynginx1 -P -d nginx
Nginx
sudo apt-get install apparmor lxc cgroup-lite sudo usermod -aG docker ${USER}
The 2Weeks API was built based upon the jsonapi.org specification.
All routes start with /api/
Each Database object supports the following methods
Method: GET
Route: /api/object
Optional URL Parameters: Provide optional Key/Value pairs for search strings
Method: GET
Route: /api/object/:ObjectId
Optional URL Parameters: objectId
Method: POST
Route: /api/object
Accept either application/x-www-form-urlencoded or application/json
Method: PUT
Route: /api/object/:ObjectId
Optional URL Parameters: objectId
Accept either application/x-www-form-urlencoded or application/json
Method: DELETE
Route: /api/object/:ObjectId
Base URL Parameters: objectId
Optional URL Parameters: objectId
{
"data": [
{
"amount": "100.0",
"average_amount": "None",
"date_created": null,
"description": "Wachovia",
"id": 1,
"last_updated": null,
"name": "Wachovia",
"next_due_date": null,
"payment_method": null,
"payment_type_ind": null,
"recurrance": null,
"recurring_flag": null,
"type": "bills",
"user_id": 4
}
],
"meta": [
{
"authors": [
"David Larrimore",
"Robert Donovan"
],
"copyright": "Copyright 2015 MixFin LLC.",
"version": "0.1"
}
]
}
{
"data": null,
"error": "Username or password incorrect",
"meta": [
{
"authors": [
"David Larrimore",
"Robert Donovan"
],
"copyright": "Copyright 2015 MixFin LLC.",
"version": "0.1"
}
]
}
{
"data": [],
"meta": [
{
"authors": [
"David Larrimore",
"Robert Donovan"
],
"copyright": "Copyright 2015 MixFin LLC.",
"version": "0.1"
}
]
}