Skip to content

Commit 0f3e897

Browse files
authored
Revise README for clarity and updated commands
Updated README to clarify Docker usage and ETL steps.
1 parent 5638c75 commit 0f3e897

1 file changed

Lines changed: 26 additions & 29 deletions

File tree

README.md

Lines changed: 26 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ This repository is a monorepo containing three main components:
1010
- `frontend/`: A React/TypeScript frontend built with Vite.
1111
- `backend/`: A Node.js/TypeScript backend using Express and Prisma.
1212
- `etl/`: A Go application responsible for extracting, transforming, and loading the voting data into the database.
13-
- `docker-compose.yml`: Defines the services for the application, including the PostgreSQL database.
13+
- `docker-compose.yml`: Defines the services for the application, which for now is only the PostgreSQL database.
1414

1515
## Development Setup
1616

@@ -25,7 +25,13 @@ This repository is a monorepo containing three main components:
2525
The application requires a PostgreSQL database. You can start one using Docker Compose:
2626

2727
```bash
28-
docker-compose up -d
28+
docker compose up -d
29+
```
30+
31+
or Podman
32+
33+
```bash
34+
podman compose up -d
2935
```
3036

3137
This will start a PostgreSQL server and expose it on port 5432.
@@ -38,54 +44,45 @@ The `etl` service fetches and processes parliamentary data.
3844
```bash
3945
cd etl
4046
```
41-
2. Run the ETL process:
47+
2. On the first run, seed the database:
48+
```bash
49+
go run cmd/manage_categories/main.go --action=seed
50+
```
51+
3. Run the ETL process:
4252
```bash
4353
go run cmd/etl/main.go
4454
```
45-
This will populate the database with the necessary data. The database connection is configured in `etl/configs/config.yaml`.
4655

4756
### 3. Run the Application
4857

49-
The `app` is split into a backend and a frontend, which must be run separately for development.
58+
The `app` is split into a backend and a frontend, which are separately for development.
5059

51-
#### Backend
60+
### App
5261

53-
1. Navigate to the backend directory:
62+
1. Navigate to the app directory:
5463
```bash
55-
cd app/backend
64+
cd app
5665
```
5766
2. Install dependencies:
5867
```bash
5968
npm install
6069
```
6170
3. Set up your environment variables:
6271
```bash
63-
cp .env.example .env
72+
cd backend; cp .env.example .env; cd ../frontend; cp .env.example .env; cd ..
6473
```
65-
Ensure the `DATABASE_URL` in the new `.env` file is correctly configured for your environment.
66-
4. Start the backend development server:
74+
Ensure the `DATABASE_URL` in the new `.env` file is correctly configured for your environment.
75+
4. Run migration in the backend:
6776
```bash
68-
npm run dev
77+
cd backend; npx prisma migrate dev
6978
```
70-
The backend will be running on `http://localhost:3001`.
71-
72-
#### Frontend
73-
74-
1. Navigate to the frontend directory:
79+
5. Generate prisma types:
7580
```bash
76-
cd app/frontend
81+
npx prisma generate
7782
```
78-
2. Install dependencies:
79-
```bash
80-
npm install
81-
```
82-
3. Set up your environment variables:
83-
```bash
84-
cp .env.example .env
85-
```
86-
The default `VITE_API_URL` should point to the backend at `http://localhost:3001`.
87-
4. Start the frontend development server:
83+
6. Start the app server:
8884
```bash
89-
npm run dev
85+
cd -; npm run dev
9086
```
87+
The backend will be running on `http://localhost:3001`.
9188
The frontend will be accessible at `http://localhost:3000`.

0 commit comments

Comments
 (0)