Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
58 changes: 58 additions & 0 deletions .github/workflows/ui.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: UI

on:
push:
branches: [ master ]
paths: ['ui/**']
pull_request:
branches: [ master ]
paths: ['ui/**']

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./ui
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: ui/package-lock.json
- run: npm ci
- run: npm run lint

type-check:
name: Type Check
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./ui
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: ui/package-lock.json
- run: npm ci
- run: npx tsc --noEmit

build:
name: Build
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./ui
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: ui/package-lock.json
- run: npm ci
- run: npm run build
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Rust
/target/

# NextJS
/ui/.next
/ui/node_modules

# Local Dev
/data/

Expand All @@ -14,4 +18,4 @@ Thumbs.db

# Environment variables
.env
.env.local
/ui/.env
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,6 @@ The main entry point that provides a JSON-RPC API for receiving transactions and

### 🔨 Maintenance (`crates/maintenance`)
A service that maintains the health of the TIPS DataStore, by removing stale or included bundles.

### 🖥️ UI (`ui`)
A debug UI for viewing the state of the bundle store and S3.
19 changes: 17 additions & 2 deletions justfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,34 @@
### DEVELOPMENT COMMANDS ###
ci:
# Rust
cargo fmt --all -- --check
cargo clippy -- -D warnings
cargo build
cargo test
# UI
cd ui && npm run lint
cd ui && npm run build

fix:
# Rust
cargo fmt --all
cargo clippy --fix --allow-dirty --allow-staged
# UI
cd ui && npx biome check --fix

create-migration name:
touch crates/datastore/migrations/$(date +%s)_{{ name }}.sql

sync:
sync: deps-reset
### DATABASE ###
cargo sqlx prepare -D postgresql://postgres:postgres@localhost:5432/postgres --workspace --all --no-dotenv
cd ui && npx drizzle-kit pull --dialect=postgresql --url=postgresql://postgres:postgres@localhost:5432/postgres
cd ui && mv ./drizzle/relations.ts ./src/db/
cd ui && mv ./drizzle/schema.ts ./src/db/
cd ui && rm -rf ./drizzle
### ENV ###
cp .env.example .env
cp .env.example ./ui/.env

### RUN SERVICES ###
deps-reset:
Expand All @@ -32,4 +44,7 @@ ingress:
cargo run --bin tips-ingress

maintenance:
cargo run --bin tips-maintenance
cargo run --bin tips-maintenance

ui:
cd ui && yarn dev
41 changes: 41 additions & 0 deletions ui/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/versions

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

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

# env files (can opt-in for committing if needed)
.env*

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts
37 changes: 37 additions & 0 deletions ui/biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"$schema": "https://biomejs.dev/schemas/2.2.0/schema.json",
"vcs": {
"enabled": true,
"clientKind": "git",
"useIgnoreFile": true
},
"files": {
"ignoreUnknown": true,
"includes": ["**", "!node_modules", "!.next", "!dist", "!build"]
},
"formatter": {
"enabled": true,
"indentStyle": "space",
"indentWidth": 2
},
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"suspicious": {
"noUnknownAtRules": "off"
}
},
"domains": {
"next": "recommended",
"react": "recommended"
}
},
"assist": {
"actions": {
"source": {
"organizeImports": "on"
}
}
}
}
12 changes: 12 additions & 0 deletions ui/drizzle.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { defineConfig } from "drizzle-kit";

export default defineConfig({
schema: "./src/db/schema.ts",
out: "./drizzle",
dialect: "postgresql",
dbCredentials: {
url:
process.env.TIPS_DATABASE_URL ||
"postgresql://postgres:postgres@localhost:5432/postgres",
},
});
7 changes: 7 additions & 0 deletions ui/next.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import type { NextConfig } from "next";

const nextConfig: NextConfig = {
/* config options here */
};

export default nextConfig;
Loading
Loading