AcidWatch is a portal for tools that calculate and predict chemical reactions in CO2 streams. It is essential for advancing and scaling carbon capture and storage (CCS) technologies. The goal of AcidWatch is to democratize and open up the discussion around CO2 impurities and provide a reliable resource for researchers, chemists, and industry professionals in the CCS domain.
The production version of AcidWatch is found at https://acidwatch.radix.equinor.com/ . Some features require an Equinor account with appropriate accesses.
AcidWatch uses Python in the backend and Javascript in the frontend. Additionally, some features require a reasonably up-to-data Java version. Ensure that you have Python 3.11 or later, Poetry, NodeJS and Java (eg. OpenJDK 21).
The backend is written using FastAPI and SQLAlchemy.
Using Poetry, install AcidWatch's backend using the following command:
poetry -C backend installNote
Here, -C backend instructs poetry to enter the backend/ directory before
doing anything. If you enter the backend directory (eg. via cd backend), you
can drop writing -C backend for each command.
Then, run the backend in development mode using the following command:
poetry -C backend run acidwatch-apiTo change the settings, first copy backend/.env.example to backend/.env and
then modify it to suit your needs.
To install and run a production build of the backend, refer to the backend Dockerfile.
Explore the auto-generated REST API at http://localhost:8001/docs
By default, AcidWatch uses an in-memory SQLite database. It requires no additional installation or setup, but will reset whenever the backend is restarted.
To enable a persistent SQLite database, set ACIDWATCH_DATABASE in
backend/.env file. For example, adding the following will create a test.db
file in the directory from which acidwatch-api is ran:
ACIDWATCH_DATABASE=sqlite:///test.dbTip
Database migration aren't applied to SQLite. If mysterious database errors occur, delete your database file and restart.
AcidWatch uses a PostgreSQL database in production. Once you have access
First, ensure that the backend is installed with the pg (PostgreSQL) optional
dependency group. This installs the recommended SQLAlchemy driver:
poetry -C backend install -E pgThen, set the ACIDWATCH_DATABASE as described in the SQLite section to the following:
# Over TCP/IP
ACIDWATCH_DATABASE=postgres://[username]:[password]@[hostname]:[port]/[database]
# Over UNIX sockets
ACIDWATCH_DATABASE=postgres:///[database]?host=[path]
# For example:
ACIDWATCH_DATABASE=postgres://postgres:password@localhost:5432/acidwatchAcidWatch uses SQLAlchemy's Alembic to handle migrations. Run poetry -C backend run alembic migrate head to migrate the database to the current schema.
For other databases, refer to SQLAlchemy documentation on how to create
The frontend uses Vite and React. Components are provided by the official Equinor Design System React library.
# Copy the .env file
cp frontend/.env.example frontend/.env
# then install
npm -C frontend installTo run, ensure that the backend is running on port 8001 and then:
npm -C run devThe application is now available at http://localhost:5173
If using VS Code it is recommended to run backend in a different instances of VS Code. This will avoid a lot of hazzle configuring and running correct python virtual environment etc.
GitHub Actions Workflows are used for building, testing and deploying AcidWatch to Radix.
Tests are run on every push, and deployment to dev environment are done on merge to main branch.
Deployment to test and prod environment are for now done manually in Radix console.
If someone fancies using codespaces and wants to break out of the tedious local setup then following steps can be followed.
Open a terminal and write following commands to run frontend.
cd /frontend
npm run devOpen another terminal and write following commands to enable virtual environment and then to run backend.
source venv/bin/activate .
python3 backend/src/acidwatch_api/__main__.pyKudos! Now frontend is running on port 5173, and backend is on 8001. Toggle the port for backend only to be public so its accessible by frontend.
Now open source models can be run and tested. To point to a different instance of deployment (dev, prod or local) install-dependencies.sh can be updated.