Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add fe folder #8

Merged
merged 26 commits into from
Nov 15, 2024
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
18 changes: 18 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
root = true

[*]
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.{diff,md}]
trim_trailing_whitespace = false

[*.{cjs,js,json,proto,ts,yaml,yml}]
indent_style = space
indent_size = 2

[*.rs]
indent_style = space
indent_size = 4
39 changes: 39 additions & 0 deletions .github/workflows/fe-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
on:
push:
branches:
- 'master'

permissions:
contents: write

concurrency:
group: 'pages'
cancel-in-progress: true

jobs:
fe-build-and-deploy:
runs-on: ubuntu-latest
defaults:
run:
working-directory: 'solfees-fe'
steps:
- name: 🔄 Checkout Code
uses: actions/checkout@v4
- name: 📦 Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9
- name: 🔧 Install node
uses: actions/setup-node@v4
with:
node-version: 22
cache: 'pnpm'
cache-dependency-path: "solfees-fe"
- name: 📁 Install node_modules
run: pnpm install
- name: ️🏗️ Build application
run: pnpm build
- name: 🚀 Deploy
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: solfees-fe/dist
11 changes: 9 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
/target
/test-ledger
# Rust
target

# Solana
test-ledger

# Redis
dump.rdb

# IDE, configs
.idea
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,6 @@ The minor version will be incremented upon a breaking change and the patch versi
- metrics: add requests queue size ([#7](https://github.com/solana-stream-solutions/solfees/pull/7))
- api: optimize getLeaderSchedule ([#9](https://github.com/solana-stream-solutions/solfees/pull/9))
- geyser: wait all transactions before process block ([#10](https://github.com/solana-stream-solutions/solfees/pull/10))
- frontend: init ([#8](https://github.com/solana-stream-solutions/solfees/pull/8))

### Breaking
11 changes: 11 additions & 0 deletions solfees-fe/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.git
.vscode
.dockerignore
.gitignore
.env
config
build
node_modules
docker-compose.yaml
Dockerfile
README.md
1 change: 1 addition & 0 deletions solfees-fe/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VITE_APP_ENVIRONMENT="development"
35 changes: 35 additions & 0 deletions solfees-fe/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

# folder for build or artifacts
node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
!.vscode/launch.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
/test-results/
/playwright-report/
/playwright/.cache/

# storybook
storybook-static

# tests
/coverage/
1 change: 1 addition & 0 deletions solfees-fe/.husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
cd solfees-fe && pnpm exec commitlint --edit "$1"
1 change: 1 addition & 0 deletions solfees-fe/.husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
cd solfees-fe && pnpm exec lint-staged
3 changes: 3 additions & 0 deletions solfees-fe/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.husky
/src/routeTree.gen.ts
/pnpm-lock.yaml
26 changes: 26 additions & 0 deletions solfees-fe/.storybook/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import type { StorybookConfig } from "@storybook/react-vite";
const config: StorybookConfig = {
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|ts|tsx)"],
addons: [
"@storybook/addon-links",
"@storybook/addon-essentials",
"@storybook/addon-interactions",
"@storybook/addon-styling",
{
name: "@storybook/addon-styling",
options: {},
},
{
name: "@storybook/addon-styling",
options: {},
},
],
framework: {
name: "@storybook/react-vite",
options: {},
},
docs: {
autodocs: "tag",
},
};
export default config;
31 changes: 31 additions & 0 deletions solfees-fe/.storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { withThemeByClassName } from "@storybook/addon-themes";
import type { Preview } from "@storybook/react";

/* TODO: update import to your tailwind styles file. If you're using Angular, inject this through your angular.json config instead */
import "../src/styles/tailwind.css";

const preview: Preview = {
parameters: {
actions: { argTypesRegex: "^on[A-Z].*" },
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/,
},
},
},

decorators: [
// Adds theme switching support.
// NOTE: requires setting "darkMode" to "class" in your tailwind config
withThemeByClassName({
themes: {
light: "light",
dark: "dark",
},
defaultTheme: "light",
}),
],
};

export default preview;
9 changes: 9 additions & 0 deletions solfees-fe/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM nginx:stable-alpine

WORKDIR /app

COPY . .

RUN cp -r /app/dist/* /usr/share/nginx/html

EXPOSE 80
1 change: 1 addition & 0 deletions solfees-fe/commitlint.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = { extends: ["@commitlint/config-conventional"] };
Loading