@@ -25,7 +25,7 @@ The backend is written using FastAPI and SQLAlchemy.
2525
2626Using Poetry, install AcidWatch's backend using the following command:
2727
28- ``` sh
28+ ``` sh
2929poetry -C backend install
3030```
3131
@@ -36,7 +36,7 @@ poetry -C backend install
3636
3737Then, run the backend in development mode using the following command:
3838
39- ``` sh
39+ ``` sh
4040poetry -C backend run acidwatch-api
4141```
4242
@@ -49,6 +49,7 @@ Dockerfile](./backend/Dockerfile).
4949Explore the auto-generated REST API at http://localhost:8001/docs
5050
5151#### SQLite
52+
5253By default, AcidWatch uses an in-memory SQLite database. It requires no
5354additional installation or setup, but will reset whenever the backend is
5455restarted.
@@ -57,7 +58,7 @@ To enable a persistent SQLite database, set `ACIDWATCH_DATABASE` in
5758` backend/.env ` file. For example, adding the following will create a ` test.db `
5859file in the directory from which ` acidwatch-api ` is ran:
5960
60- ``` sh
61+ ``` sh
6162ACIDWATCH_DATABASE=sqlite:///test.db
6263```
6364
@@ -66,26 +67,27 @@ ACIDWATCH_DATABASE=sqlite:///test.db
6667> occur, delete your database file and restart.
6768
6869#### PostgreSQL
69- AcidWatch uses a PostgreSQL database in production. Once you have access
70+
71+ AcidWatch uses a PostgreSQL database in production. Once you have access
7072
7173First, ensure that the backend is installed with the ` pg ` (PostgreSQL) optional
7274dependency group. This installs the recommended SQLAlchemy driver:
7375
74- ``` sh
76+ ``` sh
7577poetry -C backend install -E pg
7678```
7779
7880Then, set the ` ACIDWATCH_DATABASE ` as described in the [ SQLite section] ( #SQLite ) to the following:
7981
80- ``` sh
82+ ``` sh
8183# Over TCP/IP
82- ACIDWATCH_DATABASE=postgres ://[username]:[password]@[hostname]:[port]/[database]
84+ ACIDWATCH_DATABASE=postgresql ://[username]:[password]@[hostname]:[port]/[database]
8385
8486# Over UNIX sockets
85- ACIDWATCH_DATABASE=postgres :///[database]? host=[path]
87+ ACIDWATCH_DATABASE=postgresql :///[database]? host=[path]
8688
8789# For example:
88- ACIDWATCH_DATABASE=postgres ://postgres:password@localhost:5432/acidwatch
90+ ACIDWATCH_DATABASE=postgresql ://postgres:password@localhost:5432/acidwatch
8991```
9092
9193AcidWatch uses SQLAlchemy's Alembic to handle migrations. Run `poetry -C backend
@@ -100,8 +102,7 @@ For other databases, refer to SQLAlchemy documentation on how to create
100102The frontend uses Vite and React. Components are provided by the official
101103[ Equinor Design System] ( https://eds.equinor.com ) React library.
102104
103-
104- ``` sh
105+ ``` sh
105106# Copy the .env file
106107cp frontend/.env.example frontend/.env
107108
@@ -111,7 +112,7 @@ npm -C frontend install
111112
112113To run, ensure that the backend is running on port 8001 and then:
113114
114- ``` sh
115+ ``` sh
115116npm -C run dev
116117```
117118
@@ -133,20 +134,20 @@ Deployment to test and prod environment are for now done manually in Radix conso
133134
134135### GitHub Codespaces
135136
136- If someone fancies using codespaces and wants to break out of the tedious local setup then following steps can be followed.
137+ If someone fancies using codespaces and wants to break out of the tedious local setup then following steps can be followed.
137138
138- #### 1. Setup frontend
139+ #### 1. Setup frontend
139140
140- Open a terminal and write following commands to run frontend.
141+ Open a terminal and write following commands to run frontend.
141142
142143``` sh
143144cd /frontend
144145npm run dev
145146```
146147
147- #### 2. Setup backend
148+ #### 2. Setup backend
148149
149- Open another terminal and write following commands to enable virtual environment and then to run backend.
150+ Open another terminal and write following commands to enable virtual environment and then to run backend.
150151
151152``` sh
152153source venv/bin/activate .
@@ -155,8 +156,8 @@ python3 backend/src/acidwatch_api/__main__.py
155156
156157#### 3. Toggle port visibility
157158
158- Kudos! 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.
159+ Kudos! 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.
159160
160161#### 4. Point to a different deployment environment
161162
162- 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.
163+ 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.
0 commit comments