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
28 changes: 17 additions & 11 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@ DATABASE_URL=postgresql://postgres:devpassword@localhost:5432/typelets_local
# For production (example):
# DATABASE_URL=postgresql://username:password@hostname:5432/database?sslmode=require

# Database Connection Pooling (OPTIONAL)
# DB_POOL_MAX=20 # Maximum connections in pool (default: 20)
# DB_IDLE_TIMEOUT=20 # Close idle connections after N seconds (default: 20)
# DB_CONNECT_TIMEOUT=10 # Connection timeout in seconds (default: 10)
# Valkey Cache (OPTIONAL - for performance optimization)
# VALKEY_HOST=your-cluster.serverless.use1.cache.amazonaws.com
# VALKEY_PORT=6379

# Clerk Authentication (REQUIRED)
# Get your secret key from: https://dashboard.clerk.com/
Expand All @@ -31,6 +30,7 @@ CLERK_SECRET_KEY=sk_test_your_actual_clerk_secret_key_from_dashboard
# CORS Origins (REQUIRED)
# Comma-separated list of allowed origins (no spaces after commas)
# Include all frontend domains that will access this API
# If not set, all cross-origin requests will be blocked
CORS_ORIGINS=http://localhost:5173,http://localhost:3000
# Production example:
# CORS_ORIGINS=https://app.typelets.com,https://typelets.com
Expand Down Expand Up @@ -66,10 +66,10 @@ MESSAGE_AUTH_SECRET=your-very-secure-random-string-here-min-32-chars
# HTTP_FILE_RATE_LIMIT_MAX=100 # Max file operations per window

# WebSocket Rate Limiting
WS_RATE_LIMIT_WINDOW_MS=60000 # Time window: 1 minute (in milliseconds)
WS_RATE_LIMIT_MAX_MESSAGES=300 # Max messages per window per connection
WS_MAX_CONNECTIONS_PER_USER=20 # Max concurrent connections per user
WS_AUTH_TIMEOUT_MS=30000 # Authentication timeout: 30 seconds
WS_RATE_LIMIT_WINDOW_MS=60000# Time window: 1 minute (in milliseconds)
WS_RATE_LIMIT_MAX_MESSAGES=300# Max messages per window per connection
WS_MAX_CONNECTIONS_PER_USER=20# Max concurrent connections per user
WS_AUTH_TIMEOUT_MS=30000# Authentication timeout: 30 seconds

# Production Rate Limiting Recommendations:
# - HTTP: 500-1000 requests per 15 minutes per user
Expand All @@ -82,7 +82,7 @@ WS_AUTH_TIMEOUT_MS=30000 # Authentication timeout: 30 seconds
# ================================================================

# File Size Limits
MAX_FILE_SIZE_MB=50 # Maximum size per file (default: 50MB)
MAX_FILE_SIZE_MB=50# Maximum size per file (default: 50MB)
# MAX_NOTE_SIZE_MB=1024 # Maximum total attachments per note (default: 1GB)

# Allowed File Types (handled in code, documented here)
Expand All @@ -107,8 +107,8 @@ MAX_FILE_SIZE_MB=50 # Maximum size per file (default: 50MB)
# ================================================================

# Free Tier Limits
FREE_TIER_STORAGE_GB=1 # Storage limit for free users (default: 1GB)
FREE_TIER_NOTE_LIMIT=100 # Note count limit for free users (default: 100)
FREE_TIER_STORAGE_GB=1# Storage limit for free users (default: 1GB)
FREE_TIER_NOTE_LIMIT=100# Note count limit for free users (default: 100)

# Usage tracking for billing analytics
# These limits trigger billing events logged to console
Expand All @@ -118,6 +118,12 @@ FREE_TIER_NOTE_LIMIT=100 # Note count limit for free users (default
# LOGGING & MONITORING
# ================================================================

# New Relic APM (OPTIONAL - for production monitoring)
# Get your license key from: https://one.newrelic.com
# NEW_RELIC_APP_NAME=Typelets API
# NEW_RELIC_LICENSE_KEY=your_license_key_here
# NEW_RELIC_LOG_LEVEL=warn # Options: error, warn, info, debug, trace (default: warn in dev, info in prod)

# Debug Logging
# DEBUG=false # Set to true for verbose logging (not recommended in production)

Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,29 +9,29 @@ on:
jobs:
test:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [20.x, 22.x]

steps:
- uses: actions/checkout@v4

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9.15.0

- name: Install dependencies
run: pnpm install

- name: Run linting
run: pnpm run lint

- name: Run build
run: NODE_OPTIONS="--max-old-space-size=8192" pnpm run build
run: NODE_OPTIONS="--max-old-space-size=8192" pnpm run build
10 changes: 5 additions & 5 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
pull_request:
branches: [main]
schedule:
- cron: '0 0 * * 0'
- cron: "0 0 * * 0"

jobs:
analyze:
Expand All @@ -20,7 +20,7 @@ jobs:
strategy:
fail-fast: false
matrix:
language: ['typescript']
language: ["typescript"]

steps:
- name: Checkout repository
Expand All @@ -34,8 +34,8 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
node-version: "20"

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
Expand All @@ -48,4 +48,4 @@ jobs:
run: NODE_OPTIONS="--max-old-space-size=8192" pnpm run build

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
uses: github/codeql-action/analyze@v3
21 changes: 21 additions & 0 deletions .github/workflows/new-relic-change-tracking.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Change Tracking Marker
on:
release:
types: [published]

jobs:
newrelic:
runs-on: ubuntu-latest
name: New Relic
steps:
# This step builds a var with the release tag value to use later
- name: Set Release Version from Tag
run: echo "RELEASE_VERSION=${{ github.ref_name }}" >> $GITHUB_ENV
# This step creates a new Change Tracking Marker
- name: New Relic Application Deployment Marker
uses: newrelic/deployment-marker-action@v2.3.0
with:
apiKey: ${{ secrets.NEW_RELIC_API_KEY }}
guid: ${{ secrets.NEW_RELIC_DEPLOYMENT_ENTITY_GUID }}
version: "${{ env.RELEASE_VERSION }}"
user: "${{ github.actor }}"
18 changes: 9 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,34 +7,34 @@ on:
jobs:
release:
runs-on: ubuntu-latest

permissions:
contents: write
issues: write
pull-requests: write

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

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

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9.15.0

- name: Install dependencies
run: pnpm install

- name: Build
run: NODE_OPTIONS="--max-old-space-size=8192" pnpm run build

- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npx semantic-release
run: npx semantic-release
38 changes: 38 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Dependencies
node_modules/
pnpm-lock.yaml
package-lock.json
yarn.lock

# Build outputs
dist/
build/
.next/
out/

# Cache
.cache/
.turbo/

# Logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Environment files
.env
.env.local
.env.*.local

# Coverage
coverage/
.nyc_output/

# Misc
.DS_Store
*.pem

# Config files
*.config.js
*.config.mjs
10 changes: 10 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"semi": true,
"trailingComma": "es5",
"singleQuote": false,
"printWidth": 100,
"tabWidth": 2,
"useTabs": false,
"arrowParens": "always",
"endOfLine": "auto"
}
7 changes: 1 addition & 6 deletions .releaserc.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,7 @@
[
"@semantic-release/git",
{
"assets": [
"CHANGELOG.md",
"package.json",
"package-lock.json",
"src/version.ts"
],
"assets": ["CHANGELOG.md", "package.json", "package-lock.json", "src/version.ts"],
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}
],
Expand Down
37 changes: 13 additions & 24 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,80 +14,69 @@

## [1.3.1](https://github.com/typelets/typelets-api/compare/v1.3.0...v1.3.1) (2025-09-25)


### Bug Fixes

* enforce encrypted data validation to prevent plaintext exposure ([0cc6f77](https://github.com/typelets/typelets-api/commit/0cc6f77fcbf9def845e1fae0b871c27f7b1fad95))
- enforce encrypted data validation to prevent plaintext exposure ([0cc6f77](https://github.com/typelets/typelets-api/commit/0cc6f77fcbf9def845e1fae0b871c27f7b1fad95))

# [1.3.0](https://github.com/typelets/typelets-api/compare/v1.2.0...v1.3.0) (2025-09-23)


### Features

* add comprehensive Sentry monitoring and fix 429 rate limiting error ([6ba5744](https://github.com/typelets/typelets-api/commit/6ba5744022d075216e8053b6c2127cbb38a4824e))
- add comprehensive Sentry monitoring and fix 429 rate limiting error ([6ba5744](https://github.com/typelets/typelets-api/commit/6ba5744022d075216e8053b6c2127cbb38a4824e))

# [1.2.0](https://github.com/typelets/typelets-api/compare/v1.1.1...v1.2.0) (2025-09-20)


### Features

* **ci:** add Husky pre-commit hooks to prevent CI failures ([346bc2b](https://github.com/typelets/typelets-api/commit/346bc2bcd087d5000b7cc21032561c60baf43dda))
* **ci:** add Husky pre-commit hooks to prevent CI failures ([e2b1017](https://github.com/typelets/typelets-api/commit/e2b1017d1bbb133dd1067ef9234fb463ad89f15d))
* **code:** add secure API proxy for code execution ([8d599b5](https://github.com/typelets/typelets-api/commit/8d599b5c6c72e3ae871a9cf71b9304fb8541828e))
- **ci:** add Husky pre-commit hooks to prevent CI failures ([346bc2b](https://github.com/typelets/typelets-api/commit/346bc2bcd087d5000b7cc21032561c60baf43dda))
- **ci:** add Husky pre-commit hooks to prevent CI failures ([e2b1017](https://github.com/typelets/typelets-api/commit/e2b1017d1bbb133dd1067ef9234fb463ad89f15d))
- **code:** add secure API proxy for code execution ([8d599b5](https://github.com/typelets/typelets-api/commit/8d599b5c6c72e3ae871a9cf71b9304fb8541828e))

## [1.1.1](https://github.com/typelets/typelets-api/compare/v1.1.0...v1.1.1) (2025-09-16)


### Bug Fixes

* make note title field optional for encrypted notes ([ec19a48](https://github.com/typelets/typelets-api/commit/ec19a48954a10eb2a2531c3195fc5fe6b3430d70))
- make note title field optional for encrypted notes ([ec19a48](https://github.com/typelets/typelets-api/commit/ec19a48954a10eb2a2531c3195fc5fe6b3430d70))

# [1.1.0](https://github.com/typelets/typelets-api/compare/v1.0.4...v1.1.0) (2025-09-15)


### Features

* **websocket:** implement real-time sync with HMAC authentication and fix folder moves ([8de85b7](https://github.com/typelets/typelets-api/commit/8de85b7eae38b9af76154e40cdeff53d771f6e92))
- **websocket:** implement real-time sync with HMAC authentication and fix folder moves ([8de85b7](https://github.com/typelets/typelets-api/commit/8de85b7eae38b9af76154e40cdeff53d771f6e92))

## [1.0.4](https://github.com/typelets/typelets-api/compare/v1.0.3...v1.0.4) (2025-09-10)


### Bug Fixes

* bundle API with esbuild to resolve directory import errors ([4644c0e](https://github.com/typelets/typelets-api/commit/4644c0e3d2de2eb5796abab36b931615dc81eead))
- bundle API with esbuild to resolve directory import errors ([4644c0e](https://github.com/typelets/typelets-api/commit/4644c0e3d2de2eb5796abab36b931615dc81eead))

## [1.0.3](https://github.com/typelets/typelets-api/compare/v1.0.2...v1.0.3) (2025-09-10)


### Bug Fixes

* include root-level TypeScript files in esbuild output ([cf9bb4f](https://github.com/typelets/typelets-api/commit/cf9bb4fda0fa19925122b816d0375c88c4f39e05))
- include root-level TypeScript files in esbuild output ([cf9bb4f](https://github.com/typelets/typelets-api/commit/cf9bb4fda0fa19925122b816d0375c88c4f39e05))

## [1.0.2](https://github.com/typelets/typelets-api/compare/v1.0.1...v1.0.2) (2025-09-10)


### Bug Fixes

* replace tsc with esbuild to resolve build hanging issue ([235fce7](https://github.com/typelets/typelets-api/commit/235fce77cdde4e2287fe8b25acc7bcb96deb6ff8))
- replace tsc with esbuild to resolve build hanging issue ([235fce7](https://github.com/typelets/typelets-api/commit/235fce77cdde4e2287fe8b25acc7bcb96deb6ff8))

## [1.0.1](https://github.com/typelets/typelets-api/compare/v1.0.0...v1.0.1) (2025-09-10)


### Bug Fixes

* update Dockerfile to use pnpm instead of npm ([13e9639](https://github.com/typelets/typelets-api/commit/13e963965c7e5fa0e060ba8a0d8995eee761620b))
- update Dockerfile to use pnpm instead of npm ([13e9639](https://github.com/typelets/typelets-api/commit/13e963965c7e5fa0e060ba8a0d8995eee761620b))

# 1.0.0 (2025-09-09)


### Bug Fixes

* remove ES module configuration to fix semantic-release scripts ([f869d14](https://github.com/typelets/typelets-api/commit/f869d14cf42b35d119d11e3e25daff98060b7129))

- remove ES module configuration to fix semantic-release scripts ([f869d14](https://github.com/typelets/typelets-api/commit/f869d14cf42b35d119d11e3e25daff98060b7129))

### Features

* initial open source release of Typelets API ([66a3d30](https://github.com/typelets/typelets-api/commit/66a3d30dcbc0a33c4118c6948d9537e885298039))
- initial open source release of Typelets API ([66a3d30](https://github.com/typelets/typelets-api/commit/66a3d30dcbc0a33c4118c6948d9537e885298039))

# Changelog

Expand Down
Loading