# API .NET + Next.js - Tasks

## Fase 1: Setup do Projeto

| ID | Task | Dependências | Estimativa |
|----|------|--------------|------------|
| T001 | Criar solution .NET | - | S |
| T002 | Criar projeto Next.js | - | S |
| T003 | Configurar Docker Compose | T001, T002 | M |
| T004 | Configurar packages (.NET e npm) | T001, T002 | S |

## Fase 2: Backend - Domain Layer

| ID | Task | Dependências | Estimativa |
|----|------|--------------|------------|
| T005 | Criar BaseEntity | T001 | S |
| T006 | Criar Product entity | T005 | S |
| T007 | Criar Order e OrderItem entities | T005 | M |
| T008 | Criar Customer entity | T005 | S |
| T009 | Definir interfaces de repository | T005 | S |

## Fase 3: Backend - Infrastructure Layer

| ID | Task | Dependências | Estimativa |
|----|------|--------------|------------|
| T010 | Criar AppDbContext | T006-T008 | M |
| T011 | Configurar EF Core mappings | T010 | M |
| T012 | Criar ProductRepository | T010 | M |
| T013 | Criar OrderRepository | T010 | M |
| T014 | Criar CustomerRepository | T010 | M |
| T015 | Criar migrations | T011 | S |

## Fase 4: Backend - Application Layer

| ID | Task | Dependências | Estimativa |
|----|------|--------------|------------|
| T016 | Criar DTOs | T006-T008 | M |
| T017 | Criar ProductService | T012 | M |
| T018 | Criar OrderService | T013 | M |
| T019 | Criar CustomerService | T014 | M |
| T020 | Criar validators (FluentValidation) | T016 | M |
| T021 | Criar DashboardService | T017-T019 | M |

## Fase 5: Backend - API Layer

| ID | Task | Dependências | Estimativa |
|----|------|--------------|------------|
| T022 | Configurar Program.cs base | T001 | M |
| T023 | Configurar autenticação JWT/Clerk | T022 | M |
| T024 | Criar ProductEndpoints | T017, T020 | M |
| T025 | Criar OrderEndpoints | T018, T020 | M |
| T026 | Criar CustomerEndpoints | T019, T020 | M |
| T027 | Criar DashboardEndpoints | T021 | S |
| T028 | Configurar Swagger/OpenAPI | T024-T027 | S |
| T029 | Configurar CORS | T022 | S |
| T030 | Configurar Health Checks | T022 | S |

## Fase 6: Frontend - Setup

| ID | Task | Dependências | Estimativa |
|----|------|--------------|------------|
| T031 | Configurar Tailwind CSS | T002 | S |
| T032 | Instalar shadcn/ui components | T031 | M |
| T033 | Configurar Clerk | T002 | M |
| T034 | Criar API client | T002 | M |
| T035 | Configurar React Query | T002 | S |

## Fase 7: Frontend - Layout

| ID | Task | Dependências | Estimativa |
|----|------|--------------|------------|
| T036 | Criar root layout | T031 | M |
| T037 | Criar dashboard layout | T036 | M |
| T038 | Criar sidebar navigation | T037 | M |
| T039 | Criar header com user menu | T033, T037 | M |

## Fase 8: Frontend - Components

| ID | Task | Dependências | Estimativa |
|----|------|--------------|------------|
| T040 | Criar DataTable component | T032 | L |
| T041 | Criar Form components | T032 | M |
| T042 | Criar Card components | T032 | S |
| T043 | Criar Modal/Dialog components | T032 | M |
| T044 | Criar Loading/Error states | T032 | S |

## Fase 9: Frontend - Hooks

| ID | Task | Dependências | Estimativa |
|----|------|--------------|------------|
| T045 | Criar useProducts hook | T034, T035 | M |
| T046 | Criar useOrders hook | T034, T035 | M |
| T047 | Criar useCustomers hook | T034, T035 | M |
| T048 | Criar useDashboard hook | T034, T035 | S |
| T049 | Criar usePagination hook | T035 | S |

## Fase 10: Frontend - Pages

| ID | Task | Dependências | Estimativa |
|----|------|--------------|------------|
| T050 | Criar landing page | T036 | M |
| T051 | Criar sign-in page | T033 | S |
| T052 | Criar sign-up page | T033 | S |
| T053 | Criar dashboard page | T048, T042 | M |
| T054 | Criar products list page | T045, T040 | M |
| T055 | Criar product detail page | T045, T042 | M |
| T056 | Criar product form page | T045, T041 | M |
| T057 | Criar orders list page | T046, T040 | M |
| T058 | Criar order detail page | T046, T042 | M |

## Fase 11: Infrastructure (IaC)

| ID | Task | Dependências | Estimativa |
|----|------|--------------|------------|
| T059 | Criar main.bicep | - | M |
| T060 | Configurar Container App (API) | T059 | M |
| T061 | Configurar Container App (Web) | T059 | M |
| T062 | Configurar SQL Database | T059 | M |
| T063 | Configurar App Insights | T059 | S |

## Fase 12: Testes e Deploy

| ID | Task | Dependências | Estimativa |
|----|------|--------------|------------|
| T064 | Criar testes unitários backend | T017-T021 | L |
| T065 | Criar testes de integração API | T024-T027 | L |
| T066 | Criar testes E2E frontend | T050-T058 | L |
| T067 | Configurar CI/CD pipeline | T059-T063 | M |

## Checkpoints

| Checkpoint | Após Tasks | Validação |
|------------|------------|-----------|
| CP1 | T004 | Projetos compilam |
| CP2 | T015 | Database pronto |
| CP3 | T021 | Services funcionando |
| CP4 | T030 | API completa com Swagger |
| CP5 | T039 | Layout pronto |
| CP6 | T049 | Hooks funcionando |
| CP7 | T058 | Frontend completo |
| CP8 | T063 | IaC pronto |
| CP9 | T067 | Deploy funcional |

## Legenda

- **S** = Small (< 1h)
- **M** = Medium (1-3h)
- **L** = Large (3-8h)

## Ordem de Execução Paralela

```
Backend Path:
T001 → T005 → T006-T009 → T010-T015 → T016-T021 → T022-T030

Frontend Path (pode iniciar após T028):
T002 → T031-T035 → T036-T039 → T040-T044 → T045-T049 → T050-T058

IaC Path (pode iniciar independente):
T059-T063

Testes (após ambos paths):
T064-T066 → T067
```

---

*MORPH-SPEC by Polymorphism Tech*
