Skip to content

Commit bc11a6b

Browse files
committed
fix forking all branches
fix docker-compose, dockerignore fix remove duplicated section fix README.md
1 parent 6e44ac5 commit bc11a6b

File tree

3 files changed

+73
-31
lines changed

3 files changed

+73
-31
lines changed

README.md

Lines changed: 5 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,17 @@ You've just joined a new team building a dashboard for visualizing financial tra
1414

1515
## Your Mission: A Three-PR Workflow
1616

17-
**Important First Step:** Before you begin, please **fork this repository**. You will work entirely on your own fork, creating pull requests within that repository. **Do not create any pull requests to the original upstream repository.**
17+
**Important First Step:** Before you begin, please **fork this repository** (Make sure you fork all the branches, you will need them).
18+
19+
You will work entirely on your own fork, creating pull requests within that repository. **Do not create any pull requests to the original upstream repository.**
1820

1921
Your work will be organized into three separate pull requests within your own repository. We recommend following these steps in order.
2022

2123
### A Quick Glossary of Branches
2224

2325
* **`main`**: The initial state of the codebase. You will branch from here.
2426
* **`fix-bug-666`**: A simulated PR from a junior developer. This branch contains their work for you to review.
25-
* **`fix/haunted-codebase`**: The branch you will create from `main` to fix the existing technical debt (the N+1 and re-render bugs).
27+
* **`fix/haunted-codebase`**: The branch you will create from `main` to fix the existing technical debt.
2628
* **`feature/transaction-tags-grid`**: The branch you will create from `fix/haunted-codebase` for the new feature (database migration and data grid).
2729

2830

@@ -71,34 +73,6 @@ To address the display bug, I decided to handle filtering directly in the fronte
7173
I used AI tools for minor code refactoring and to generate some boilerplate for the frontend pagination component.
7274
```
7375

74-
### PR #1: The Code Review
75-
76-
Your first task is to act as a mentor and review a "PR" from a junior developer.
77-
78-
1. **Understand the Context:** The junior dev's work is on the `fix-bug-666` branch. On that branch, read the `BUG-666.md` file to understand the original problem.
79-
2. **Open the PR:** In your own repository, open a pull request from `fix-bug-666` to your `main` branch. Use the PR description template below.
80-
3. **Perform the Review:** Go to the "Files Changed" tab of the PR you just created. Leave comments directly on the code, providing a mix of high-level architectural feedback and specific line-by-line notes.
81-
4. **Abandon the PR:** Once your review is complete, **close the pull request without merging.**
82-
83-
#### PR #1 Description Template
84-
```md
85-
### What I Did
86-
This PR fixes the transaction display bug by filtering transactions on the frontend to only show relevant entries. I've also implemented server-side pagination for better performance.
87-
88-
### How to Test
89-
1. Checkout this branch.
90-
2. Run `docker-compose up --build`.
91-
3. Navigate to the frontend at `http://localhost:3000`.
92-
4. Observe that only relevant transactions are displayed.
93-
5. Verify that pagination controls are now active and functional.
94-
95-
### Architectural Decision Record (ADR)
96-
To address the display bug, I decided to handle filtering directly in the frontend component. This approach simplifies the backend and leverages the client's processing power for a snappier user experience. For pagination, I added a new `GET` parameter `page` and `page_size` to the existing `/api/v1/transactions/` endpoint, and updated the frontend to send these parameters.
97-
98-
### AI Usage Summary
99-
I used AI tools for minor code refactoring and to generate some boilerplate for the frontend pagination component.
100-
```
101-
10276
### PR #2: Fixing Technical Debt
10377

10478
Now, it's time to fix the *other* bugs lurking in the `main` branch.
@@ -134,7 +108,7 @@ With the codebase stabilized, you can now build the new feature. This PR will be
134108
The final deliverable is **a link to your forked repository.** When you submit it, we expect to see the following:
135109

136110
* **PR #1 (Code Review):** A **closed** pull request from `fix-bug-666` to `main`, containing your review comments.
137-
* **PR #2 (Bug Fixes):** An **open** pull request from `fix/haunted-codebase` to `main`, containing the fixes for the N+1 and re-render bugs.
111+
* **PR #2 (Bug Fixes):** An **open** pull request from `fix/haunted-codebase` to `main`, containing the fixes.
138112
* **PR #3 (New Feature):** An **open** pull request from `feature/transaction-tags-grid` to `main`, containing the database migration and the new data grid feature. This PR will implicitly include the commits from PR #2 as its base.
139113

140114
### PR Description Template for PRs #2 and #3

docker-compose.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
services:
2+
db:
3+
image: postgres:18.1
4+
volumes:
5+
- postgres_data:/var/lib/postgresql/data/
6+
environment:
7+
POSTGRES_DB: ${DB_NAME}
8+
POSTGRES_USER: ${DB_USER}
9+
POSTGRES_PASSWORD: ${DB_PASSWORD}
10+
PGDATA: /var/lib/postgresql/data/pg18
11+
ports:
12+
- "5432:5432"
13+
healthcheck:
14+
test: ["CMD-SHELL", "pg_isready -U ${DB_USER} -d ${DB_NAME}"]
15+
interval: 5s
16+
timeout: 5s
17+
retries: 5
18+
19+
backend:
20+
build: ./backend
21+
command: bash -c "python /app/seed.py && uvicorn app.main:app --host 0.0.0.0 --port 8000"
22+
volumes:
23+
- ./backend:/app
24+
ports:
25+
- "8000:8000"
26+
environment:
27+
DATABASE_URL: postgresql://${DB_USER}:${DB_PASSWORD}@db:5432/${DB_NAME}
28+
SECRET_KEY: ${SECRET_KEY}
29+
depends_on:
30+
db:
31+
condition: service_healthy
32+
33+
frontend:
34+
build: ./frontend
35+
ports:
36+
- "3000:3000"
37+
volumes:
38+
- ./frontend:/app
39+
- /app/node_modules
40+
depends_on:
41+
- backend
42+
43+
volumes:
44+
postgres_data:

frontend/.dockerignore

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Docker
2+
.dockerignore
3+
Dockerfile
4+
5+
# Git
6+
.git
7+
.gitignore
8+
9+
# Runtime
10+
node_modules
11+
build
12+
dist
13+
.env
14+
.env*.local
15+
16+
# Logs
17+
npm-debug.log*
18+
yarn-debug.log*
19+
yarn-error.log*
20+
21+
# IDEs
22+
.idea
23+
.vscode
24+
*.swp

0 commit comments

Comments
 (0)