Microservice allow encript and desencripted text
- Language: Python 3.9.18
- Framework: FastApi
- ODM: mongoengine 0.23.1
challenge_ethics_global/
├── app/
│ ├── __init__.py
│ ├── api/
│ │ ├── __init__.py
│ │ └── v1/
│ │ ├── __init__.py
│ │ ├── serializer.py
│ │ └── views.py
│ │
│ ├── core/
│ │ ├── __init__.py
│ │ ├── constants.py
│ │ ├── exceptions.py
│ │ ├── handlers.py
│ │ ├── helpers.py
│ │ ├── models.py
│ │ ├── process.py
│ │ └── querysets.py
│ │
│ └── meta/
│ ├── __init__.py
│ └── views.py
│
├── config/
│ ├── __init__.py
│ ├── db.py
│ └── urls.py
│
├── docker/
│ ├── docker-compose.yml
│ └── Dockerfile
│
├── README.md
└── requirements.txt
└── .env.example
This is an example of how you may follow instructions on setting up your project locally. To get a local copy up and running follow these simple example steps.
Once you have MongoDB installed, and if you are going to run the project on local, please check that mongo is running in your pc with the next command, or maybe you should validate if you have installed docker and mongo dockerized:
sudo systemctl status mongod
sudo rm -rf /tmp/mongodb-27017.sock
sudo service mongod start
sudo systemctl status mongod
- Install the virtual environment
$ python3 -p python3 venv
Activate the virtual environment with:
$ source venv/bin/activate
- Install project requirements
$ pip3 install -r requirements.txt
Env vars of external service:
ENV VAR | VALUES |
---|---|
MONGO_URI | Mongo URI |
Env vars of external service:
ENV VAR | VALUES |
---|---|
AWS_DEFAULT_REGION | region of configure in you profile AWS e.g. us-west-2 |
AWS_ACCESS_KEY_ID | access key id of you AWS account |
AWS_SECRET_ACCESS_KEY | secret access key in you AWS account |
$ uvicorn config:app --host=0.0.0.0 --port=5000 --reload --log-level=info
flake8 --exclude venv/ --max-line-length 120
or
python -m flake8 --exclude venv/ --max-line-length 120
Execute
coverage run -m pytest
See more in htmlcov/index.html
with your browser
- José Nicolielly - - jcnil