You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The directive source expects a Postgres connection string in `DB_URL`. You can use any Postgres instance, but for local development we recommend the provided Docker setup. Spin up the container and seed the database with sample data:
29
+
30
+
```bash
31
+
poe db-reset
32
+
```
33
+
34
+
If you have your dev database running without docker, you can still use the seeding command to create the `history` table and load the sample data:
35
+
36
+
```bash
37
+
poe db-seed
38
+
```
39
+
40
+
### 4. Enable your modules
26
41
27
42
Open `main.py` and add the modules you need (tariff, production, …).
28
43
See [cofy-api README](https://github.com/EnergieID/cofy-api) for all available modules & options.
29
44
30
-
### 4. Run the dev server
45
+
### 5. Run the dev server
31
46
32
47
```bash
33
48
poe dev # starts FastAPI with auto-reload, reads .env
@@ -36,7 +51,7 @@ poe dev # starts FastAPI with auto-reload, reads .env
36
51
The API is now available at `http://localhost:8000`.
37
52
Health-check: `GET /health`
38
53
39
-
### 5. Run a production-like container locally
54
+
### 6. Run a production-like container locally
40
55
41
56
```bash
42
57
poe prod # builds the Docker image and runs it on port 8080
@@ -65,6 +80,15 @@ Every commit will automatically run:
65
80
66
81
You can also run them manually at any time.
67
82
83
+
### Local database workflow
84
+
85
+
```bash
86
+
poe db-up # start the local postgres container
87
+
poe db-seed # recreate the history table and load db/dev-seed.csv
0 commit comments