Skip to content

Commit f7862a9

Browse files
authored
Merge pull request #6 from HardMax71/dev
Added publish scripts
2 parents 00b965a + 3e0592b commit f7862a9

File tree

18 files changed

+370
-35
lines changed

18 files changed

+370
-35
lines changed

.env.example

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
NEO4J_PASSWORD=your_secure_neo4j_password_here
2+
GRAFANA_ADMIN_PASSWORD=your_secure_grafana_password_here
3+
VITE_API_BASE_URL=http://localhost:8000
4+
VITE_GRAFANA_URL=http://grafana.localhost:8081
5+
6+
# Frontend build target: dev (vite hot-reload) or prod (nginx static)
7+
FRONTEND_TARGET=dev
Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
name: Build and Publish Docker Images
2+
3+
on:
4+
release:
5+
types: [published]
6+
push:
7+
branches: [main]
8+
paths:
9+
- 'backend/**'
10+
- 'frontend/**'
11+
- '.github/workflows/publish-images.yml'
12+
workflow_dispatch:
13+
inputs:
14+
push:
15+
description: 'Push images to registry'
16+
required: false
17+
default: true
18+
type: boolean
19+
20+
env:
21+
REGISTRY: ghcr.io
22+
23+
jobs:
24+
build:
25+
runs-on: ubuntu-latest
26+
permissions:
27+
contents: read
28+
packages: write
29+
attestations: write
30+
id-token: write
31+
32+
strategy:
33+
fail-fast: false
34+
matrix:
35+
include:
36+
- image: backend
37+
context: ./backend
38+
dockerfile: ./backend/Dockerfile
39+
- image: frontend
40+
context: ./frontend
41+
dockerfile: ./frontend/Dockerfile
42+
target: prod
43+
build-args: |
44+
VITE_API_BASE_URL=/api
45+
VITE_GRAFANA_URL=
46+
47+
steps:
48+
- name: Checkout repository
49+
uses: actions/checkout@v4
50+
51+
- name: Set up Docker Buildx
52+
uses: docker/setup-buildx-action@v3
53+
54+
- name: Log in to GitHub Container Registry
55+
uses: docker/login-action@v3
56+
with:
57+
registry: ${{ env.REGISTRY }}
58+
username: ${{ github.actor }}
59+
password: ${{ secrets.GITHUB_TOKEN }}
60+
61+
- name: Extract metadata (tags, labels)
62+
id: meta
63+
uses: docker/metadata-action@v5
64+
with:
65+
images: ${{ env.REGISTRY }}/${{ github.repository }}/${{ matrix.image }}
66+
tags: |
67+
type=semver,pattern={{version}}
68+
type=semver,pattern={{major}}.{{minor}}
69+
type=semver,pattern={{major}},enable=${{ !startsWith(github.ref, 'refs/tags/v0.') }}
70+
type=ref,event=branch
71+
type=sha,prefix=sha-
72+
flavor: |
73+
latest=auto
74+
75+
- name: Build and push Docker image
76+
id: push
77+
uses: docker/build-push-action@v6
78+
with:
79+
context: ${{ matrix.context }}
80+
file: ${{ matrix.dockerfile }}
81+
target: ${{ matrix.target || '' }}
82+
platforms: linux/amd64
83+
push: ${{ github.event_name != 'workflow_dispatch' || inputs.push }}
84+
tags: ${{ steps.meta.outputs.tags }}
85+
labels: ${{ steps.meta.outputs.labels }}
86+
build-args: ${{ matrix.build-args || '' }}
87+
cache-from: type=gha
88+
cache-to: type=gha,mode=max
89+
provenance: true
90+
sbom: true
91+
92+
- name: Generate artifact attestation
93+
uses: actions/attest-build-provenance@v2
94+
if: ${{ github.event_name != 'workflow_dispatch' || inputs.push }}
95+
with:
96+
subject-name: ${{ env.REGISTRY }}/${{ github.repository }}/${{ matrix.image }}
97+
subject-digest: ${{ steps.push.outputs.digest }}
98+
push-to-registry: true
99+
100+
summary:
101+
needs: build
102+
runs-on: ubuntu-latest
103+
if: always()
104+
steps:
105+
- name: Create summary
106+
run: |
107+
echo "## Docker Image Build Summary" >> $GITHUB_STEP_SUMMARY
108+
echo "" >> $GITHUB_STEP_SUMMARY
109+
echo "| Image | Status |" >> $GITHUB_STEP_SUMMARY
110+
echo "|-------|--------|" >> $GITHUB_STEP_SUMMARY
111+
if [ "${{ needs.build.result }}" = "success" ]; then
112+
echo "| backend | passed |" >> $GITHUB_STEP_SUMMARY
113+
echo "| frontend | passed |" >> $GITHUB_STEP_SUMMARY
114+
else
115+
echo "| backend | failed |" >> $GITHUB_STEP_SUMMARY
116+
echo "| frontend | failed |" >> $GITHUB_STEP_SUMMARY
117+
fi
118+
echo "" >> $GITHUB_STEP_SUMMARY
119+
echo "### Pull commands" >> $GITHUB_STEP_SUMMARY
120+
echo '```bash' >> $GITHUB_STEP_SUMMARY
121+
echo "docker pull ghcr.io/${{ github.repository }}/backend:latest" >> $GITHUB_STEP_SUMMARY
122+
echo "docker pull ghcr.io/${{ github.repository }}/frontend:latest" >> $GITHUB_STEP_SUMMARY
123+
echo '```' >> $GITHUB_STEP_SUMMARY

.github/workflows/tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ jobs:
2424
with:
2525
python-version: '3.12'
2626

27-
- name: Create .env file from example
27+
- name: Create .env files
2828
run: |
29+
cp .env.example .env
2930
cp backend/.env.example backend/.env
3031
sed -i "s|TEXT_LLM_API_KEY=.*|TEXT_LLM_API_KEY=$TEXT_LLM_API_KEY|" backend/.env
3132
sed -i "s|OCR_LLM_API_KEY=.*|OCR_LLM_API_KEY=$OCR_LLM_API_KEY|" backend/.env
32-
echo "✓ Created .env file with API keys from secrets"
3333
3434
- name: Start all services
3535
run: docker compose up -d --wait

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,5 @@ uploads/
22
.idea/
33
.venv/
44
__pycache__/
5+
.env
6+
traefik-dashboard-users

CONTRIBUTING.md

Lines changed: 156 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
1+
# Contributing to ResuMariner
2+
3+
## Development Setup
4+
5+
### Backend Development
6+
7+
The backend uses pre-commit hooks to ensure code quality. All linting and type checking is configured in `/backend/pyproject.toml`.
8+
9+
#### Installing Pre-commit Hooks
10+
11+
From the **backend directory**:
12+
13+
```bash
14+
cd backend
15+
uv run pre-commit install
16+
```
17+
18+
This will install git hooks that run automatically before each commit.
19+
20+
#### Running Pre-commit Manually
21+
22+
To run all checks on all files:
23+
24+
```bash
25+
cd backend
26+
uv run pre-commit run --all-files
27+
```
28+
29+
To run checks on staged files only:
30+
31+
```bash
32+
cd backend
33+
uv run pre-commit run
34+
```
35+
36+
#### Individual Tool Commands
37+
38+
You can also run the tools individually:
39+
40+
**Ruff (linting and auto-fix):**
41+
```bash
42+
cd backend
43+
uv run ruff check --fix .
44+
```
45+
46+
**Ruff (formatting):**
47+
```bash
48+
cd backend
49+
uv run ruff format .
50+
```
51+
52+
**MyPy (type checking):**
53+
```bash
54+
cd backend
55+
uv run mypy . --config-file pyproject.toml
56+
```
57+
58+
## Code Quality Standards
59+
60+
### Python Backend
61+
62+
- **Linting**: Ruff with the configuration in `backend/pyproject.toml`
63+
- Line length: 120 characters
64+
- Target: Python 3.12
65+
- Selected rules: E (pycodestyle errors), W (warnings), F (pyflakes), I (isort), B (bugbear), C4 (comprehensions), UP (pyupgrade)
66+
67+
- **Formatting**: Ruff formatter
68+
- Double quotes
69+
- Space indentation
70+
- Auto-formatting before commit
71+
72+
- **Type Checking**: MyPy with strict settings
73+
- Check untyped definitions enabled
74+
- Warn on unused configs
75+
- Test files excluded from strict checking
76+
77+
### Pre-commit Hook Configuration
78+
79+
The backend uses a `.pre-commit-config.yaml` file with three hooks:
80+
81+
1. **ruff-check**: Runs linting and auto-fixes issues
82+
2. **ruff-format**: Formats code according to style guide
83+
3. **mypy**: Type checks all Python code
84+
85+
All hooks use `uv run` to ensure they run in the correct virtual environment.
86+
87+
### Important Notes
88+
89+
- Pre-commit hooks are configured in `/backend/.pre-commit-config.yaml`
90+
- Always run commands from the `/backend` directory
91+
- The hooks use `pass_filenames: false` to run on all files in the backend directory
92+
- `fail_fast: false` means all hooks will run even if one fails
93+
94+
## Testing
95+
96+
Run tests with pytest:
97+
98+
```bash
99+
cd backend
100+
uv run pytest
101+
```
102+
103+
Run tests for a specific app:
104+
105+
```bash
106+
cd backend
107+
uv run pytest core/
108+
uv run pytest processor/
109+
uv run pytest storage/
110+
uv run pytest search/
111+
```
112+
113+
## Docker Development
114+
115+
Build and run the full stack:
116+
117+
```bash
118+
docker compose up -d
119+
```
120+
121+
Rebuild specific services:
122+
123+
```bash
124+
docker compose build backend backend-worker-processing backend-worker-cleanup
125+
docker compose up -d backend backend-worker-processing backend-worker-cleanup
126+
```
127+
128+
Force rebuild without cache:
129+
130+
```bash
131+
docker compose build --no-cache backend backend-worker-processing backend-worker-cleanup
132+
```
133+
134+
## Common Workflows
135+
136+
### Making Changes to Backend Code
137+
138+
1. Make your changes
139+
2. Run pre-commit hooks: `cd backend && uv run pre-commit run --all-files`
140+
3. Fix any issues reported
141+
4. Commit your changes (hooks will run automatically)
142+
5. If hooks fail, fix issues and commit again
143+
144+
### Adding New Dependencies
145+
146+
1. Edit `backend/pyproject.toml`
147+
2. Run `cd backend && uv lock` to update lockfile
148+
3. Rebuild Docker containers
149+
4. Test the changes
150+
151+
### Before Opening a Pull Request
152+
153+
1. Ensure all pre-commit hooks pass: `cd backend && uv run pre-commit run --all-files`
154+
2. Run the full test suite: `cd backend && uv run pytest`
155+
3. Test the application with Docker: `docker compose up -d`
156+
4. Verify all services are healthy: `docker compose ps`

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ This project started after one of those meetings where "simple resume parsing" e
3131

3232
The system handles CV uploads (PDF, DOCX, JPG formats), parses them into structured data, and makes them searchable. You can throw natural language queries at it ("find someone who's built payment systems") or search by specific criteria (5+ years Python, knows Docker, lives in Berlin). There's also a hybrid mode that combines both approaches when you need the flexibility of semantic search with the precision of structured filters.
3333

34+
The frontend is a React + TypeScript app (Vite) with pages for CV upload, job status tracking, search across all three modes, health monitoring, and admin cleanup.
35+
3436
## Architecture
3537

3638
V1 was microservices. Spent more time coordinating services than building features, plus the "single source of truth" problem for shared domain objects (Resume, AIReview) had no good solution - shared libs and copypasting both were bad. V2 is a Django monolith with clean separation through apps.
@@ -53,7 +55,7 @@ Then run:
5355
docker-compose up --build
5456
```
5557

56-
The backend API will be at http://localhost:8000 and the Traefik dashboard at http://localhost:8080. Frontend will be at http://localhost:5173.
58+
The backend API will be at http://localhost:8000 and the frontend at http://localhost:5173.
5759

5860
## How the API works
5961

0 commit comments

Comments
 (0)