A web scraping and data storage service using FastAPI, SQLModel, and PostgreSQL to extract product data from various supermarket websites and store it in a database.
-
Clone the Repository
Clone the repository to your local machine:
git clone https://github.com/LeanSerra/BackendChallenge.git cd BackendChallenge
-
Create a .env file
Create a .env file in the root directory and provide a PostgreSQL connection string
DATABASE_URL=postgresql://postgres:password@postgres:5432/
-
Make entrypoint.sh executable
chmod +x entrypoint.sh
-
Start Docker containers
docker compose up
-
(Optional) Preload the db with common keywords
chmod +x populate_db.sh ./populate_db.sh
-
(Optional) Run tests
pytest
- After deployment, the API can be accessed locally at
http://localhost:8000
. - Swagger documentation is available at
http://localhost:8000/docs