8000 GitHub - Sixtey7/AGT-Backend
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Sixtey7/AGT-Backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

65 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AGT-Backend

Annual Goal Tracker - Backend

Backend of an annual goal tracking application written in Python using Flask and SQLAlchemy.

Allows a user to create and track goals of things they want to accomplish over the course of the year.

This includes two types of goals:

  • An item in which the item is completed in one fell swoop (Pay off a loan)
  • Items that need to be tracked over the course of the year (e.g. go to the gym 50 times)
    • These can be both positive and negative (e.g. drink less than 50 cans of soda)

Related Projects

AGT-Frontend

Tools Used

Installed the following through pip3

  • flask
  • sqlalchemy
  • flask-sqlalchemy
  • flask-cors

Example Curl Statements

Categories

Add a new

Get All Categories

Get All Categories and children (items and events)

Items

Add a new

  • curl -H "Content-type: application/json" -i -XPOST -d '{"name": "Item 1", "category_id": "800e11e8-da24-4caf-a854-fa0a4efd751e", "item_type": "one_and_done", "current_value":"false", "goal_value": "true", "goal_date":"2020-01-30"}' http://localhost:5000/items/

Events

Add a new

  • curl -H "Content-type: application/json" -i XPOST -d '{"item_id": "25196e2a-1006-4ef3-be7d-0d754c897c1d", "value":"True", "date": "2020-01-25"}' http://localhost:5000/events/

Export/Import

Export All

Import from CSV

Sample Docker Commands

Building

  • docker build -t agt-backend:latest .

Running

  • docker run --name agt-backend -p 5000:5000 -d agt-backend:latest

Running with a static db file

  • docker run --name agt-backend -p 5000:5000 -e DB_LOC=/data/sqlite -v /data/sqlite:/data/sqlite -d agt-backend:latest

Starting postgres

  • docker run --rm --name pg-docker -e POSTGRES_PASSWORD=docker -d -p 5432:5432 -v /data/postgres:/var/lib/postgresql/data postgres

Run backend with raspberrypi postgres

  • docker run --name agt-backend -p 5000:5000 -e DB_TYPE=postgres -e SERVER_URL=raspberrypi -d agt-backend:latest

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0