Skip to content

Commit

Permalink
feat: first commit.:
Browse files Browse the repository at this point in the history
  • Loading branch information
PaoloRollo committed Mar 15, 2024
0 parents commit 1b4b274
Show file tree
Hide file tree
Showing 18 changed files with 9,479 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "next/core-web-vitals"
}
38 changes: 38 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js
.yarn/install-state.gz

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

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

# local env files
.env*.local
.env

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts
.vscode/
36 changes: 36 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).

## Getting Started

First, run the development server:

```bash
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev
```

Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.

You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.

This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font.

## Learn More

To learn more about Next.js, take a look at the following resources:

- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.

You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!

## Deploy on Vercel

The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.

Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
Binary file added app/favicon.ico
Binary file not shown.
33 changes: 33 additions & 0 deletions app/globals.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
@tailwind base;
@tailwind components;
@tailwind utilities;

:root {
--foreground-rgb: 0, 0, 0;
--background-start-rgb: 214, 219, 220;
--background-end-rgb: 255, 255, 255;
}

@media (prefers-color-scheme: dark) {
:root {
--foreground-rgb: 255, 255, 255;
--background-start-rgb: 0, 0, 0;
--background-end-rgb: 0, 0, 0;
}
}

body {
color: rgb(var(--foreground-rgb));
background: linear-gradient(
to bottom,
transparent,
rgb(var(--background-end-rgb))
)
rgb(var(--background-start-rgb));
}

@layer utilities {
.text-balance {
text-wrap: balance;
}
}
29 changes: 29 additions & 0 deletions app/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import type { Metadata } from "next";
import { Raleway } from "next/font/google";
import "./globals.css";
import Providers from "@/components/shared/providers";

const raleway = Raleway({ subsets: ["latin"] });

export const metadata: Metadata = {
title: "fluidpay",
description: "Seamlessly pay from different stealth addresses.",
};

export default function RootLayout({
children,
}: Readonly<{
children: React.ReactNode;
}>) {
return (
<html lang="en" className="dark">
<body className={raleway.className}>
<Providers>
<main className="max-w-sm mx-auto border-x w-full h-screen border-[#232324] px-4">
{children}
</main>
</Providers>
</body>
</html>
);
}
5 changes: 5 additions & 0 deletions app/onboarding/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export default function Onboarding() {
return <div className="flex flex-col">

</div>;
}
39 changes: 39 additions & 0 deletions app/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
"use client";
import {
DynamicConnectButton,
useDynamicContext,
} from "@dynamic-labs/sdk-react-core";
import { useGetUser, useIsAddressRegistered } from "@sefu/react-sdk";
import { redirect } from "next/navigation";
import { useDisconnect, useConnect, useAccount } from "wagmi";

export default function Home() {
const { status } = useAccount();
const { connectors, connect, error } = useConnect();
const { disconnect } = useDisconnect();
const { walletConnector, isAuthenticated, isFullyConnected, user } =
useDynamicContext();
const { user: fkeyUser } = useGetUser({ pollingOnStatusImporting: false });
const { isAddressRegistered } = useIsAddressRegistered(
user?.wallet as `0x${string}`
);

console.log(user);

if (user) {
if (user.newUser && !isAddressRegistered) {
return redirect("/onboarding");
}
}

return (
<main className="flex flex-col items-center justify-center h-full space-y-8">
<h1 className="font-bold text-7xl">
<span className="text-primary">fluid</span>pay
</h1>
<DynamicConnectButton buttonClassName="bg-primary px-4 py-2 rounded-lg font-semibold">
Enter
</DynamicConnectButton>
</main>
);
}
Binary file added bun.lockb
Binary file not shown.
51 changes: 51 additions & 0 deletions components/shared/providers.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
"use client";

import { DynamicContextProvider } from "@dynamic-labs/sdk-react-core";
import { type ReactNode } from "react";
import { EthereumWalletConnectors } from "@dynamic-labs/ethereum";
import { DynamicWagmiConnector } from "@dynamic-labs/wagmi-connector";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import { createConfig, WagmiProvider } from "wagmi";
import { http } from "viem";
import { base } from "viem/chains";
import { FluidkeyClient, FluidkeyProvider } from "@sefu/react-sdk";

const sefuClient = new FluidkeyClient({
clientId: process.env.NEXT_PUBLIC_FLUIDKEY_APP_ID!,
clientKey: process.env.NEXT_PUBLIC_FLUIDKEY_APP_KEY!,
isExperimental: true,
});

const config = createConfig({
chains: [base],
multiInjectedProviderDiscovery: false,
// @ts-expect-error
transports: {
// @ts-ignore
[base.id]: http(),
},
});

const queryClient = new QueryClient();

const environmentId = process.env.NEXT_PUBLIC_DYNAMIC_ENV_ID!;

export default function Providers(props: { children: ReactNode }) {
return (
<FluidkeyProvider client={sefuClient}>
<DynamicContextProvider
settings={{
environmentId,
walletConnectors: [EthereumWalletConnectors],
// hideEmbeddedWalletTransactionUIs: true,
}}
>
<WagmiProvider config={config}>
<QueryClientProvider client={queryClient}>
<DynamicWagmiConnector>{props.children}</DynamicWagmiConnector>
</QueryClientProvider>
</WagmiProvider>
</DynamicContextProvider>
</FluidkeyProvider>
);
}
4 changes: 4 additions & 0 deletions next.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/** @type {import('next').NextConfig} */
const nextConfig = {};

export default nextConfig;
43 changes: 43 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"name": "fluidpay",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint"
},
"dependencies": {
"@dynamic-labs/ethereum": "^2.0.0-alpha.10",
"@dynamic-labs/sdk-react-core": "^2.0.0-alpha.10",
"@dynamic-labs/wagmi-connector": "^2.0.0-alpha.10",
"@nextui-org/react": "^2.2.10",
"@sefu/react-sdk": "^0.2.30",
"@tanstack/react-query": "^5.28.4",
"framer-motion": "^11.0.14",
"lucide-react": "^0.358.0",
"next": "14.1.3",
"react": "^18",
"react-dom": "^18",
"viem": "^2.8.9",
"wagmi": "^2.5.7"
},
"devDependencies": {
"@types/node": "^20",
"@types/react": "^18",
"@types/react-dom": "^18",
"@wagmi/cli": "^2.1.2",
"autoprefixer": "^10.0.1",
"bufferutil": "^4.0.8",
"eslint": "^8",
"eslint-config-next": "14.1.3",
"lokijs": "^1.5.12",
"pino-pretty": "^10.3.1",
"postcss": "^8",
"supports-color": "^9.4.0",
"tailwindcss": "^3.3.0",
"typescript": "^5",
"utf-8-validate": "^6.0.3"
}
}
6 changes: 6 additions & 0 deletions postcss.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
};
1 change: 1 addition & 0 deletions public/next.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions public/vercel.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
41 changes: 41 additions & 0 deletions tailwind.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import type { Config } from "tailwindcss";
const { nextui } = require("@nextui-org/react");

const config: Config = {
content: [
"./app/**/*.{js,ts,jsx,tsx,mdx}",
"./pages/**/*.{js,ts,jsx,tsx,mdx}",
"./components/**/*.{js,ts,jsx,tsx,mdx}",
"./node_modules/@nextui-org/theme/dist/**/*.{js,ts,jsx,tsx}",
],
theme: {
extend: {
colors: {
primary: "#0061FF",
},
backgroundImage: {
"gradient-radial": "radial-gradient(var(--tw-gradient-stops))",
"gradient-conic":
"conic-gradient(from 180deg at 50% 50%, var(--tw-gradient-stops))",
},
},
},
darkMode: "class",
plugins: [
nextui({
themes: {
light: {
colors: {
primary: "#0061FF",
},
},
dark: {
colors: {
primary: "#0061FF",
},
},
},
}),
],
};
export default config;
26 changes: 26 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"compilerOptions": {
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
"noEmit": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "bundler",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"incremental": true,
"plugins": [
{
"name": "next"
}
],
"paths": {
"@/*": ["./*"]
}
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
"exclude": ["node_modules"]
}
Loading

0 comments on commit 1b4b274

Please sign in to comment.