Microservice for user surveys. All user data is validated before being stored in MongoDB database.
- Python
- FastAPI
- Asyncio
- PyMongo
- MongoDB
- Pytest
- Uvicorn
- Docker
- pep8
- flake8
- mypy
- black
- pymarkdown
-
Clone the repository
-
Put
.envfile intofast_surveyfolder with such content:# API DATABASE_URL=mongodb://user:password@mongo:27017/ DATABASE_URL_TEST=mongodb://user:password@localhost:27017/ # MONGO MONGO_INITDB_ROOT_USERNAME=user MONGO_INITDB_ROOT_PASSWORD=password # ME ME_CONFIG_BASICAUTH_USERNAME=user ME_CONFIG_BASICAUTH_PASSWORD=password ME_CONFIG_MONGODB_URL=mongodb://user:password@mongo:27017/
-
From the root folder run:
docker compose up
-
API Documentation -
http://localhost:8000/docs -
To run
pytesttests activate virtual environment and install dependencies fromfast_survey/requirements.txt