A webapp template that I use for everything - a python/flask backend with a node based HTML/CSS/JS front end
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 and how to install them.
npm
Python 3
docker
A step by step series of examples that tell you how to get a development environment running.
- Clone the repository
git clone https://yourrepositorylink.com
cd your-project-name
- Install JavaScript dependencies
npm install
- Install Python dependencies
First, ensure you have a virtual environment created and activated:
pipenv shell
- Then install the dependencies:
pipenv install Flask
- Build the project
Before serving the project with Flask, you need to build the static files with Parcel:
npm run build
- This command compiles your assets into the dist directory. Serving with Flask
To serve your project using Flask, run:
python app.py
Your project should now be accessible at http://localhost:5000
For development, you can use Parcel's development server for hot reloading of changes:
npm start
And in another terminal, run your Flask application for backend functionality:
python app.py
Clearing the dist directory before builds
To ensure the dist directory is cleared before each build, the prebuild script in package.json is configured to run a clean operation:
"scripts": {
"clean": "rimraf ./dist/*",
"prebuild": "npm run clean",
...
}
Please be nice and polite while submiting PRs - use github to submit the PRs and open issues as requiered.
This project is licensed under the MIT License - see the LICENSE.md file for details
This was mostly done for a huge number of students and personal projects that I make with the Node - Flask - Mongo (Or whatever DB of your choice) Python allows for some really funky ML pipelines that would be impossible in other environments.