In this document we will explain how to setup the project and work with it.
- Set up the Docker environment
- Launch the backend
- Make API calls using Postman
- Launch tests per type (unitary and non=unitary)
Also, we will introduce the ___ documentation we've build for this project
For the implementation we will combine:
- API Model View Controller (MVC) (or MVVM Model View ViewModel)
- Where Views are the endpoints
- HTTP REST, especially
- We also consider HATEOAS, #TODO json:api hyperlink but we will not implement a Level 4 maturity REST API for this prototype
- Domain Driven Design to some degree, it is not advisable to fight the framework architecture, but
we will split some
domain
andinfrastructure
out of the framework artifacts that are bound to be separated in to transversal code - specifications, common constants and libraries
. ├── config: general configuration, Django settings and urls config ├── docs │ └── diagrams ├── fictional: Django project with each context | ├── core │ ├── domain │ ├── infra │ ├── sales │ ├── users │ └── vehicles ├── scripts: scripts to set up the system ├── staticfiles └── tests: Unitary and API test
- Create a virtualenv
- Install the dependencies
pip install -r requirements.txt
- Delete the DB if any
rm db.sqlite
- Apply migrations
make apply-migrations
- Repopulate the database
python manage.py populate
pytest
It should prompt code coverage and test resulta
Simply do:
make run
The server will be available at localhost:8000 in debug mode You can use the available Postman collection and environment at docs/postman/
Further information will be in the folder docs
including:
This being a prototype, it lacks a lot of features that are advisable, both on the architecture and microcode side. To list a few:
-
Add Authenticantion
-
Add Django-Admin, to have a nice backoffice
-
Use a Filter Backend for query_params
-
Add cache
-
Add a JSON:API renderer
Here are the reference I used the most