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
3 changes: 3 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
NEXT_PUBLIC_HASURA_GRAPHQL_URL=<your_hasura_graphql_url_here>
NEXT_PUBLIC_POLL_INTERVAL=30000
NEXT_PUBLIC_HASURA_GRAPHQL_JWT_TOKEN=<your_jwt_token_here>
94 changes: 94 additions & 0 deletions .github/workflows/build-and-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
name: Build and Lint

on:
workflow_dispatch:
pull_request:
types:
- opened
- reopened
- synchronize
- ready_for_review

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
install:
name: Install Dependencies
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

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

- name: Cache node_modules
uses: actions/cache@v4
id: node-modules-cache
with:
path: |
node_modules
~/.npm
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-modules-

- name: Install dependencies
if: steps.node-modules-cache.outputs.cache-hit != 'true'
run: npm ci

lint:
name: Lint
needs: install
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

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

- name: Restore node_modules from cache
uses: actions/cache@v4
with:
path: |
node_modules
~/.npm
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-modules-

- name: Check formatting and lint
run: npm run check

build:
name: Build
needs: install
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

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

- name: Restore node_modules from cache
uses: actions/cache@v4
with:
path: |
node_modules
~/.npm
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-modules-

- name: Build
run: npm run build
33 changes: 0 additions & 33 deletions .github/workflows/build.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1 +1 @@
npx lint-staged
npm run lint-staged
4 changes: 0 additions & 4 deletions .lintstagedrc.js

This file was deleted.

5 changes: 5 additions & 0 deletions .lintstagedrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"*.{js,ts,cjs,mjs,d.cts,d.mts,jsx,tsx,json,jsonc}": [
"biome check --write --no-errors-on-unmatched"
]
}
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2024 Request Network
Copyright (c) 2025 Request Network

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ npm install
```

3. Configure the Hasura GraphQL endpoint in your `.env` file.
```bash
cp .env.example .env
```
Make sure to replace `<your_hasura_graphql_url_here>` and `<your_jwt_token_here>` in the `.env` file with your actual Hasura GraphQL URL and JWT token.

4. Start the development server:

Expand Down
81 changes: 44 additions & 37 deletions biome.json
Original file line number Diff line number Diff line change
@@ -1,39 +1,46 @@
{
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
"vcs": {
"enabled": false,
"clientKind": "git",
"useIgnoreFile": false
},
"files": {
"ignoreUnknown": false,
"ignore": []
},
"formatter": {
"enabled": true,
"indentStyle": "tab"
},
"organizeImports": {
"enabled": true
},
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"suspicious": {
"noExplicitAny": "off"
},
"style": {
"noNonNullAssertion": "off"
},
"complexity": {
"noForEach": "off"
}
}
},
"javascript": {
"formatter": {
"quoteStyle": "double"
}
}
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
"vcs": {
"enabled": false,
"clientKind": "git",
"useIgnoreFile": false
},
"files": {
"ignoreUnknown": false,
"ignore": ["dist/**/*", "node_modules/**/*", ".next/**/*"]
},
"formatter": {
"enabled": true,
"indentStyle": "space",
"indentWidth": 2
},
"organizeImports": {
"enabled": true
},
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"suspicious": {
"noExplicitAny": "off",
"noConsole": {
"level": "error",
"options": {
"allow": ["error", "warn", "info", "debug"]
}
}
},
"style": {
"noNonNullAssertion": "off"
},
"complexity": {
"noForEach": "off"
},
"correctness": {
"noUnusedImports": "error",
"noUnusedVariables": "error",
"useExhaustiveDependencies": "off"
}
}
}
}
2 changes: 1 addition & 1 deletion components.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
"components": "@/components",
"utils": "@/lib/utils"
}
}
}
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
{
"name": "request-scan",
"version": "0.2.11",
"version": "0.3.0",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint",
"format": "biome check --write .",
"lint": "biome lint --write",
"format": "biome format --write",
"check": "biome check --write",
"lint-staged": "lint-staged",
"prepare": "husky install"
},
"dependencies": {
Expand Down
22 changes: 11 additions & 11 deletions src/app/address/[id]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
/** @format */
'use client';
import { PaymentTable } from '@/components/payment-table';
import { RequestTable } from '@/components/request-table';
import { Button } from '@/components/ui/button';
"use client";
import { PaymentTable } from "@/components/payment-table";
import { RequestTable } from "@/components/request-table";
import { Button } from "@/components/ui/button";
import {
Card,
CardDescription,
CardHeader,
CardTitle,
} from '@/components/ui/card';
import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs';
import { useAddressPayments } from '@/lib/hooks/use-address-payments';
import { useAddressRequests } from '@/lib/hooks/use-address-requests';
import { PaginationState } from '@tanstack/react-table';
import { Copy } from 'lucide-react';
import { useState } from 'react';
} from "@/components/ui/card";
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
import { useAddressPayments } from "@/lib/hooks/use-address-payments";
import { useAddressRequests } from "@/lib/hooks/use-address-requests";
import type { PaginationState } from "@tanstack/react-table";
import { Copy } from "lucide-react";
import { useState } from "react";

interface AddressPageProps {
params: {
Expand Down
2 changes: 1 addition & 1 deletion src/app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,4 @@
body {
@apply bg-background text-foreground;
}
}
}
10 changes: 5 additions & 5 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
import type { Metadata } from "next";
import { Montserrat } from "next/font/google";
import "./globals.css";
import { cn } from "@/lib/utils";
import Header from "@/components/header";
import { Footer } from "@/components/footer";
import Providers from "./providers";
import { Suspense } from "react";
import Header from "@/components/header";
import { cn } from "@/lib/utils";
import { GoogleTagManager } from "@next/third-parties/google";
import { Suspense } from "react";
import Providers from "./providers";

const montserrat = Montserrat({ subsets: ["latin"], variable: "--font-sans" });

Expand All @@ -28,7 +28,7 @@ export default function RootLayout({
<body
className={cn(
"min-h-screen bg-background font-sans antialiased",
montserrat.variable
montserrat.variable,
)}
>
<Providers>
Expand Down
4 changes: 2 additions & 2 deletions src/app/not-found/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import {
CardFooter,
CardHeader,
CardTitle,
} from '@/components/ui/card';
import Link from 'next/link';
} from "@/components/ui/card";
import Link from "next/link";

export default function NotFoundPage() {
return (
Expand Down
6 changes: 3 additions & 3 deletions src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { RecentArea } from "@/components/recent-area";
/** @format */
import { SearchArea } from '@/components/search-area';
import { StatsArea } from '@/components/stats-area';
import { RecentArea } from '@/components/recent-area';
import { SearchArea } from "@/components/search-area";
import { StatsArea } from "@/components/stats-area";

export default function Home() {
return (
Expand Down
10 changes: 5 additions & 5 deletions src/app/payments/page.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/** @format */
'use client';
"use client";

import { PaymentTable } from '@/components/payment-table';
import { useLatestPayments } from '@/lib/hooks/use-latest-payments';
import { PaginationState } from '@tanstack/react-table';
import { useState } from 'react';
import { PaymentTable } from "@/components/payment-table";
import { useLatestPayments } from "@/lib/hooks/use-latest-payments";
import type { PaginationState } from "@tanstack/react-table";
import { useState } from "react";

export default function PaymentsPage() {
const [pagination, setPagination] = useState<PaginationState>({
Expand Down
Loading