Create a new user inside psql.
CREATE USER lba WITH password 'a';
And create a new database.
CREATE DATABASE lbaproef;
And grant priviliges.
GRANT ALL PRIVILEGES ON DATABASE lbaproef to lba;
The backend expects postgresql to run on the default localhost port 5432.
Clone this repository.
Create a Python virtual environment inside it.
python3 -m venv ./env
(I used virtualenv).
Activate the env.
source ./env/bin/activate
Upgrade packaging tools (not sure if necessary).
pip install --upgrade pip setuptools
Install the project in editable mode with its testing requirements.
pip install -e ".[testing]"
Configure the database.
initialize_labela_proef_db development.ini
Run the project.
pserve development.ini
/products POST:
{ "name": "autoband", "description": "Is lekker snel", "price": 38.99 }
Test GET /products and GET /products/1
/users POST:
{ "email": "[email protected]", "password": "testen33", "first_name": "Yorin", "last_name": "Osinga", "street": "Duinweg", "house_nr": "125D", "postcode": "1871AH", "city": "Schoorl", "country": "The Netherlands" }
Test GET /users
Order only has models so far.
-finish basic /order routes (create, getAll, getById)
-add authentication for users/admins (add admin as user or seperate entity), I like JWT bearer token.
-add authorization for user/admin routes.
-implement product, user and order update/delete etc.
-improve request validation and error messages.
-tax handling.
-and a lot more things that are requirement specific.. ;)