|
|
In this section, you will find some tips that can be useful for your development.
|
|
|
|
|
|
[[_TOC_]]
|
|
|
|
|
|
---
|
|
|
|
|
|
# Docs
|
|
|
|
|
|
## Backend
|
|
|
|
|
|
* [Django](https://docs.djangoproject.com/en/3.0/)
|
|
|
* [Django REST framework](https://www.django-rest-framework.org/topics/documenting-your-api/)
|
|
|
|
|
|
## Frontend
|
|
|
|
|
|
* [Vuetify 1.5](https://v15.vuetifyjs.com/en/getting-started/quick-start)
|
|
|
|
|
|
## Architecture
|
|
|
|
|
|
* [Docker-compose](https://docs.docker.com/compose/)
|
|
|
* [Kubernetes](https://kubernetes.io/docs/home/)
|
|
|
|
|
|
---
|
|
|
|
|
|
# Backend
|
|
|
|
|
|
## Profiling code in backend
|
|
|
|
|
|
You can use the `@profile` decorator that write profile to the chosen path:
|
|
|
|
|
|
```python
|
|
|
from metagenedb.common.utils.profiling import profile
|
|
|
|
|
|
@profile("/my/file/path")
|
|
|
def my_function(a, b, c):
|
|
|
...
|
|
|
```
|
|
|
|
|
|
> **Note**: If you are running the backend on a docker, the architecture is different from your local architecture. Keep in mind that the `backend/` folder is mounted in docker and corresponds to the path `/code` in your docker image. In my case, I created a `backend/debugging/` directory and I write output files to `/code/debugging/my_file.prof` while profiling the code.
|
|
|
|
|
|
It will output a profile file that can be visualized using `snakeviz`:
|
|
|
|
|
|
```bash
|
|
|
snakeviz /my/file/path
|
|
|
``` |