Fasapi project: form template finder
Stack:
- Python
- FastAPI
- MongoDB
- Docker
- Docker-compose
-
Clone the repository
git clone [email protected]:Dzigr/form-template-finder && cd form-template-finder
-
Initiate configuration with Makefile command
make prepare
This will create .env file with necessary variables, requirements file and build docker containers
-
Run application by
make start
Without poetry
- Create virtual environment
python3 -m venv venv
- Activate virtual environment
source venv/bin/activate
- Install requirements via pip
pip install -r requirements.txt
- Run docker-compose
docker-compose up --build
- Run tests by
make test
GET /api/ping/ - ping api service
POST /api/get_form/ - receive the query with data
Request example
f_name1=value1&f_name2=value2
Response example
If form found in database return form template name:
"FormName"
Otherwise return initial data with serialized fields:
{
"f_name1": FIELD_TYPE,
"f_name2": FIELD_TYPE
}
- Clear docker containers
make clear