Skip to content

markbaaijens/web-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

88 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

web-demo

Demo for web-app, 3-tier. The rest-api written in flask/python. The API has several data-models to choose from, including flatfile, sqlite, mysql, etc.

Requirements

OS:

  • python3
  • sqlite3 (apt install sqlite3)

Python packages

  • pip3 install -r requirements.txt

Configuration

Choose the desired data-model

  • comment or uncomment in api/logic.py the desired model

Create sqlite database (optional)

  • $ cd api/data/sqlite
  • $ chmod +x createdb.sh
  • $ ./createdb.sh
  • (database 'data.db' is created in api/data)

Create MySQL database (optional)

  • (setup a mysql-server with a admin-user)
  • $ cd api/data/mysql
  • (modify createdb.sh: replace server, user_name and password)
  • $ chmod +x createdb.sh
  • $ ./createdb.sh
  • (database 'data' is created on the mysql-server)

Run application

Start API

  • cd api
  • python3 controller.py => localhost:5000

Start webserver:

  • cd web/flask
  • python3 controller.py => (browser) localhost:5001

Documentation

About

Demo for web-app; 3-tier; rest-api written in flask/python

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published