Skip to content

Commit 5a678a9

Browse files
committed
feat: port api from monorepo
1 parent 0955ada commit 5a678a9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+20208
-1
lines changed

.env.template

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Environment Configuration
2+
NODE_ENV="development" # Options: 'development', 'production'
3+
PORT="3001"
4+
HOST="localhost" # Hostname for the server
5+
6+
# CORS Settings
7+
CORS_ORIGIN="http://localhost:*" # Allowed CORS origin, adjust as necessary
8+
9+
# Rate Limiting
10+
COMMON_RATE_LIMIT_WINDOW_MS="1000" # Window size for rate limiting (ms)
11+
COMMON_RATE_LIMIT_MAX_REQUESTS="20" # Max number of requests per window per IP
12+
13+
# RPC
14+
RPC_URL_1="" # mainnet
15+
RPC_URL_11155111="" # sepolia
16+
RPC_URL_8453="", # base
17+
RPC_URL_42161="", # arbitrum
18+
RPC_URL_80084="" # bartio
19+
RPC_URL_31337="" # foundry

.github/renovate.json

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
3+
"extends": ["config:recommended", "customManagers:biomeVersions"],
4+
"labels": ["chore: dependencies"],
5+
"dependencyDashboard": true,
6+
"lockFileMaintenance": {
7+
"enabled": true
8+
},
9+
"packageRules": [
10+
{
11+
"matchUpdateTypes": ["minor", "patch", "pin", "digest"],
12+
"groupName": "all non-major dependencies",
13+
"groupSlug": "all-minor-patch",
14+
"automerge": true
15+
},
16+
{
17+
"matchPackageNames": ["@biomejs/biome"],
18+
"groupName": "biome",
19+
"groupSlug": "biome",
20+
"automerge": true
21+
},
22+
{
23+
"matchPackageNames": [
24+
"@commitlint/cli",
25+
"@commitlint/config-conventional"
26+
],
27+
"groupName": "commitlint",
28+
"groupSlug": "commitlint",
29+
"automerge": true
30+
},
31+
{
32+
"packagePatterns": ["@types", "typescript"],
33+
"groupName": "typescript"
34+
},
35+
{
36+
"packagePatterns": ["@vitest", "vitest"],
37+
"groupName": "vitest"
38+
}
39+
]
40+
}

.github/workflows/build.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches: ["master"]
6+
pull_request:
7+
branches: ["master"]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Use the latest stable Node.js
17+
uses: actions/setup-node@v4
18+
with:
19+
node-version-file: '.nvmrc'
20+
cache: "npm"
21+
22+
- name: Install Dependencies
23+
run: npm ci
24+
25+
- name: Run Build
26+
run: npm run build

.github/workflows/code-quality.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Code Quality
2+
3+
on:
4+
push:
5+
branches: ["master"]
6+
pull_request:
7+
branches: ["master"]
8+
9+
jobs:
10+
quality:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v4
15+
16+
- name: Setup Biome
17+
uses: biomejs/setup-biome@v2
18+
with:
19+
version: latest
20+
21+
- name: Run Biome
22+
run: biome ci .

.github/workflows/docker-image.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Docker Image CI
2+
3+
on:
4+
push:
5+
branches: ["master"]
6+
pull_request:
7+
branches: ["master"]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
# Login step only executed for pushes to main
17+
- name: Login to GitHub Container Registry
18+
if: github.ref == 'refs/heads/master'
19+
uses: docker/login-action@v3
20+
with:
21+
registry: ghcr.io
22+
username: ${{ github.actor }}
23+
password: ${{ secrets.GH_Token }}
24+
25+
# Build and tag the production Docker image
26+
- name: Build the Docker image
27+
run: |
28+
docker build . --file Dockerfile --tag ghcr.io/${{ github.repository }}:${{ github.sha }}
29+
if [ "${{ github.ref }}" == "refs/heads/master" ]; then
30+
docker tag ghcr.io/${{ github.repository }}:${{ github.sha }} ghcr.io/${{ github.repository }}:latest
31+
fi
32+
33+
# Push the production Docker image
34+
- name: Push the Docker image
35+
if: github.ref == 'refs/heads/master'
36+
run: |
37+
docker push ghcr.io/${{ github.repository }}:${{ github.sha }}
38+
docker push ghcr.io/${{ github.repository }}:latest

.github/workflows/test.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Test
2+
3+
on:
4+
push:
5+
branches: ["master"]
6+
pull_request:
7+
branches: ["master"]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Use the latest stable Node.js
17+
uses: actions/setup-node@v4
18+
with:
19+
node-version-file: '.nvmrc'
20+
cache: "npm"
21+
22+
- name: Install Dependencies
23+
run: npm ci
24+
25+
- name: Run Test
26+
run: npm run test

.gitignore

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
coverage
11+
node_modules
12+
dist
13+
build
14+
dist-ssr
15+
*.local
16+
.env
17+
18+
# Editor directories and files
19+
!.vscode/extensions.json
20+
.idea
21+
.DS_Store
22+
*.suo
23+
*.ntvs*
24+
*.njsproj
25+
*.sln
26+
*.sw?

.husky/pre-commit

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
npx lint-staged

.husky/pre-push

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
npm run build
5+
npm run test

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
22.11.0

0 commit comments

Comments
 (0)