Skip to content

Latest commit

 

History

History

README.md

Server

Setup

Prerequisites

This doc assumes that you already configured IAM Identity Center authentication. Please follow this instructions.

Verify available profiles:

cat ~/.aws/config

Expected output:

[profile my-profile] 
sso_session = my-sso 
sso_account_id = 123456789012 
sso_role_name = AdministratorAccess
region = ap-northeast-1

Login using AWS SSO:

aws sso login --profile <your-profile>

Set the profile for the current shell:

export AWS_PROFILE=<your-profile>

Verify authentication:

aws sts get-caller-identity

Expected output:

{
  "Account": "...",
  "Arn": "...",
  "UserId": "..."
}

Install dependencies:

uv sync
pnpm install

Start development environment:

pnpm dev

In order to run scheduled functions manually for testing purpose, we can trigger the function in AWS Console.

Run unit tests:

uv run pytest

Run Linter:

uv run ruff check .
uv run ruff check . --fix
Manage database migrations:

Set the connection string for the current shell:

export DATABASE_URL='postgresql://...'

Apply pending migrations:

pnpm db:migrate

Create a new migration:

pnpm db:new <migration_name>

Rollback the latest migration:

pnpm db:rollback

Check migration status:

pnpm db:status
Manage resources:

List deployed stages:

pnpm state:list

Show deployed resources for dev:

pnpm state:dev

Show deployed resources for prod:

pnpm state:prod

Remove deployed dev resources:

pnpm remove:dev

Remove deployed prod resources:

pnpm remove:prod