-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #65 from 8iq/v_0.0.2_alpha
V 0.0.2 alpha
- Loading branch information
Showing
86 changed files
with
15,359 additions
and
105 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
root = true | ||
|
||
[*] | ||
end_of_line = lf | ||
insert_final_newline = true | ||
|
||
[*.{js,jsx,ts,tsx}] | ||
charset = utf-8 | ||
indent_style = space | ||
indent_size = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
#DATABASE_URL=mongodb://mongo:mongo@127.0.0.1/main?authSource=admin | ||
#DATABASE_URL=postgresql://postgres:postgres@127.0.0.1/main | ||
#DATABASE_URL=postgresql://postgres:postgres@127.0.0.1:5432/main | ||
#REDIS_URL=redis://127.0.0.1:6379/1 | ||
NODE_ENV=development |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Add files here to ignore them from prettier formatting | ||
/dist | ||
/coverage | ||
/.nx/cache | ||
.pnp.* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"singleQuote": true, | ||
"trailingComma": "all", | ||
"semi": false | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/** @type {import("eslint").Linter.Config} */ | ||
module.exports = { | ||
root: true, | ||
extends: ["@repo/eslint-config/next.js"], | ||
parser: "@typescript-eslint/parser", | ||
parserOptions: { | ||
project: true, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# `web` | ||
|
||
Simple Front-End WEB app example | ||
|
||
# What do you need to change? | ||
|
||
1. You need to stats from `providers.tsx` logic and | ||
create your own `AuthProvider` and `DataProvider` and `resources`. | ||
|
||
DOCS: https://refine.dev/docs/data/data-provider/ | ||
|
||
2. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
'use server' | ||
|
||
import { Show } from '@repo/ui/refine/antd' | ||
|
||
import { Layout } from 'web/components/Layout' | ||
import { getTranslate } from 'web/providers/i18n/server' | ||
|
||
export default async function DashboardPage(): Promise<React.JSX.Element> { | ||
const translate = await getTranslate() | ||
const titleMessage = translate('dashboard.title', 'Dashboard') | ||
return ( | ||
<Layout> | ||
<Show headerButtons={[]} title={titleMessage}> | ||
<h1>{titleMessage}</h1> | ||
</Show> | ||
</Layout> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
'use client' | ||
|
||
import { AuthPage } from '@repo/ui/refine/antd' | ||
import { useParsed } from '@repo/ui/refine/core' | ||
import React from 'react' | ||
|
||
import { BrandTitle } from 'web/components/BrandTitle' | ||
|
||
interface QueryProps { | ||
email?: string | ||
} | ||
|
||
export default function ForgotPasswordPage(): React.JSX.Element { | ||
const { params } = useParsed<QueryProps>() | ||
|
||
const emailFromSearchParams = params?.email | ||
|
||
const initialValues = emailFromSearchParams | ||
? { email: emailFromSearchParams } | ||
: undefined | ||
|
||
return ( | ||
<AuthPage | ||
type="forgotPassword" | ||
formProps={{ initialValues }} | ||
title={<BrandTitle collapsed={false} />} | ||
/> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
:root { | ||
--max-width: 1100px; | ||
--border-radius: 12px; | ||
--font-mono: ui-monospace, Menlo, Monaco, "Cascadia Mono", "Segoe UI Mono", | ||
"Roboto Mono", "Oxygen Mono", "Ubuntu Monospace", "Source Code Pro", | ||
"Fira Mono", "Droid Sans Mono", "Courier New", monospace; | ||
|
||
--foreground-rgb: 255, 255, 255; | ||
--background-start-rgb: 0, 0, 0; | ||
--background-end-rgb: 0, 0, 0; | ||
|
||
--callout-rgb: 20, 20, 20; | ||
--callout-border-rgb: 108, 108, 108; | ||
--card-rgb: 100, 100, 100; | ||
--card-border-rgb: 200, 200, 200; | ||
|
||
--glow-conic: conic-gradient( | ||
from 180deg at 50% 50%, | ||
#2a8af6 0deg, | ||
#a853ba 180deg, | ||
#e92a67 360deg | ||
); | ||
} | ||
|
||
html, | ||
body { | ||
max-width: 100vw; | ||
overflow-x: hidden; | ||
} | ||
|
||
body { | ||
color: rgb(var(--foreground-rgb)); | ||
background: linear-gradient( | ||
to bottom, | ||
transparent, | ||
rgb(var(--background-end-rgb)) | ||
) rgb(var(--background-start-rgb)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { dir, getLocale } from '@repo/i18n/server' | ||
import { Inter } from 'next/font/google' | ||
|
||
import './globals.css' | ||
import React from 'react' | ||
import { Providers } from './providers' | ||
|
||
const inter = Inter({ subsets: ['latin'] }) | ||
|
||
export default async function RootLayout({ | ||
children, | ||
}: { | ||
children: React.ReactNode | ||
}): Promise<React.JSX.Element> { | ||
const locale = await getLocale() | ||
const theme = 'dark' | ||
|
||
return ( | ||
<html lang={locale} dir={dir(locale)}> | ||
<body className={inter.className}> | ||
<Providers locale={locale} theme={theme}>{children}</Providers> | ||
</body> | ||
</html> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
'use client' | ||
|
||
import { GithubOutlined, GoogleOutlined } from '@repo/ui/icons' | ||
import { AuthPage } from '@repo/ui/refine/antd' | ||
import { useLogin, useParsed, useTranslate } from '@repo/ui/refine/core' | ||
import React, { useEffect } from 'react' | ||
|
||
import { BrandTitle } from 'web/components/BrandTitle' | ||
|
||
interface QueryProps { | ||
email?: string | ||
accessToken?: string | ||
refreshToken?: string | ||
} | ||
|
||
export default function LoginPage(): React.JSX.Element { | ||
const { params } = useParsed<QueryProps>() | ||
const { mutate } = useLogin() | ||
const translate = useTranslate() | ||
|
||
const emailFromSearchParams = params?.email | ||
const accessToken = params?.accessToken | ||
const refreshToken = params?.refreshToken | ||
|
||
const initialValues = emailFromSearchParams | ||
? { email: emailFromSearchParams } | ||
: undefined | ||
|
||
useEffect(() => { | ||
if (accessToken && refreshToken) { | ||
mutate({ | ||
accessToken, | ||
refreshToken, | ||
}) | ||
} | ||
}, [accessToken, refreshToken]) | ||
|
||
return ( | ||
<AuthPage | ||
type="login" | ||
formProps={{ initialValues }} | ||
title={<BrandTitle collapsed={false} />} | ||
providers={[ | ||
{ | ||
name: 'google', | ||
label: translate('pages.login.google', 'Sign in with Google'), | ||
icon: ( | ||
<GoogleOutlined | ||
style={{ | ||
fontSize: 24, | ||
lineHeight: 0, | ||
}} | ||
/> | ||
), | ||
}, | ||
{ | ||
name: 'github', | ||
label: translate('pages.login.github', 'Sign in with GitHub'), | ||
icon: ( | ||
<GithubOutlined | ||
style={{ | ||
fontSize: 24, | ||
lineHeight: 0, | ||
}} | ||
/> | ||
), | ||
}, | ||
]} | ||
/> | ||
) | ||
} |
Oops, something went wrong.