- Open root folder
- Run "python3 -m venv venv"
- Run "source venv/bin/activate"
- Run "pip install -r requirements.txt"
- Run "flask run"
If you facing anyproblem while running app you can contact me : [email protected]
caycomtech-task Web App sends request to caycomtech-task API and renders responses.
redirects /login if no jwt. redirects /customer if jwt exists.
kills session and jwt. redirects /login.
login page.
starts jwt session with successful login.
show all customers in a table.
** jwt required route **
show a customer on a table row by id.
** jwt required route **
update a customer by id.
** jwt required route **
delete a customer by id. ** jwt required route **
returns 404 with message.
All API points except register/login needs Bearer token.
Sample user information for testing
{
"name":"caycom",
"surname":"caycom",
"email":"caycom",
"password":"caycom",
"phone_number":"caycom",
"identification_number": "caycom"
}
All api points are listed:
- /customers : JWT Authorization needed route. List Customers.
- /customers/int:customer_id : JWT Authorization needed route. Show customer by given id in route parameter.
- /register : Register user.
- /login : Login user. Returns a token.
Sample request body for this route
{
"email":"caycom",
"password":"caycom",
}
- /customers/int:customer_id : JWT Authorization needed route. Patch user by given parameters.
- /customers/int:customer_id : JWT Authorization needed route. Deletes user by id.
End of routes.
- INCLUDES UNIT TESTS: /app/tests/test
- SqlAlchemy Test Cases
- Unauthorized Access Test Cases
- Register Test Cases
- Login Test Cases
- Authorized Access Test Cases
From root base terminal run nose2 command to run tests.
- INCLUDES LOGGING: /demo.log
eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE2MDM1NDk3NTcsIm5iZiI6MTYwMzU0OTc1NywianRpIjoiZGQ3OTA3ZmUtOTcyZi00MDI0LWE2M2MtMGQwZDVmMjllYzhlIiwiZXhwIjoxNjA0MTU0NTU3LCJpZGVudGl0eSI6IjEiLCJmcmVzaCI6ZmFsc2UsInR5cGUiOiJhY2Nlc3MifQ.0tdDXse9cj7dAcS_L2OGdC3gMyNZ_Z6TaRixCKDTm5E