Skip to content

Commit b223a1a

Browse files
Merge remote-tracking branch 'origin/develop' into fix/move-signup-link
2 parents 48c4765 + 0a8944b commit b223a1a

119 files changed

Lines changed: 9839 additions & 223 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.cspell/custom-dictionary-workspace.txt

Lines changed: 122 additions & 0 deletions
Large diffs are not rendered by default.

.env.example

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ GO_SCRAPER_URL=http://localhost:8081
1111
# Use uma string longa e secreta em ambientes reais.
1212
SESSION_SECRET=change-me-with-a-long-random-secret
1313

14+
# Segurança / PII
15+
# ENCRYPTION_MASTER_KEY deve ter 32 bytes em hex, ou seja, 64 caracteres hex.
16+
ENCRYPTION_MASTER_KEY=
17+
ENCRYPTION_KEY_ID=default
18+
SEARCH_KEY=
19+
1420
# CORS / frontend access
1521
CORS_ALLOWED_ORIGINS=http://localhost:5173,http://localhost:5174
1622

README.md

Lines changed: 18 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ Objetivo de produto: fornecer uma base robusta para busca, filtragem e gestão d
5656
├─ electron/ # Shell desktop
5757
├─ docker-compose.yml # App stack (frontend + backend + scraper-go)
5858
├─ docker-compose.infra.yml # Infra stack (Postgres + Valkey)
59+
├─ docker-compose.migrate.yml # Migration job do backend
5960
└─ .github/workflows/ci.yml # CI
6061
```
6162

@@ -106,25 +107,13 @@ docker network create vagas-net
106107

107108
Se a rede já existir, o Docker vai avisar e você pode seguir para o próximo passo.
108109

109-
4. Suba Postgres e Valkey:
110+
4. Suba Postgres, Valkey, scraper, backend e frontend:
110111

111112
```bash
112-
docker compose -f docker-compose.infra.yml up -d
113-
```
114-
115-
5. Suba scraper, backend e frontend:
116-
117-
```bash
118-
docker compose up --build -d
113+
docker compose -f docker-compose.infra.yml -f docker-compose.yml -f docker-compose.migrate.yml up --build -d
119114
```
120115

121-
6. Aplique as migrations do backend:
122-
123-
```bash
124-
docker compose exec backend npm run db:migrate
125-
```
126-
127-
7. Acesse os serviços:
116+
5. Acesse os serviços:
128117

129118
- Frontend: http://localhost:5173
130119
- Backend health: http://localhost:3001/health
@@ -272,31 +261,35 @@ Este projeto separa infraestrutura e aplicação em dois arquivos Compose:
272261

273262
- `docker-compose.infra.yml`: Postgres + Valkey.
274263
- `docker-compose.yml`: scraper Go + backend + frontend.
264+
- `docker-compose.migrate.yml`: job de migrations do backend.
275265

276-
Subir infraestrutura:
266+
Subir infraestrutura, migrations e aplicação:
277267

278268
```bash
279-
docker compose -f docker-compose.infra.yml up -d
269+
docker compose -f docker-compose.infra.yml -f docker-compose.yml -f docker-compose.migrate.yml up --build -d
280270
```
281271

282-
Subir aplicação:
272+
O serviço `migrate` executa `npm run db:migrate` e `npm run security:backfill-user-pii -- --write` depois que o Postgres fica saudável. O backend só inicia depois que esse job termina com sucesso.
273+
274+
Se quiser subir apenas a infraestrutura:
283275

284276
```bash
285-
docker compose up --build -d
277+
docker compose -f docker-compose.infra.yml up -d
286278
```
287279

288-
Aplicar migrations:
280+
Se quiser subir a aplicação sem o job de migrations:
289281

290282
```bash
291-
docker compose exec backend npm run db:migrate
283+
docker compose up --build -d
292284
```
293285

294286
Ver logs:
295287

296288
```bash
297-
docker compose logs -f backend
298-
docker compose logs -f frontend
299-
docker compose logs -f scraper-go
289+
docker compose -f docker-compose.infra.yml -f docker-compose.yml -f docker-compose.migrate.yml logs -f migrate
290+
docker compose -f docker-compose.infra.yml -f docker-compose.yml -f docker-compose.migrate.yml logs -f backend
291+
docker compose -f docker-compose.infra.yml -f docker-compose.yml -f docker-compose.migrate.yml logs -f frontend
292+
docker compose -f docker-compose.infra.yml -f docker-compose.yml -f docker-compose.migrate.yml logs -f scraper-go
300293
```
301294

302295
Encerrar:
@@ -314,7 +307,7 @@ Dentro dos containers, serviços devem usar os nomes da rede Docker:
314307
- Valkey: `valkey:6379`
315308
- Scraper: `scraper-go:8081`
316309

317-
Por isso o `docker-compose.yml` sobrescreve `DATABASE_URL`, `VALKEY_URL`, `GO_SCRAPER_URL` e `SCRAPER_URL` para os valores internos corretos.
310+
Por isso o `docker-compose.yml` e o `docker-compose.migrate.yml` sobrescrevem variáveis como `DATABASE_URL`, `VALKEY_URL`, `GO_SCRAPER_URL` e `SCRAPER_URL` para os valores internos corretos.
318311

319312
Serviços padrão:
320313

backend/.env.example

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,15 @@ FRONTEND_URL=http://localhost:5173
2525
# Use uma string longa e secreta em ambientes reais.
2626
SESSION_SECRET=change-me-with-a-long-random-secret
2727

28+
# Segurança / PII
29+
# ENCRYPTION_MASTER_KEY deve ter 32 bytes em hex, ou seja, 64 caracteres hex.
30+
ENCRYPTION_MASTER_KEY=
31+
ENCRYPTION_KEY_ID=default
32+
SEARCH_KEY=
33+
2834
# CORS / frontend access
2935
CORS_ALLOWED_ORIGINS=http://localhost:5173,http://localhost:5174
3036

31-
# Search filters
32-
SEARCH_LOCATION=Brasil
33-
SEARCH_GEO_ID=106057199
34-
SEARCH_LANGUAGE=pt
35-
REMOTE_ONLY=true
36-
JOB_TYPES=C,F
37-
TIME_FILTER=r604800
38-
SEARCH_KEYWORDS=UX Designer,UI Designer,Product Manager,Product Owner
39-
4037
# Database / cache for backend running locally outside Docker
4138
DATABASE_URL=postgresql://vagas:vagas@localhost:5432/vagas
4239
VALKEY_URL=redis://localhost:6379/0

backend/bruno/Auth/Register.bru

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,13 @@ post {
1212

1313
body:json {
1414
{
15-
"email":"hudson60@gmail.com",
16-
"password": "tavares10",
17-
"name": "Hudson Tavares",
18-
"role":"banana"
15+
"email": "teste.criptografia.001@example.com",
16+
"password": "SenhaForte123",
17+
"name": "Teste Criptografia",
18+
"phone": "+5534999999999",
19+
"cpf": "12345678901",
20+
"technologies": ["TypeScript", "Node.js", "React"],
21+
"level": "pleno"
1922
}
2023
}
2124

backend/bruno/Jobs/SearchJobs.bru

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@ meta {
55
}
66

77
get {
8-
url: {{base_url}}/jobs/search?keywords=node.js
8+
url: {{base_url}}/jobs/search?location=&keywords=node.js
99
body: none
1010
auth: inherit
1111
}
1212

1313
params:query {
14+
location:
1415
keywords: node.js
1516
}
1617

backend/drizzle/0008_bent_thor.sql

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
ALTER TABLE "credentials" ADD COLUMN "email_hash" text;--> statement-breakpoint
2+
ALTER TABLE "users" ADD COLUMN "first_name_encrypted" text;--> statement-breakpoint
3+
ALTER TABLE "users" ADD COLUMN "last_name_encrypted" text;--> statement-breakpoint
4+
ALTER TABLE "users" ADD COLUMN "display_name_encrypted" text;--> statement-breakpoint
5+
ALTER TABLE "users" ADD COLUMN "email_encrypted" text;--> statement-breakpoint
6+
ALTER TABLE "users" ADD COLUMN "email_hash" text;--> statement-breakpoint
7+
ALTER TABLE "users" ADD COLUMN "phone_encrypted" text;--> statement-breakpoint
8+
ALTER TABLE "users" ADD COLUMN "cpf_encrypted" text;--> statement-breakpoint
9+
ALTER TABLE "users" ADD COLUMN "cpf_hash" text;--> statement-breakpoint
10+
CREATE UNIQUE INDEX "users_email_hash_unique" ON "users" USING btree ("email_hash");--> statement-breakpoint
11+
ALTER TABLE "credentials" ADD CONSTRAINT "credentials_email_hash_unique" UNIQUE("email_hash");
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
ALTER TABLE "users" ADD COLUMN "avatar_url_encrypted" text;--> statement-breakpoint
2+
ALTER TABLE "users" ADD COLUMN "technologies_encrypted" text;--> statement-breakpoint
3+
ALTER TABLE "users" ADD COLUMN "level_encrypted" text;

0 commit comments

Comments
 (0)