Skip to content
This repository has been archived by the owner on Oct 10, 2023. It is now read-only.

Latest commit

 

History

History
47 lines (38 loc) · 1.11 KB

README.md

File metadata and controls

47 lines (38 loc) · 1.11 KB

Inventory Management Application Svelte.js + Python Flask

A practical example of a web app using Flask serving a Svelte app, acting as the backend server. The frontend is constructed using Svelte with webpack as the bundler.

Create a virtual environment

# Windows
python -m venv env
# Linux, WSL or macOS
python3 -m venv env

Activate the virtual environment.

# Windows
env/Scripts/activate
# Linux, WSL or macOS
source env/bin/activate

Install the dependencies

pip install -r requirements.txt

Create the database tables

When running this Flask application for the first time, make sure to create the database tables before starting the server (This should only be done once.) This can be done by running the following command:

python create_db.py

Run the following to start the Flask server.

python server.py

Open a new terminal and run the following:

  • cd frontend; then npm install to install the Svelte frontend dependencies.
  • npm run dev to start the Svelte frontend.

Open localhost:8080 in your browser to see the app.