Skip to content

Commit

Permalink
feat: Dashboard (#141)
Browse files Browse the repository at this point in the history
  • Loading branch information
darioAnongba authored Nov 17, 2024
1 parent ceee57a commit 4435800
Show file tree
Hide file tree
Showing 1,016 changed files with 55,286 additions and 15 deletions.
Binary file modified .DS_Store
Binary file not shown.
4 changes: 2 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
RUN_MODE=development

# Database migrations
DATABASE_URL="postgres://postgres:postgres@localhost/numeraire"
DATABASE_URL="HERE_YOUR_DATABASE_URL"

# Database
SWISSKNIFE_DATABASE__URL="postgres://postgres:postgres@localhost/numeraire"
SWISSKNIFE_DATABASE__URL="HERE_YOUR_DATABASE_URL"

# Breez
SWISSKNIFE_BREEZ_CONFIG__API_KEY="HERE_YOUR_API_KEY"
Expand Down
39 changes: 26 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,32 @@ jobs:
- run: make lint
- run: make fmt

test:
lint-dashboard:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./dashboard

steps:
- uses: actions/checkout@v4
- uses: actions/cache@v3
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- run: sudo apt-get update && sudo apt-get install -y protobuf-compiler
- uses: dtolnay/rust-toolchain@stable
- run: cargo test --all-features
node-version: "20"

- name: Enable Corepack
run: corepack enable

- name: Install dependencies
run: yarn install

- name: Run ESLint
run: yarn lint

- name: Run Prettier
run: yarn fm:check

- name: Run Typecheck
run: yarn ts
60 changes: 60 additions & 0 deletions dashboard/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Node modules directory
node_modules
node_modules/

# Dependency directories
bower_components
jspm_packages

# Log files
*.log
npm-debug.log*

# Next.js build output
.next
out
dist

# Production build
/build

# Miscellaneous
.DS_Store
*.pem
*.pid
*.seed
*.pid.lock

# dotenv environment variables file
.env.local
.env.development.local
.env.test.local
.env.production.local

# Editor directories and files
.vscode
.idea
*.suo
*.ntvs*
*.njsproj
*.sln

# OS-specific files
Thumbs.db
Desktop.ini

# Coverage directory used by tools like istanbul
coverage
coverage/

# Git directories and files
.git
.gitignore
.gitattributes

# Docker files
Dockerfile
docker-compose.yml

# Build scripts and configurations
scripts/
9 changes: 9 additions & 0 deletions dashboard/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
root = true

[*]
charset = utf-8
indent_size = 2
end_of_line = lf
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
3 changes: 3 additions & 0 deletions dashboard/.env.development
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
LN_PROVIDER=cln
NEXT_PUBLIC_SERVER_URL=http://localhost:3000
NEXT_PUBLIC_AUTH_METHOD=jwt
18 changes: 18 additions & 0 deletions dashboard/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
LN_PROVIDER=breez

# App
NEXT_PUBLIC_BASE_PATH=
NEXT_PUBLIC_SERVER_URL=
NEXT_PUBLIC_ASSET_URL=
NEXT_PUBLIC_AUTH_METHOD=
NEXT_PUBLIC_SITENAME=

# Auth0
NEXT_PUBLIC_AUTH0_DOMAIN=
NEXT_PUBLIC_AUTH0_CLIENT_ID=
NEXT_PUBLIC_AUTH0_CALLBACK_URL=
NEXT_PUBLIC_AUTH0_AUDIENCE=

# Supabase
NEXT_PUBLIC_SUPABASE_URL=
NEXT_PUBLIC_SUPABASE_ANON_KEY=
12 changes: 12 additions & 0 deletions dashboard/.env.production
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
LN_PROVIDER=cln

# App
NEXT_PUBLIC_SERVER_URL=https://api.numeraire.tech
NEXT_PUBLIC_AUTH_METHOD=auth0
NEXT_PUBLIC_SITENAME="Numeraire Dashboard"

# Auth0
NEXT_PUBLIC_AUTH0_DOMAIN=auth.numeraire.tech
NEXT_PUBLIC_AUTH0_CLIENT_ID=7Jh0DPs8JoAHNrdTbIYKVDty7YNPWbSM
NEXT_PUBLIC_AUTH0_CALLBACK_URL=https://app.numeraire.tech/login/callback
NEXT_PUBLIC_AUTH0_AUDIENCE=https://swissknife.numeraire.tech/api/v1
48 changes: 48 additions & 0 deletions dashboard/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Build directories

build/_
dist/_
public/_
\*\*/out/_
**/.next/\*
**/node_modules/\*

# src/

**/reportWebVitals.\*
**/service-worker._
\*\*/serviceWorkerRegistration._ \*_/setupTests._

# eslintrc

\*_/.eslintrc._

# prettier

**/.prettier.\*
**/prettier.config.\*

# next

\*_/next.config._

# vite

\*_/vite.config._

# tailwind

**/postcss.config.\*
**/tailwind.config.\*

# craco

\*_/craco.config._

# misc

\*\*/jsconfig.json

# openapi

src/lib/swissknife/types.gen.ts
109 changes: 109 additions & 0 deletions dashboard/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
/**
* @type {import('eslint').ESLint.ConfigData}
*/
module.exports = {
root: true,
env: { browser: true, es2020: true },
plugins: ['perfectionist', 'unused-imports', '@typescript-eslint', 'prettier'],
extends: ['airbnb', 'airbnb-typescript', 'airbnb/hooks', 'prettier'],
parserOptions: {
sourceType: 'module',
ecmaVersion: 'latest',
ecmaFeatures: { jsx: true },
project: './tsconfig.json',
},
settings: {
'import/resolver': {
typescript: {
project: './tsconfig.json',
},
},
},
/**
* 0 ~ 'off'
* 1 ~ 'warn'
* 2 ~ 'error'
*/
rules: {
// general
'no-alert': 0,
camelcase: 0,
'no-console': 0,
'no-unused-vars': 0,
'no-nested-ternary': 0,
'no-param-reassign': 0,
'no-underscore-dangle': 0,
'no-restricted-exports': 0,
'no-promise-executor-return': 0,
'import/prefer-default-export': 0,
'prefer-destructuring': [1, { object: true, array: false }],
// typescript
'@typescript-eslint/naming-convention': 0,
'@typescript-eslint/no-use-before-define': 0,
'@typescript-eslint/consistent-type-exports': 1,
'@typescript-eslint/consistent-type-imports': 1,
'@typescript-eslint/no-unused-vars': [1, { args: 'none' }],
// react
'react/no-children-prop': 0,
'react/react-in-jsx-scope': 0,
'react/no-array-index-key': 0,
'react/require-default-props': 0,
'react/jsx-props-no-spreading': 0,
'react/function-component-definition': 0,
'react/jsx-no-useless-fragment': [1, { allowExpressions: true }],
'react/no-unstable-nested-components': [1, { allowAsProps: true }],
'react/jsx-no-duplicate-props': [1, { ignoreCase: false }],
// jsx-a11y
'jsx-a11y/anchor-is-valid': 0,
'jsx-a11y/control-has-associated-label': 0,
// unused imports
'unused-imports/no-unused-imports': 1,
'unused-imports/no-unused-vars': [
0,
{ vars: 'all', varsIgnorePattern: '^_', args: 'after-used', argsIgnorePattern: '^_' },
],
// perfectionist
'perfectionist/sort-exports': [1, { order: 'asc', type: 'line-length' }],
'perfectionist/sort-named-imports': [1, { order: 'asc', type: 'line-length' }],
'perfectionist/sort-named-exports': [1, { order: 'asc', type: 'line-length' }],
'perfectionist/sort-imports': [
1,
{
order: 'asc',
type: 'line-length',
'newlines-between': 'always',
groups: [
'style',
'type',
['builtin', 'external'],
'custom-mui',
'custom-routes',
'custom-hooks',
'custom-utils',
'internal',
'custom-components',
'custom-sections',
'custom-auth',
'custom-types',
['parent', 'sibling', 'index'],
['parent-type', 'sibling-type', 'index-type'],
'object',
'unknown',
],
'custom-groups': {
value: {
['custom-mui']: '@mui/**',
['custom-auth']: 'src/auth/**',
['custom-hooks']: 'src/hooks/**',
['custom-utils']: 'src/utils/**',
['custom-types']: 'src/types/**',
['custom-routes']: 'src/routes/**',
['custom-sections']: 'src/sections/**',
['custom-components']: 'src/components/**',
},
},
'internal-pattern': ['src/**'],
},
],
},
};
4 changes: 4 additions & 0 deletions dashboard/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/.yarn/** linguist-vendored
/.yarn/releases/* binary
/.yarn/plugins/**/* binary
/.pnp.* binary linguist-generated
38 changes: 38 additions & 0 deletions dashboard/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# dependencies
node_modules
.pnp
.pnp.js

# testing
coverage

# production
.next
.swc
_static
out
dist
build

# environment variables
.env*.local

# misc
.DS_Store
.vercel
.netlify
.vscode
.eslintcache
.unimportedrc.json
tsconfig.tsbuildinfo

# Exclude PWA service worker and workbox files
public/sw.js
public/workbox-*.js
11 changes: 11 additions & 0 deletions dashboard/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Build directories
build/*
dist/*
public/*
**/out/*
**/.next/*
**/node_modules/*

yarn.lock
package-lock.json
jsconfig.json
Binary file added dashboard/.yarn/install-state.gz
Binary file not shown.
1 change: 1 addition & 0 deletions dashboard/.yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodeLinker: node-modules
Loading

0 comments on commit 4435800

Please sign in to comment.