Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/braheezy/home-inventory-py-backend
Manage that stuff, yo
https://github.com/braheezy/home-inventory-py-backend
Last synced: 2 days ago
JSON representation
Manage that stuff, yo
- Host: GitHub
- URL: https://github.com/braheezy/home-inventory-py-backend
- Owner: braheezy
- Created: 2020-04-09T01:04:28.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2022-05-25T05:43:27.000Z (over 2 years ago)
- Last Synced: 2024-11-10T13:35:36.614Z (2 months ago)
- Language: Python
- Homepage:
- Size: 1.68 MB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Background
HomeInventoryPy was a hobby project for educational purposes.It's a Flask backend (this project) hosting a REST API. Data is persisted with MongoDB. That isn't really interesting, so I wrote a [React frontend](https://github.com/mbraha/home-inventory-py-frontend) to interact with it. Years later, I came back to this project to see if I could host it on AWS, and of course, automate the whole freakin' thing.
That juicyness can be found [here](https://github.com/mbraha/home-inventory-py-env).Tracking home inventory...it's a stupid idea. But it provided just enough meat to cause interesting design problems. You got Users with Rooms and Stuff in those Rooms that have probably have some Value.
# home-inventory-py-backend
`application.py` is the launch point of the Flask application.
`config.py` is used to configure the Flask applcation.
`resources.py` provides the REST API endpoints for callers to use. It uses `models.py` to interact with our data model (Users, Rooms, Stuff, etc.).
`db.py` is the layer that interacts with the database, currently MongoDB.# Prerequisites
1. \*Nix-like environment. The scripts below are shell scripts.
2. Python 3
To check, `python -V` in a terminal.
3. MongoDB
Install it for your OS: [MongoDB Install Instructions](https://docs.mongodb.com/manual/installation/)
MongoDB must be running at the same `MONGO_URI` used in `config.py` for the application to use the database.
# Install
In the root of the project, run the install script:
`./install.sh`
# Usage
Update `config.py` and `application.py` to use the correct configuration.
To run, simply:
`flask run`
Enjoy!