IMDB like movie database application using Python and Flask
This project requires SQLite and Redis. Connect to an instance running on your local machine or use docker.
- Docker: Install Docker
- Clone this repository.
- Navigate to the project directory.
- Create a
.env
file and place all variables required (Refer sample.env) - Create
.flaskenv
file and place all variables required (Refer flaskenv-sample)
- To run locally, follow these steps
- Run
pip install -r requirements.txt
to install dependencies - Run
flask run
to start the application.
- Note: When running the application for the first time, you may need to run migrations. Run the following(no setup necessary)
flask db init
Initialize migrationsflask db migrate
Apply migrationsflask db upgrade
Run migrations- or just run
migrate.sh
script with a message. eg../migrate.sh "First run"
- To run containerised application
- From the project directory, Run
docker compose up --build
- This will automatically install all the requirements and DB.
- To load sample dataset: Hit
/load
endpoint. - To clear all data: Hit
/clear
endpoint.
- To access documentation for the api, access
/docs/v1/swagger-ui
endpoint.