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
34 changes: 16 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,11 @@ jobs:

- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 10.18.2

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
node-version: 24
cache: 'pnpm'

- name: Install dependencies
Expand All @@ -43,13 +41,11 @@ jobs:

- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 10.18.2

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
node-version: 24
cache: 'pnpm'

- name: Install dependencies
Expand All @@ -59,34 +55,38 @@ jobs:
run: pnpm run types

test:
name: Test (Node ${{ matrix.node-version }})
name: Test
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18, 20, 22]
services:
dynamodb:
image: amazon/dynamodb-local:latest
ports:
- 8000:8000
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 10.18.2

- name: Setup Node.js ${{ matrix.node-version }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
node-version: 24
cache: 'pnpm'

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Run tests with coverage
run: pnpm run test:coverage
env:
AWS_REGION: us-east-1
AWS_ACCESS_KEY_ID: test
AWS_SECRET_ACCESS_KEY: test
DYNAMODB_ENDPOINT: http://localhost:8000

- name: Upload coverage to Codecov
if: matrix.node-version == 20
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
Expand All @@ -102,13 +102,11 @@ jobs:

- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 10.18.2

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
node-version: 24
cache: 'pnpm'

- name: Install dependencies
Expand Down
23 changes: 17 additions & 6 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ This is a TypeScript/Node.js project using Fastify as the web framework with Bio
- **Schema Validation**: Typebox
- **Testing**: Jest
- **Linting/Formatting**: Biome
- **Data Layer**: DynamoDB with dynamodb-toolbox
- **Data Layer**: DynamoDB with dynamodb-toolbox v2.7.1

## Common Commands
- `pnpm install` - Install dependencies
Expand All @@ -27,15 +27,26 @@ This is a TypeScript/Node.js project using Fastify as the web framework with Bio
- `pnpm run docker` - Start Docker services

## Code Standards
- **Formatting**: Uses tabs for indentation, double quotes for strings
- **Formatting**: Uses tabs for indentation, double quotes for strings (see `docs/standards/style.md`)
- **Linting**: Biome with recommended rules enabled
- **Import Organization**: Automatically organize imports on save
- **Type Safety**: Strict TypeScript with no implicit any
- **Entity Pattern**: Domain entities with static factory methods
- **Entity Pattern**: Domain entities with static factory methods for data transformation
- **DynamoDB Toolbox**: See `docs/standards/ddb.md` for schema design, repository patterns, and best practices
- **Testing**: Test-Driven Development approach - see `docs/standards/tdd.md`
- **Development Practices**: See `docs/standards/practices.md` for workflows and conventions
- **Technical Standards**: See `docs/standards/tech.md` for architecture and technology choices

## Architecture Notes
- **Layered Architecture**: Router → Service → Repository → Entity → Database
- **Domain-Driven Design**: Entities manage all data transformations (fromRequest, toRecord, toResponse, validate)
- **Repository Pattern**: DynamoDB access abstracted through repositories using dynamodb-toolbox
- **Single-Table Design**: All entities share one DynamoDB table with PK/SK patterns
- **Entity Transformations**:
- `fromRequest()` - API request to Entity
- `toRecord()` - Entity to DynamoDB record (InputItem)
- `fromRecord()` - DynamoDB record to Entity (FormattedItem)
- `toResponse()` - Entity to API response
- Project uses pnpm workspace configuration with specific build dependency handling
- Biome VCS integration is disabled, likely for custom git workflow
- TypeScript configuration includes strict mode and modern ES2020 target
- Entity pattern with from/to methods for data transformation
- Repository pattern for data access
- TypeScript configuration includes strict mode and modern ES2020 target
3 changes: 2 additions & 1 deletion biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"useIgnoreFile": false
},
"files": {
"ignoreUnknown": false
"ignoreUnknown": false,
"includes": ["src/**"]
},
"formatter": {
"enabled": true,
Expand Down
9 changes: 6 additions & 3 deletions docs/product/product.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ erDiagram
| Entity | Partition Key (PK) | Sort Key (SK) | Entity Type |
|--------|-------------------|---------------|-------------|
| **Repository** | `REPO#<Owner>#<RepoName>` | `REPO#<Owner>#<RepoName>` | Repo |
| **Issue** | `REPO#<Owner>#<RepoName>` | `ISSUE#<ZeroPaddedIssueNumber>` | Issue |
| **Issue** | `ISSUE#<Owner>#<RepoName>#<ZeroPaddedIssueNumber>` | `ISSUE#<Owner>#<RepoName>#<ZeroPaddedIssueNumber>` | Issue |
| **Pull Request** | `PR#<Owner>#<RepoName>#<ZeroPaddedPRNumber>` | `PR#<Owner>#<RepoName>#<ZeroPaddedPRNumber>` | PullRequest |
| **Issue Comment** | `ISSUECOMMENT#<Owner>#<RepoName>#<IssueNumber>` | `ISSUECOMMENT#<CommentId>` | IssueComment |
| **PR Comment** | `PRCOMMENT#<Owner>#<RepoName>#<PRNumber>` | `PRCOMMENT#<CommentId>` | PRComment |
Expand All @@ -162,6 +162,7 @@ erDiagram
| Entity | GSI1PK | GSI1SK | Purpose |
|--------|--------|--------|---------|
| **Repository** | `REPO#<Owner>#<RepoName>` | `REPO#<Owner>#<RepoName>` | Query by repo |
| **Issue** | `ISSUE#<Owner>#<RepoName>` | `ISSUE#<ZeroPaddedIssueNumber>` | List issues by repo |
| **Pull Request** | `PR#<Owner>#<RepoName>` | `PR#<ZeroPaddedPRNumber>` | List PRs by repo |
| **User** | `ACCOUNT#<Username>` | `ACCOUNT#<Username>` | Account queries |
| **Organization** | `ACCOUNT#<OrgName>` | `ACCOUNT#<OrgName>` | Account queries |
Expand All @@ -188,8 +189,10 @@ erDiagram
| Entity | GSI4PK | GSI4SK | Purpose |
|--------|--------|--------|---------|
| **Repository** | `REPO#<Owner>#<RepoName>` | `#REPO#<Owner>#<RepoName>` | Repo metadata |
| **Open Issue** | `REPO#<Owner>#<RepoName>` | `ISSUE#OPEN#<ZeroPaddedIssueNumberDiff>` | Open issues by repo |
| **Closed Issue** | `REPO#<Owner>#<RepoName>` | `#ISSUE#CLOSED#<ZeroPaddedIssueNumber>` | Closed issues by repo |
| **Open Issue** | `ISSUE#<Owner>#<RepoName>` | `ISSUE#OPEN#<ZeroPaddedIssueNumberDiff>` | Open issues by repo (sorted newest first) |
| **Closed Issue** | `ISSUE#<Owner>#<RepoName>` | `#ISSUE#CLOSED#<ZeroPaddedIssueNumber>` | Closed issues by repo (sorted oldest first) |

**Note:** Issue and PR numbers support up to 99,999,999 (8 digits). Open issues use reverse numbering (`99999999 - issue_number`) for newest-first sorting.

## Supported Access Patterns

Expand Down
Loading