The WellLog project consists of:
-
A Streamlit application for interacting with well log data
-
A backend with SQLAlchemy models and database logic
-
Alembic migrations for schema management
-
A MySQL database
-
Fully containerized setup via Docker Compose (recommended for all team members)
project-root/
├── app/
│ └── main.py
├── backend/
│ ├── database.py
│ ├── models.py
│ └── __init__.py
├── migrations/
│ ├── env.py
│ ├── alembic.ini
│ └── versions/
├── requirements.txt
├── docker-compose.yml
├── Dockerfile
├── .gitignore
└── README.md
No MySQL installation required. No virtual environment required.
-
Install Docker Desktop:
Run this from the project root:
docker compose up --build
Docker will:
-
Start a MySQL database container
-
Wait for MySQL to become ready
-
Run Alembic migrations automatically
-
Start the Streamlit app on http://localhost:8501
docker compose down
docker compose restart app
This only restarts the Streamlit app container without affecting the database.
MySQL data is stored in a Docker volume so nothing is lost when containers restart.
Only use this method if you prefer managing everything manually.
-
Python 3.11.2 (developed using this version, other versions might work too)
-
MySQL running locally
-
A virtual environment
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
Set your local DATABASE_URL in backend/database.py:
mysql+pymysql://root@localhost/well_log_db
Initialize the database:
alembic upgrade head
Run the app:
streamlit run app/main.py
Alembic migrations are used to create and modify the database schema.
alembic revision --autogenerate -m "description"
alembic upgrade head
If using Docker, migrations run automatically.
The app and Alembic use a unified DATABASE_URL variable.
DATABASE_URL=mysql+pymysql://root:root@db/well_log_db
This is set automatically by docker-compose.yml.
Set it in your shell:
export DATABASE_URL="mysql+pymysql://root@localhost/well_log_db"
-
If running manually, ensure the MySQL server is running
-
Docker resolves this automatically
Ensure migrations/env.py includes:
from backend.models import Base
target_metadata = Base.metadata
Check that DATABASE_URL is correctly set.
-
Do not commit:
-
venv/
-
pycache/
-
MySQL data files
-
-
Do commit:
-
migrations/directory and migration scripts -
All Python source files
-
Docker configuration files
-
-
Create a branch for a feature
-
Make changes
-
Run the project with
docker compose up -
Submit a pull request