https://github.com/crane-cloud/system-status-backend
Application that monitors Crane Cloud services
https://github.com/crane-cloud/system-status-backend
Last synced: 12 months ago
JSON representation
Application that monitors Crane Cloud services
- Host: GitHub
- URL: https://github.com/crane-cloud/system-status-backend
- Owner: crane-cloud
- License: mit
- Created: 2022-07-22T00:00:20.000Z (almost 4 years ago)
- Default Branch: develop
- Last Pushed: 2023-10-18T23:57:36.000Z (over 2 years ago)
- Last Synced: 2023-10-19T00:31:45.613Z (over 2 years ago)
- Language: Python
- Homepage: https://status-api.cranecloud.io
- Size: 68.4 KB
- Stars: 0
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# Crane cloud system status application
This application is aimed to monitor cranecloud applications and services.
## Project Setup
Follow these steps to have a local running copy of the app.
### Clone The Repo
`git clone https://github.com/Mubangizi/flask-rest-api-template.git`
If `master` is not up to date, `git checkout develop`. However, note that code on develop could be having some minor issues to sort.
### Install PostgreSQL
Here's a great resource to check out:
[How To Install and Use PostgreSQL](https://www.digitalocean.com/community/tutorials/how-to-install-and-use-postgresql-on-ubuntu-18-04)
Create a development database and call it `mobile_shop_db`.
### Create a Virtual Environment
create virtual enviroment called venv
Run `virtualenv venv`
### Activate the virtual environment
Run `. venv/bin/activate`
Make sure you have `pip` installed on your machine.
### Install the dependencies
```bash
pip install -r requirements.txt
```
### Create a .env file
Create a `.env` file (which defines the environment variables used) at the root of the app.
Add the following details, customizing as needed.
```bash
export FLASK_APP=server.py
export DATABASE_URI=postgresql:///flask_app_db
export FLASK_APP_SECRET=qY2i691SX2sEuZ7LUjY480RS48mw5qCeUiyV0i0vzmg
export FLASK_ENV=development
export FLASK_RUN_PORT=5000
export CLIENT_BASE_URL=
export BACKEND_BASE_URL=
export MIRA_BACKEND_URL=
export MIRA_FRONTEND_URL=
export REGISTRY_URL=
```
### Run Database migrations
Run migrations for the database. This will create the tables for the models in the database .
`python manage.py db upgrade`
#### Note
If you make changes to the models, you need to create migrations for the changes by running `python manage.py db migrate` and then `python manage.py db upgrade` to add the changes to the database.
### Run Application
Run the application with this command
```bash
flask run
```
### Test the API
Through your browser go to link `localhost:/`.
### Checkout Application Api docs
Through your browser go to link `localhost:/apidocs`.