Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alina1412/search_app
Educational FastApi project with elasticsearch
https://github.com/alina1412/search_app
alembic asyncio docker-compose elasticsearch fastapi poetry postgres pytest python sqlalchemy
Last synced: 2 months ago
JSON representation
Educational FastApi project with elasticsearch
- Host: GitHub
- URL: https://github.com/alina1412/search_app
- Owner: alina1412
- Created: 2022-11-18T04:44:03.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2022-12-12T08:53:18.000Z (about 2 years ago)
- Last Synced: 2023-03-11T07:06:31.009Z (almost 2 years ago)
- Topics: alembic, asyncio, docker-compose, elasticsearch, fastapi, poetry, postgres, pytest, python, sqlalchemy
- Language: Python
- Homepage:
- Size: 142 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# search_app
Educational FastApi project with elasticsearch# how to use: will be written soon...
## How to run locally
- put variables into .env (as well as elastic credentials)
- create virtual environment:
>... if using poetry
> - poety install
> - poetry shell>... if using venv
> - python -m venv .venv
> - activate virtual environment
> - pip install -r requirenments.txt- `make build`: builds docker containers, runs it and runs migrations
> first separated scripts:
1. fill_db_from_csv.py
2. first_fill_index.py(for the *task* it fills db with
initial data of a given structure from csv doc, and then creates and fills index from initial db data)
if to run a FastApi app locally: - `make run` (but it can be ran in docker)## Tools
- elasticsearch
- postgres
- alembic
- sqlalchemy
- asyncio
- docker-compose
- makefile
- poetry
- pytest# The Task branch
- the app has two handlers:
- for searching the match of a query with messages in elastic
- for deleting document from db and elastic by id![Clipboard01](https://user-images.githubusercontent.com/8655093/202918040-709cc06c-d10f-427c-84d2-2d180ae005f8.jpg)
# The develop draft branch
- has a separated handlers for creating index in elastic, deleting it, showing all data (for debugging purposes)![Clipboard02](https://user-images.githubusercontent.com/8655093/202918161-97245239-44cc-4976-ae86-a3c70c0bf7af.jpg)