Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
50 changes: 25 additions & 25 deletions .github/BranchingStrategy.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ The goals of this strategy are:

# Branch Overview

| Branch | Purpose |
|---|---|
| `main` | Production-ready stable code |
| `dev` | Active development and integration branch |
| Branch | Purpose |
| ------ | ----------------------------------------- |
| `main` | Production-ready stable code |
| `dev` | Active development and integration branch |

---

Expand Down Expand Up @@ -70,7 +70,7 @@ Format:

```text
<type>/<issue-id>-<short-description>
````
```

Example:

Expand Down Expand Up @@ -195,11 +195,11 @@ dev

The following validations must pass before merge:

* Linting
* Type checking
* Tests
* Build validation
* Accessibility checks (frontend)
- Linting
- Type checking
- Tests
- Build validation
- Accessibility checks (frontend)

---

Expand Down Expand Up @@ -310,9 +310,9 @@ Every hotfix merged into `main` must also be merged back into `dev`.

This prevents:

* branch divergence
* bug reintroduction
* inconsistent releases
- branch divergence
- bug reintroduction
- inconsistent releases

---

Expand All @@ -322,16 +322,16 @@ This prevents:

Runs on:

* PRs to `dev`
* PRs to `main`
- PRs to `dev`
- PRs to `main`

Validates:

* linting
* tests
* type checking
* build
* accessibility
- linting
- tests
- type checking
- build
- accessibility

---

Expand All @@ -345,8 +345,8 @@ push -> dev

Deploys:

* development environment
* latest integration build
- development environment
- latest integration build

---

Expand All @@ -360,8 +360,8 @@ git tag v*

Builds:

* production Docker images
* immutable release artifacts
- production Docker images
- immutable release artifacts

---

Expand All @@ -383,4 +383,4 @@ Builds:
| `v1.0.0` | Official release version |
| `sha-*` | Exact commit traceability |

---
---
18 changes: 10 additions & 8 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ about: Create a report to help us improve
title: 'BUG: '
labels: enhancement
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:

1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
Expand All @@ -24,15 +24,17 @@ A clear and concise description of what you expected to happen.
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
17 changes: 11 additions & 6 deletions .github/ISSUE_TEMPLATE/component-task-issue-template.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,21 @@ title: 'COMPONENT: '
labels: enhancement
assignees: ''
type: Task

---

## Task: [ComponentName] Component

**Type:** Component
**Feature:** #12 Login Flow
**Estimate:** [S / M / L]

### Component Type

- [ ] Design system (no API calls, pure props)
- [ ] Feature component (may use hooks)

### Props Interface

```ts
interface LoginFormProps {
onSuccess: (user: User) => void
Expand All @@ -27,20 +29,23 @@ interface LoginFormProps {
```

### Variants / States
| State | Description |
|-------|-------------|
| Default | Empty form, submit enabled |
| Loading | Inputs disabled, button shows spinner |
| Error | Error message shown below form |

| State | Description |
| ------- | ---------------------------------------- |
| Default | Empty form, submit enabled |
| Loading | Inputs disabled, button shows spinner |
| Error | Error message shown below form |
| Success | Handled by parent via onSuccess callback |

### Acceptance Criteria

- [ ] Renders all states correctly
- [ ] Calls onSuccess with user data on valid submit
- [ ] Shows inline validation (email format, required fields)
- [ ] Does not call API directly (hook handles that)
- [ ] Unit tested (required fields, error display, onSuccess called)

### Notes

- Email field: type="email", autocomplete="email"
- Password field: toggle visibility icon
15 changes: 10 additions & 5 deletions .github/ISSUE_TEMPLATE/feature-ticket-template.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ title: 'Feature: '
labels: enhancement, feature
assignees: ''
type: Feature

---

## Feature: [Name] — e.g., "Login Flow"
Expand All @@ -17,31 +16,37 @@ type: Feature
---

### Context

What problem does this solve? Who uses it?
→ "Allows existing users to authenticate and reach the dashboard."

### API Contract
| Method | Endpoint | Request | Response |
|--------|----------|---------|----------|
| POST | /api/auth/login | { email, password } | { token, user } |
| POST | /api/auth/logout | — | 204 |

| Method | Endpoint | Request | Response |
| ------ | ---------------- | ------------------- | --------------- |
| POST | /api/auth/login | { email, password } | { token, user } |
| POST | /api/auth/logout | — | 204 |

### UI States to Handle

- [ ] Default (empty form)
- [ ] Loading (submit in progress)
- [ ] Validation error (client-side, before submit)
- [ ] Server error (wrong credentials, 401)
- [ ] Success (redirect to /dashboard)

### Tasks

- [ ] #21 — LoginForm component
- [ ] #22 — useLogin mutation hook
- [ ] #23 — Token storage + Axios interceptor
- [ ] #24 — Integration tests

### Out of Scope

- Password reset (separate feature #31)
- SSO / OAuth (milestone 3)

### Design Reference

[Figma link or screenshot]
1 change: 0 additions & 1 deletion .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ about: Suggest an idea for this project
title: ''
labels: enhancement, feature
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
Expand Down
14 changes: 10 additions & 4 deletions .github/ISSUE_TEMPLATE/hook-data-task-issue-template.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,42 +5,48 @@ title: 'HOOK: '
labels: 'enhancement, type: hook'
assignees: ''
type: Task

---

## Task: [hookName] Hook

**Type:** Hook
**Feature:** #12 Login Flow
**Estimate:** [S / M / L]

### Hook Signature

```ts
const { mutate: login, isPending, error } = useLogin()
```

### API Call
| Method | Endpoint | Auth required |
|--------|----------|---------------|
| POST | /api/auth/login | No |

| Method | Endpoint | Auth required |
| ------ | --------------- | ------------- |
| POST | /api/auth/login | No |

### Request

```ts
{ email: string, password: string }
```

### Response

```ts
{ token: string, refreshToken: string, user: User }
```

### Behavior

- On success: store token in httpOnly cookie (or localStorage per arch decision)
- On success: invalidate ['auth', 'me'] query
- On success: call onSuccess callback
- On 401: surface "Invalid email or password" message
- On 5xx: surface "Something went wrong, try again"

### Acceptance Criteria

- [ ] Token stored correctly on success
- [ ] Error messages mapped from status codes
- [ ] Unit tested: success case, 401 case, 5xx case
Expand Down
6 changes: 5 additions & 1 deletion .github/ISSUE_TEMPLATE/infra-config-task.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,35 @@ title: 'CONFIG: '
labels: 'enhancement, type: infra'
assignees: ''
type: Task

---

## Task: [Setup Name] — e.g., "Axios Instance + Interceptors"

**Type:** Infrastructure
**Milestone:** Project Setup
**Estimate:** [S / M / L]

### What This Enables

Which features are blocked until this is done?
→ "All API hooks depend on this. Blocks entire auth milestone."

### Deliverables

- [ ] `src/lib/axios.ts` — configured instance with base URL
- [ ] Request interceptor — attaches Bearer token from storage
- [ ] Response interceptor — handles 401 (trigger refresh), 5xx (log + rethrow)
- [ ] Token refresh logic — queues failed requests during refresh

### Acceptance Criteria

- [ ] All requests include Authorization header when token exists
- [ ] 401 triggers token refresh, retries original request once
- [ ] 5xx errors are logged and rethrown as readable Error objects
- [ ] Unit tested: token attachment, 401 refresh, 5xx handling
- [ ] No raw fetch() calls anywhere else in the codebase

### Notes

- Use `axios-auth-refresh` library or implement manually — decide and document
- Refresh endpoint: POST /api/auth/refresh
7 changes: 6 additions & 1 deletion .github/ISSUE_TEMPLATE/page-task--issue-template.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,35 +5,40 @@ title: 'Page: '
labels: 'enhancement, type: page'
assignees: ''
type: Task

---

## Task: [Page Name] Page

**Type:** Page
**Feature:** #12 Login Flow
**Estimate:** [S / M / L]

### Route

`/login` — public, redirects to /dashboard if already authenticated

### Components Used

- [ ] LoginForm (Task #21 — new)
- [ ] Button (design system)
- [ ] Input (design system)
- [ ] Toast (design system — for server errors)

### Behavior

- Redirect to /dashboard on successful login
- Redirect to /login if user hits protected route unauthenticated
- Preserve `?redirect=` query param and use it after login

### Acceptance Criteria

- [ ] Page renders without console errors
- [ ] Works on mobile (375px) and desktop (1280px)
- [ ] Loading state visible during submit
- [ ] Error message appears on wrong credentials
- [ ] Passes keyboard navigation (Tab through fields, Enter submits)

### Out of Scope

- "Remember me" checkbox
- Social login buttons
Loading