Sample project using flask and vue.js ecosystem. It aims to solve a business problem regarding the definition of customizable risk types within the context of an insurance.
It is available a version deployed with Heroku flask-vue .
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
What things you need to install the software.
git
python
A step by step series of examples that tell you have to get a development env running
- Clone the repo:
git clone https://github.com/antomor/flask-vue.git
- Go into the directory which just cloned the repository in:
cd flask-vue
- Install the back-end dependencies
pip install -r requirements.txt
- Move into the client app directory
cd app/client/app
- Install the front-end dependencies
npm install
- Build the front-end app
- in development-mode
npm run dev
- in production mode
npm run build
Important: In order to let the client app to point to the right backend API, check the URL set in the backend.js
file.
- Move back to the root project directory
cd ../../../
- Database: it has to be generated
python manage.py db upgrade
It can be also filled with an initial set of data:
python manage.py seed
For any change it can be upgraded with:
python manage.py db migrate
and
python manage.py db upgrade
The default location of the database is /tmp/flask-vue.db
, but it can be easily changed by setting the environment variable SQLALCHEMY_DATABASE_URI
Here an ER diagram of the data model.
- Run the application
python run.py (or flask run)
- See the application in the browser
127.0.0.1:5000
Explain how to run the automated tests for this system.
The repository contains test for the api and for the front-end part.
- API tests
python test_api.py
- Front-end Unit tests
No unit test configured at the moment.
- E2E tests
No e2e tests configured at the moment.
Add additional notes about how to deploy this on a live system
- flask - The web framework used
- vue.js - Dependency Management
- flask-SQLAlchemy - flask extension to add support for SQLAlchemy (ORM)
- Antonio Morrone - Antomor
This project is licensed under the MIT License - see the LICENSE.md file for details
- BriteCore