Skip to content
/ PWP Public
forked from aemrehu/PWP

Programmable Web Project course work

License

Notifications You must be signed in to change notification settings

Sahe00/PWP

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PWP SPRING 2024

ONLINESTORE API

Group information

Information

Libraries

Onlinestore uses Flask SQLAlchemy's version of SQLite for the database.

Libraries:

  • requests
  • pyside6
  • flasgger
  • flask
  • flask-restful
  • flask-sqlalchemy
  • pytest
  • pytest-coverage
  • jsonschema

How to start

Create virtual environment (optional):

python -m venv .venv
.venv\Scripts\activate.bat

Required libraries can be installed with pip (setup.py):

pip install -e .

Setup database

Only one of the following should be run.

To create an empty database, run this:

python tests/createdatabase.py

To create database with test data, run this:

python tests/createdatabase.py fill

Testing

Run resource and database tests

cd tests

pytest --cov-report term-missing resource_test.py --cov=onlinestore.resources

pytest db_test.py

If tests are failing, try deleting temp.db and database_test.db, then rerun the commands.

Run API and client

Run Flask API

set FLASK_APP=onlinestore
set FLASK_ENV=development
flask run

Run client

cd Client
python main.py

About

Programmable Web Project course work

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%