Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
946386d
fix: prisma adapter initialization and hydration mismatch errors
usmanliaqat0 Jul 4, 2026
e8971c7
feat: add dashboard feedbacks count endpoint
usmanliaqat0 Jul 4, 2026
4e8d8c0
feat: add dashboard projects count endpoint
usmanliaqat0 Jul 4, 2026
a07f9d4
feat: add dashboard summary endpoint
usmanliaqat0 Jul 4, 2026
ebb84b9
feat: add api error handling infrastructure
usmanliaqat0 Jul 4, 2026
a059e4e
test: add feedback domain rule coverage
usmanliaqat0 Jul 4, 2026
6dd01c8
test: add project domain rule coverage
usmanliaqat0 Jul 4, 2026
1066190
feat: apply structured backend logging
usmanliaqat0 Jul 4, 2026
adaead5
test: add user domain rule coverage
usmanliaqat0 Jul 4, 2026
f1271c9
docs: clarify ci validation flow
usmanliaqat0 Jul 4, 2026
0401145
feat: add manual project completion validation
usmanliaqat0 Jul 4, 2026
7583f12
feat: block structural project edits
usmanliaqat0 Jul 5, 2026
761f2f1
feat: highlight invite request flow
usmanliaqat0 Jul 5, 2026
008709a
test: add main component coverage
usmanliaqat0 Jul 5, 2026
3ed6e29
docs: clarify collaboration git flow
usmanliaqat0 Jul 5, 2026
0485c6a
test: add auth api coverage
usmanliaqat0 Jul 5, 2026
38ecb6a
fix: reuse shared prisma in seed scripts
usmanliaqat0 Jul 5, 2026
4d46ef9
test: cover prisma seed scripts
usmanliaqat0 Jul 5, 2026
e817d3c
ci: configure sonar coverage report
usmanliaqat0 Jul 5, 2026
21af505
fix: address sonar script path normalization
usmanliaqat0 Jul 5, 2026
e6eaa03
ci: configure sonar coverage report
usmanliaqat0 Jul 5, 2026
80b3f00
ci: configure sonar coverage report
usmanliaqat0 Jul 5, 2026
e2d325f
ci: configure sonar coverage report
usmanliaqat0 Jul 5, 2026
cc17ab4
ci: configure sonar coverage report
usmanliaqat0 Jul 5, 2026
37ab4dd
test: cover structured logging changes
usmanliaqat0 Jul 5, 2026
21a28b6
ci: configure sonar coverage report
usmanliaqat0 Jul 5, 2026
fef574d
fix: resolve team project route sonar issues
usmanliaqat0 Jul 5, 2026
cf1e4f2
test: cover how to join invite flow
usmanliaqat0 Jul 5, 2026
22071c7
fix: wrap dashboard summary response
usmanliaqat0 Jul 5, 2026
b642441
test: cover user route negative paths
usmanliaqat0 Jul 5, 2026
25df558
docs: include install and format validation
usmanliaqat0 Jul 5, 2026
d4b653e
fix: make project completion update atomic
usmanliaqat0 Jul 5, 2026
7b983b1
fix: make project edit updates atomic
usmanliaqat0 Jul 5, 2026
fca2f6f
fix: prisma adapter initialization and hydration mismatch errors (#668)
karinaperes Jul 6, 2026
88b8890
feat: add dashboard skills count endpoint (#669)
usmanliaqat0 Jul 6, 2026
5f49036
feat: add dashboard feedbacks count endpoint (#670)
karinaperes Jul 6, 2026
26bcf5a
feat: add dashboard projects count endpoint (#671)
karinaperes Jul 6, 2026
f0e23d7
feat: add dashboard summary endpoint (#672)
karinaperes Jul 6, 2026
ac909df
feat: add api error handling infrastructure (#673)
karinaperes Jul 6, 2026
e10fb09
test: add feedback domain rule coverage (#674)
karinaperes Jul 6, 2026
9c40f80
test: add project domain rule coverage (#675)
karinaperes Jul 6, 2026
abfbd6d
feat: apply structured backend logging (#676)
karinaperes Jul 6, 2026
0ef6843
test: add user domain rule coverage (#677)
karinaperes Jul 7, 2026
97596a6
Merge pull request #678 from usmanliaqat0/docs/ci-validation-flow
karinaperes Jul 7, 2026
7df5dba
Merge branch 'develop' into feat/manual-project-completion
karinaperes Jul 7, 2026
18bbe56
Update team-project-user-route.test.ts
karinaperes Jul 7, 2026
eedafc8
Merge pull request #679 from usmanliaqat0/feat/manual-project-completion
karinaperes Jul 7, 2026
6dc88cf
Merge pull request #680 from usmanliaqat0/feat/block-structural-proje…
karinaperes Jul 7, 2026
4cda76a
docs: clarify collaboration git flow (#683)
karinaperes Jul 7, 2026
4bc35c2
feat: highlight invite request flow (#681)
karinaperes Jul 7, 2026
9d56595
test: add main component coverage (#682)
karinaperes Jul 7, 2026
9521200
test: add auth api coverage (#684)
karinaperes Jul 7, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions CONTRIBUTING.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,30 @@ This flow guarantees control, equity in the distribution and traceability of res

---

## 🧭 Task tracking flow

After the task is assigned, keep the card updated so the team knows the real state of the work.

### ✔️ Card status:
- **In progress:** use this when you start implementing or reviewing the task.
- **Blocked:** use this when you need a decision, access, scope adjustment or technical help to continue.
- **Done:** use this only after opening the Pull Request, validating locally and leaving the PR link on the card.

### ✔️ Communication on the card:
- Share the agreed deadline before starting.
- Record deadline changes on the card itself.
- Explain blockers with enough context for another person to help.
- When opening the PR, share the link and list which validations were executed.

### ✔️ Branch and PR flow:
- Create the branch from `develop`.
- Use a prefix that matches the type of work: `feat`, `fix`, `docs`, `test`, `refactor`, `style` or `chore`.
- Make small and clear commits.
- Always open the Pull Request against `develop`.
- Link the PR to the issue with a closing keyword, for example `Fixes: #123`, when the PR completes the task.

---

## 🗂️ Rules and Organization

### ✔️ When showing interest in a task (card):
Expand Down
24 changes: 24 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,30 @@ Esse fluxo garante controle, equidade na distribuição e rastreabilidade das re

---

## 🧭 Fluxo de acompanhamento da tarefa

Depois que a tarefa for atribuída, mantenha o card sempre atualizado para que a equipe saiba o estado real do trabalho.

### ✔️ Status do card:
- **Em andamento:** use quando começar a implementar ou revisar a tarefa.
- **Bloqueado:** use quando precisar de uma decisão, acesso, ajuste de escopo ou ajuda técnica para continuar.
- **Concluído:** use apenas depois de abrir o Pull Request, validar localmente e deixar o link do PR no card.

### ✔️ Comunicação no card:
- Informe o prazo combinado antes de iniciar.
- Registre mudanças de prazo no próprio card.
- Explique bloqueios com contexto suficiente para outra pessoa ajudar.
- Ao abrir o PR, informe o link e diga quais validações foram executadas.

### ✔️ Fluxo de branch e PR:
- Crie a branch a partir de `develop`.
- Use um prefixo coerente com o tipo de trabalho: `feat`, `fix`, `docs`, `test`, `refactor`, `style` ou `chore`.
- Faça commits pequenos e claros.
- Abra o Pull Request sempre apontando para `develop`.
- Relacione o PR com a issue usando uma palavra de fechamento, por exemplo `Fixes: #123`, quando o PR concluir a tarefa.

---

## 🗂️ Regras e Organização

### ✔️ Ao demonstrar interesse em uma tarefa (card):
Expand Down
Binary file modified README.md
Binary file not shown.
87 changes: 63 additions & 24 deletions docs/04 - processo/ci-e-validacao.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

**Classificação:** Documento de Processo\
**Camada:** 4 --- Processo\
**Status:** Versão inicial
**Status:** Fluxo oficial documentado

------------------------------------------------------------------------

Expand All @@ -22,7 +22,42 @@ Ele deve ajudar novos contribuidores a entender:

------------------------------------------------------------------------

## 2. O que é CI
## 2. Resumo rápido para contribuidores

Antes de abrir um Pull Request, siga este fluxo:

1. Crie a branch a partir de `develop`.
2. Faça a mudança mantendo o escopo da issue.
3. Rode as validações locais:

```bash
npm ci
npm run format
npm run lint
npm run test
npm run test:push
npm run build
```

4. Abra o PR com destino para `develop`.
5. Inclua na descrição o que mudou, como foi validado e a issue
relacionada.
6. Se algum check falhar, corrija na mesma branch e envie novo commit.

Para mudanças apenas em documentação, rode pelo menos:

```bash
npm ci
npm run format
npm run lint
```

Se a mudança tocar código TypeScript, rotas, componentes, Prisma ou
dependências, rode o fluxo completo.

------------------------------------------------------------------------

## 3. O que é CI

CI, ou Integração Contínua, é o processo automatizado que executa
validações sempre que uma mudança é enviada para revisão.
Expand All @@ -38,7 +73,7 @@ No TryCatch, a CI protege a branch de desenvolvimento contra:

------------------------------------------------------------------------

## 3. Quando a pipeline roda
## 4. Quando a pipeline roda

O projeto possui dois workflows que atuam em conjunto:

Expand All @@ -50,11 +85,12 @@ O **CI Pipeline** roda em:

- Pull Requests direcionados para `main`;
- Pull Requests direcionados para `develop`;
- Pushes na branch `test/tests-ci`.
- Pushes diretos em `main`;
- Pushes diretos em `develop`.

A branch `test/tests-ci` é usada para validar alterações no próprio
workflow. Para contribuições comuns, o fluxo esperado é abrir PR para
`develop`.
Para contribuições comuns, o fluxo esperado é abrir PR para `develop`.
Push direto em `main` ou `develop` deve ser reservado para mantenedores e
casos autorizados.

O **SonarCloud** não roda diretamente em `pull_request`. Ele é disparado
pelo gatilho `workflow_run`, ou seja, **somente depois que a CI Pipeline
Expand All @@ -68,9 +104,9 @@ termina com sucesso**. O motivo dessa separação está explicado na seção

------------------------------------------------------------------------

## 4. Validações executadas pela CI
## 5. Validações executadas pela CI

### 4.1 Build and Prepare Environment
### 5.1 Build and Prepare Environment

Objetivo: garantir que a aplicação consiga compilar em ambiente limpo.

Expand All @@ -82,7 +118,7 @@ Passos principais:
- Cria arquivo `.env` com secrets configurados no GitHub;
- Executa `npm run build`.

### 4.2 Lint Codebase
### 5.2 Lint Codebase

Objetivo: verificar padrões de código e regras do Next.js/ESLint.

Expand All @@ -92,7 +128,7 @@ Comando executado:
npm run lint
```

### 4.3 Run Tests (Jest)
### 5.3 Run Tests (Jest)

Objetivo: garantir que os testes automatizados continuem passando.

Expand All @@ -102,7 +138,7 @@ Comando executado:
npm run test
```

### 4.4 Run Tests with Coverage
### 5.4 Run Tests with Coverage

Objetivo: gerar cobertura de testes e impedir queda abaixo do mínimo
definido.
Expand All @@ -117,12 +153,12 @@ npx jest --coverage \
O relatório de cobertura é enviado como artefato do workflow
(`coverage-report`). Em Pull Requests, o job também publica um artefato
`pr-metadata` (número do PR, branch de origem e branch de destino). Esses
artefatos são consumidos pelo workflow SonarCloud (seção 4.5).
artefatos são consumidos pelo workflow SonarCloud (seção 5.5).

O padrão oficial de testes backend está documentado em
`docs/04 - processo/testes-backend.md`.

### 4.5 SonarCloud Scan (workflow separado)
### 5.5 SonarCloud Scan (workflow separado)

Objetivo: executar análise de qualidade e segurança via SonarCloud.

Expand Down Expand Up @@ -178,7 +214,7 @@ como secret no repositório base.
> que os demais checks estejam verdes; o Sonar passa a decorar o PR
> quando o `SONAR_TOKEN` está configurado no repositório base.

### 4.6 Audit Dependencies
### 5.6 Audit Dependencies

Objetivo: bloquear dependências com vulnerabilidades de severidade alta
ou superior.
Expand All @@ -191,7 +227,7 @@ npm audit --audit-level=high

------------------------------------------------------------------------

## 5. Validação local antes de abrir PR
## 6. Validação local antes de abrir PR

Antes de abrir um Pull Request, o contribuidor deve rodar as validações
principais localmente.
Expand All @@ -202,6 +238,7 @@ Fluxo recomendado:
git checkout develop
git pull origin develop
npm ci
npm run format
npm run lint
npm run test
npm run test:push
Expand All @@ -219,7 +256,7 @@ Observações:

------------------------------------------------------------------------

## 6. Requisitos para abrir Pull Request
## 7. Requisitos para abrir Pull Request

Antes de abrir o PR:

Expand All @@ -241,6 +278,8 @@ Resumo objetivo da mudança.

## Validação

- npm ci
- npm run format
- npm run lint
- npm run test
- npm run test:push
Expand All @@ -254,7 +293,7 @@ issue.

------------------------------------------------------------------------

## 7. O que fazer quando um check falhar
## 8. O que fazer quando um check falhar

Quando a CI falhar:

Expand All @@ -274,7 +313,7 @@ aguarde orientação de um mantenedor.

------------------------------------------------------------------------

## 8. Requisitos para merge
## 9. Requisitos para merge

Um PR só deve ser considerado pronto para merge quando:

Expand All @@ -288,7 +327,7 @@ Um PR só deve ser considerado pronto para merge quando:

------------------------------------------------------------------------

## 9. Relação com Husky
## 10. Relação com Husky

O projeto usa Husky para validações locais antes de commits e pushes.

Expand All @@ -305,9 +344,9 @@ executadas manualmente.

------------------------------------------------------------------------

## 10. Prisma Client e `package-lock.json`
## 11. Prisma Client e `package-lock.json`

### 10.1 Geração do Prisma Client (`postinstall`)
### 11.1 Geração do Prisma Client (`postinstall`)

A partir do Prisma 7, o pacote `@prisma/client` só fica utilizável depois
que o client é gerado. Sem isso, jobs que rodam testes falham com:
Expand All @@ -326,7 +365,7 @@ local), existe o script `postinstall` no `package.json`:
Ele roda automaticamente após `npm ci` / `npm install`. Não é necessário
rodar `npx prisma generate` manualmente após instalar dependências.

### 10.2 Lockfile e diferenças entre sistemas operacionais
### 11.2 Lockfile e diferenças entre sistemas operacionais

Algumas dependências nativas opcionais (por exemplo bindings de
`@unrs/resolver-binding-*` e `@tailwindcss/oxide-*`, que embarcam
Expand Down Expand Up @@ -355,7 +394,7 @@ Diretrizes para evitar esse problema:

------------------------------------------------------------------------

## 11. Responsabilidades
## 12. Responsabilidades

Contribuidor:

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"lint": "eslint . --no-cache",
"lint:fix": "eslint . --no-cache --fix",
"format": "prettier --write .",
"seed": "node scripts/createTestUser.js",
"seed": "tsx scripts/createTestUser.ts",
"test": "jest --passWithNoTests --maxWorkers=50%",
"test:watchAll": "jest --watchAll",
"test:watch": "jest --watch --maxWorkers=25%",
Expand Down
37 changes: 0 additions & 37 deletions scripts/createTestUser.js

This file was deleted.

45 changes: 45 additions & 0 deletions scripts/createTestUser.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import bcrypt from 'bcryptjs';
import { prisma } from '../src/lib/prisma';

export async function createTestUser() {
const password = 'teste123';
const hashedPassword = await bcrypt.hash(password, 10);

return prisma.user.upsert({
where: { email: 'admin@admin.com' },
update: {},
create: {
name: 'Usuário Admin',
email: 'admin@admin.com',
password: hashedPassword,
avatar: '',
bio: 'Usuário admin para testes da API',
linkedin: 'https://www.linkedin.com/in/trycatch-app',
github: 'https://github.com/TryCatch-ForMatch/trycatch',
role: 'ADMIN',
},
});
}

function isDirectRun() {
return process.argv[1]
?.replaceAll('\\', '/')
.endsWith('/scripts/createTestUser.ts');
}

/* c8 ignore start */
if (isDirectRun()) {
createTestUser()
.then(async (user) => {
console.log('Usuário criado ou já existente:', user);
console.log('✅ Script finalizado.');
await prisma.$disconnect();
process.exit(0);
})
.catch(async (error) => {
console.error('❌ Ocorreu um erro:', error);
await prisma.$disconnect();
process.exit(1);
});
}
/* c8 ignore stop */
Loading
Loading