Pages
A publishing app: TanStack Start frontend, an in-process Brick API, Better Auth, Postgres and MCP tools in one server.
- Full stack
- Postgres
- Auth
- MCP
1 services · 10 actions · 13 tables · 137 files
Features
- CRUD resource with authorized and scoped access policies
- Better Auth and OAuth provider tables
- Typed client with a type-only API contract
- MCP tools over the same services
Service graph
Actions and routes
pages
| Method | Path | Action | Access |
|---|---|---|---|
| POST | /api/page/query | page.list | scoped |
| GET | /api/page/:id | page.get | scoped |
| POST | /api/page | page.create | authorized |
| PATCH | /api/page/:id | page.update | scoped |
| DELETE | /api/page/:id | page.delete | scoped |
| POST | /api/page/find-one | page.findOne | scoped |
| POST | /api/page/count | page.count | scoped |
| POST | /api/page/exists | page.exists | scoped |
| POST | /api/pages/echo | echo | authorized |
| GET | /api/public/pages/:slug | get_public_page | public |
Database tables
| id | text | PK |
|---|---|---|
| account_id | text | NOT NULL |
| provider_id | text | NOT NULL |
| user_id | text | NOT NULL |
| access_token | text | |
| refresh_token | text | |
| id_token | text | |
| access_token_expires_at | timestamp | |
| refresh_token_expires_at | timestamp | |
| scope | text | |
| password | text | |
| created_at | timestamp | NOT NULL |
| updated_at | timestamp | NOT NULL |
| id | text | PK |
|---|---|---|
| public_key | text | NOT NULL |
| private_key | text | NOT NULL |
| created_at | timestamp | NOT NULL |
| expires_at | timestamp | |
| alg | text | |
| crv | text |
| id | text | PK |
|---|---|---|
| token | text | |
| client_id | text | NOT NULL |
| session_id | text | |
| user_id | text | |
| reference_id | text | |
| authorization_code_id | text | |
| resources | text[] | |
| requested_user_info_claims | text[] | |
| refresh_id | text | |
| expires_at | timestamp | |
| created_at | timestamp | |
| revoked | timestamp | |
| confirmation | jsonb | |
| scopes | text[] | NOT NULL |
| id | text | PK |
|---|---|---|
| client_id | text | NOT NULL |
| client_secret | text | |
| client_discovery_id | text | |
| disabled | boolean | |
| skip_consent | boolean | |
| enable_end_session | boolean | |
| subject_type | text | |
| scopes | text[] | |
| client_credentials_scopes | text[] | |
| user_id | text | |
| created_at | timestamp | |
| updated_at | timestamp | |
| name | text | |
| uri | text | |
| icon | text | |
| contacts | text[] | |
| tos | text | |
| policy | text | |
| software_id | text | |
| software_version | text | |
| software_statement | text | |
| redirect_uris | text[] | NOT NULL |
| post_logout_redirect_uris | text[] | |
| backchannel_logout_uri | text | |
| backchannel_logout_session_required | boolean | |
| token_endpoint_auth_method | text | |
| application_type | text | |
| jwks | text | |
| jwks_uri | text | |
| grant_types | text[] | |
| response_types | text[] | |
| require_pkce | boolean | |
| dpop_bound_access_tokens | boolean | |
| reference_id | text | |
| metadata | jsonb |
| id | text | PK |
|---|---|---|
| expires_at | timestamp | NOT NULL |
| id | text | PK |
|---|---|---|
| client_id | text | NOT NULL |
| resource_id | text | NOT NULL |
| metadata | jsonb | |
| created_at | timestamp |
| id | text | PK |
|---|---|---|
| client_id | text | NOT NULL |
| user_id | text | |
| reference_id | text | |
| resources | text[] | |
| requested_user_info_claims | text[] | |
| scopes | text[] | NOT NULL |
| created_at | timestamp | |
| updated_at | timestamp |
| id | text | PK |
|---|---|---|
| token | text | NOT NULL |
| client_id | text | NOT NULL |
| session_id | text | |
| user_id | text | NOT NULL |
| reference_id | text | |
| authorization_code_id | text | |
| resources | text[] | |
| requested_user_info_claims | text[] | |
| expires_at | timestamp | |
| created_at | timestamp | |
| revoked | timestamp | |
| rotated_at | timestamp | |
| rotation_replay_response | text | |
| rotation_replay_expires_at | timestamp | |
| auth_time | timestamp | |
| confirmation | jsonb | |
| scopes | text[] | NOT NULL |
| id | text | PK |
|---|---|---|
| identifier | text | NOT NULL |
| name | text | NOT NULL |
| access_token_ttl | integer | |
| refresh_token_ttl | integer | |
| signing_algorithm | text | |
| signing_key_id | text | |
| allowed_scopes | text[] | |
| custom_claims | jsonb | |
| dpop_bound_access_tokens_required | boolean | |
| disabled | boolean | |
| created_at | timestamp | |
| updated_at | timestamp | |
| policy_version | integer | |
| metadata | jsonb |
| content | text | NOT NULL |
|---|---|---|
| content_type | text | NOT NULL |
| created_at | text | NOT NULL |
| id | text | PK |
| is_public | boolean | NOT NULL |
| slug | text | NOT NULL |
| theme | text | NOT NULL |
| title | text | NOT NULL |
| updated_at | text | NOT NULL |
| user_id | text |
| id | text | PK |
|---|---|---|
| expires_at | timestamp | NOT NULL |
| token | text | NOT NULL |
| created_at | timestamp | NOT NULL |
| updated_at | timestamp | NOT NULL |
| ip_address | text | |
| user_agent | text | |
| user_id | text | NOT NULL |
| id | text | PK |
|---|---|---|
| name | text | NOT NULL |
| text | NOT NULL | |
| email_verified | boolean | NOT NULL |
| image | text | |
| created_at | timestamp | NOT NULL |
| updated_at | timestamp | NOT NULL |
| id | text | PK |
|---|---|---|
| identifier | text | NOT NULL |
| value | text | NOT NULL |
| expires_at | timestamp | NOT NULL |
| created_at | timestamp | NOT NULL |
| updated_at | timestamp | NOT NULL |
Source
Loading source…
Run it
Needs a local Postgres database; set DATABASE_URL and apply migrations with bun run --cwd examples/pages db:migrate. The app listens on port 5174.