Skip to content

[NO MERGE] add global makefile and docker for services - #32

Open
Kristian228007 wants to merge 2 commits into
mainfrom
front_back_sync
Open

[NO MERGE] add global makefile and docker for services#32
Kristian228007 wants to merge 2 commits into
mainfrom
front_back_sync

Conversation

@Kristian228007

Copy link
Copy Markdown
Collaborator

No description provided.

@qodo-code-review

Copy link
Copy Markdown

Review Summary by Qodo

✨ Enhancement

Grey Divider

Walkthroughs

Description
• Reorganize Makefile with backend path abstraction for monorepo structure
• Add frontend and backend service management commands to Makefile
• Consolidate docker-compose at root level with frontend and backend services
• Create frontend Dockerfile for containerized development environment
• Simplify backend Dockerfile with corrected build context paths
• Add help command documenting all available Makefile targets
Diagram
flowchart LR
  A["Root Makefile"] -->|"abstracts paths"| B["Backend Path Variable"]
  A -->|"manages services"| C["Docker Compose"]
  A -->|"runs commands"| D["Backend Commands"]
  A -->|"runs commands"| E["Frontend Commands"]
  C -->|"builds"| F["Backend Container"]
  C -->|"builds"| G["Frontend Container"]
  C -->|"manages"| H["Database & Swagger"]
  F -->|"uses"| I["Backend Dockerfile"]
  G -->|"uses"| J["Frontend Dockerfile"]
Loading

Grey Divider

File Changes

1. Makefile ⚙️ Configuration changes +58/-7

Restructure Makefile for monorepo with service commands

• Introduce BACKEND_PATH variable to abstract backend directory references throughout Makefile
• Add new docker commands: docker-build and docker-logs for container management
• Add backend service commands: backend-run and backend-build for local development
• Add frontend service commands: frontend-install, frontend-run, and frontend-build
• Update migration commands to execute from backend directory context
• Update protobuf generation to run from backend directory
• Add comprehensive help target documenting all available commands
• Add .PHONY declaration for all targets

Makefile


2. backend/cmd/server/Dockerfile ⚙️ Configuration changes +7/-8

Simplify backend Dockerfile with correct build paths

• Simplify COPY commands by using relative paths from backend context
• Change build command to use ./cmd/server path instead of changing directory
• Update binary copy to reference /app/server from builder stage
• Copy config.yaml from builder stage instead of assuming local presence
• Add EXPOSE directives for ports 7001, 7002, and 8080

backend/cmd/server/Dockerfile


3. backend/docker-compose.yml ⚙️ Configuration changes +0/-51

Remove backend docker-compose in favor of root

• Remove entire docker-compose.yml file from backend directory
• Consolidate all services into root-level docker-compose.yml

backend/docker-compose.yml


View more (3)
4. docker-compose.yml ⚙️ Configuration changes +79/-0

Create consolidated root docker-compose with all services

• Create new root-level docker-compose.yml consolidating all services
• Add backend service with build context pointing to ./backend
• Add frontend service with build context pointing to ./wb_front
• Configure frontend with volume mounts for live development and environment variables
• Update swagger-ui volumes to reference ./backend/pkg paths
• Create wb-network bridge network for service communication
• Add postgresql_data volume definition

docker-compose.yml


5. wb_front/Dockerfile ⚙️ Configuration changes +12/-0

Add frontend Dockerfile for containerized development

• Create new Dockerfile for frontend service using Node.js 20-alpine base image
• Install dependencies using npm ci for reproducible builds
• Expose port 5173 for Vite development server
• Configure CMD to run dev server with host binding for container access

wb_front/Dockerfile


6. wb_front/src/app/pages/admin/dashboard/ui/components/StatusFilter.tsx 🐞 Bug fix +1/-1

Fix Select component import path casing

• Fix import path for Select component from uppercase Select to lowercase select

wb_front/src/app/pages/admin/dashboard/ui/components/StatusFilter.tsx


Grey Divider

Qodo Logo

@qodo-code-review

qodo-code-review Bot commented Mar 3, 2026

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (2) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider


Action required

1. backend-build missing mkdir 🐞 Bug ⛯ Reliability
Description
make backend-build outputs to backend/bin/server but the target never creates backend/bin (and
it’s gitignored), so a fresh checkout will likely fail with a “no such file or directory” when
writing the binary.
Code

Makefile[R67-69]

+backend-build:
+	cd $(BACKEND_PATH) && go build -o bin/server cmd/server/main.go
+
Evidence
The new target writes to a relative bin/server path under backend/ but doesn’t create the
directory. The repo explicitly ignores backend/bin/, so it won’t exist in a clean clone unless
created by another target.

Makefile[64-69]
.gitignore[29-36]
Makefile[97-99]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`backend-build` writes the binary to `backend/bin/server` but doesn’t ensure `backend/bin` exists. Because `backend/bin/` is gitignored, it won’t exist on a clean checkout and the build can fail.

## Issue Context
- `backend-build` is intended as a convenient top-level build target.
- `bin-deps` already creates `$(LOCAL_BIN)` but `backend-build` does not depend on it.

## Fix Focus Areas
- Makefile[64-69]
- Makefile[97-99]
- .gitignore[29-36]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. Migrations not self-contained 🐞 Bug ⛯ Reliability
Description
The Makefile exposes migrations-* targets that directly call goose, but they don’t depend on
bin-deps, and bin-deps installs goose only on Windows. On macOS/Linux, make migrations-up may
fail unless goose is manually installed.
Code

Makefile[R85-92]

migrations-up:
-	goose -dir ./migrations postgres "postgres://postgres:postgres@localhost:5442/seller_promotions?sslmode=disable" up
+	cd $(BACKEND_PATH) && goose -dir ./migrations postgres "postgres://postgres:postgres@localhost:5442/seller_promotions?sslmode=disable" up

migrations-down:
-	goose -dir ./migrations postgres "postgres://postgres:postgres@localhost:5442/seller_promotions?sslmode=disable" down
+	cd $(BACKEND_PATH) && goose -dir ./migrations postgres "postgres://postgres:postgres@localhost:5442/seller_promotions?sslmode=disable" down

migrations-new:
-	goose create -dir ./migrations rename sql
+	cd $(BACKEND_PATH) && goose create -dir ./migrations rename sql
Evidence
The migrations targets invoke goose directly. The Makefile’s Windows bin-deps branch installs
goose, but the non-Windows branch does not, and the migrations targets don’t declare a dependency on
bin-deps.

Makefile[82-92]
Makefile[99-106]
Makefile[107-112]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`migrations-up/down/new` call `goose`, but the Makefile doesn’t guarantee `goose` exists on macOS/Linux and the migrations targets don’t depend on any tool-installation target.

## Issue Context
- Windows `bin-deps` installs goose, but non-Windows does not.
- The Makefile now advertises migrations targets via `help`, so they should work reliably.

## Fix Focus Areas
- Makefile[82-92]
- Makefile[97-112]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

ⓘ The new review experience is currently in Beta. Learn more

Grey Divider

Qodo Logo

@Kristian228007 Kristian228007 changed the title add global makefile and docker for services [NO MERGE] add global makefile and docker for services Mar 3, 2026
Comment thread Makefile
Comment on lines +67 to +69
backend-build:
cd $(BACKEND_PATH) && go build -o bin/server cmd/server/main.go

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Action required

1. Backend-build missing mkdir 🐞 Bug ⛯ Reliability

make backend-build outputs to backend/bin/server but the target never creates backend/bin (and
it’s gitignored), so a fresh checkout will likely fail with a “no such file or directory” when
writing the binary.
Agent Prompt
## Issue description
`backend-build` writes the binary to `backend/bin/server` but doesn’t ensure `backend/bin` exists. Because `backend/bin/` is gitignored, it won’t exist on a clean checkout and the build can fail.

## Issue Context
- `backend-build` is intended as a convenient top-level build target.
- `bin-deps` already creates `$(LOCAL_BIN)` but `backend-build` does not depend on it.

## Fix Focus Areas
- Makefile[64-69]
- Makefile[97-99]
- .gitignore[29-36]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment thread Makefile
Comment on lines 85 to +92
migrations-up:
goose -dir ./migrations postgres "postgres://postgres:postgres@localhost:5442/seller_promotions?sslmode=disable" up
cd $(BACKEND_PATH) && goose -dir ./migrations postgres "postgres://postgres:postgres@localhost:5442/seller_promotions?sslmode=disable" up

migrations-down:
goose -dir ./migrations postgres "postgres://postgres:postgres@localhost:5442/seller_promotions?sslmode=disable" down
cd $(BACKEND_PATH) && goose -dir ./migrations postgres "postgres://postgres:postgres@localhost:5442/seller_promotions?sslmode=disable" down

migrations-new:
goose create -dir ./migrations rename sql
cd $(BACKEND_PATH) && goose create -dir ./migrations rename sql

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Action required

2. Migrations not self-contained 🐞 Bug ⛯ Reliability

The Makefile exposes migrations-* targets that directly call goose, but they don’t depend on
bin-deps, and bin-deps installs goose only on Windows. On macOS/Linux, make migrations-up may
fail unless goose is manually installed.
Agent Prompt
## Issue description
`migrations-up/down/new` call `goose`, but the Makefile doesn’t guarantee `goose` exists on macOS/Linux and the migrations targets don’t depend on any tool-installation target.

## Issue Context
- Windows `bin-deps` installs goose, but non-Windows does not.
- The Makefile now advertises migrations targets via `help`, so they should work reliably.

## Fix Focus Areas
- Makefile[82-92]
- Makefile[97-112]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

eugenesuv added a commit to BranchBuddies/BugBusters that referenced this pull request Mar 16, 2026
…ildberries#100

Update test2.py #1 #12 #14 (#15)
eugenesuv/wildberries#32
eugenesuv/wildberries#100
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant