-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 05da18c
Showing
62 changed files
with
7,216 additions
and
0 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,13 @@ | ||
|
||
root = true | ||
|
||
[*] | ||
indent_style = tab | ||
indent_size = 2 | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
[*.yml] | ||
indent_style = space |
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,3 @@ | ||
NEXT_PUBLIC_API_URL= | ||
|
||
DISCORD_LINK_AUTH= |
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,34 @@ | ||
{ | ||
"root": true, | ||
"plugins": [ | ||
"@typescript-eslint/eslint-plugin", | ||
"eslint-plugin-import-helpers", | ||
"prettier", | ||
"react", | ||
"react-hooks" | ||
], | ||
"extends": [ | ||
"eslint:recommended", | ||
"plugin:prettier/recommended", | ||
"prettier", | ||
"plugin:@typescript-eslint/recommended", | ||
"plugin:react/recommended", | ||
"next" | ||
], | ||
"rules": { | ||
"prettier/prettier": [ | ||
"error", | ||
{ | ||
"singleQuote": false | ||
} | ||
], | ||
"import-helpers/order-imports": [ | ||
"warn", | ||
{ | ||
"newlinesBetween": "always", | ||
"groups": ["module", ["parent", "sibling", "index"]], | ||
"alphabetize": { "order": "asc", "ignoreCase": 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,27 @@ | ||
name: tests | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
tests: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Install Dependencies | ||
run: yarn | ||
|
||
- name: Run ESLint | ||
run: yarn lint | ||
|
||
- name: Test TypeScript Syntax | ||
run: yarn type-check | ||
|
||
- name: Build | ||
run: yarn build |
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,41 @@ | ||
# dependencies | ||
/node_modules | ||
/.pnp | ||
.pnp.js | ||
|
||
# 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 | ||
|
||
# vercel | ||
.vercel | ||
|
||
# typescript | ||
*.tsbuildinfo | ||
next-env.d.ts | ||
|
||
# PWA | ||
/public/sw.js | ||
/public/workbox-*.js | ||
/public/worker-*.js | ||
/public/sw.js.map | ||
/public/workbox-*.js.map | ||
/public/worker-*.js.map |
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,3 @@ | ||
{ | ||
"cSpell.words": ["medkit", "tanstack", "toastify"] | ||
} |
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,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. |
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,20 @@ | ||
/** @type {import('next').NextConfig} */ | ||
|
||
// eslint-disable-next-line @typescript-eslint/no-var-requires | ||
const withPWA = require("next-pwa")({ | ||
dest: "public", | ||
register: true, | ||
skipWaiting: true, | ||
}); | ||
|
||
const nextConfig = withPWA({ | ||
output: "export", | ||
eslint: { | ||
ignoreDuringBuilds: true, | ||
}, | ||
typescript: { | ||
ignoreBuildErrors: true, | ||
}, | ||
}); | ||
|
||
module.exports = nextConfig; |
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,49 @@ | ||
{ | ||
"name": "front", | ||
"version": "0.1.0", | ||
"private": true, | ||
"dependencies": { | ||
"@hookform/resolvers": "^3.3.1", | ||
"@tanstack/react-query": "^4.35.3", | ||
"@tanstack/react-query-devtools": "^4.35.3", | ||
"clsx": "^2.0.0", | ||
"cookies-next": "^4.0.0", | ||
"daisyui": "^3.8.1", | ||
"next": "latest", | ||
"next-pwa": "^5.6.0", | ||
"react": "latest", | ||
"react-dom": "latest", | ||
"react-hook-form": "^7.46.2", | ||
"react-icons": "^4.11.0", | ||
"react-toastify": "^9.1.3", | ||
"recharts": "^2.9.3", | ||
"yup": "^1.2.0" | ||
}, | ||
"devDependencies": { | ||
"@types/next-pwa": "^5.6.7", | ||
"@types/node": "latest", | ||
"@types/react": "latest", | ||
"@types/react-dom": "latest", | ||
"@typescript-eslint/eslint-plugin": "^6.7.3", | ||
"@typescript-eslint/parser": "^6.7.3", | ||
"autoprefixer": "latest", | ||
"eslint": "latest", | ||
"eslint-config-next": "latest", | ||
"eslint-config-prettier": "^9.0.0", | ||
"eslint-plugin-import-helpers": "^1.3.1", | ||
"eslint-plugin-prettier": "^5.0.0", | ||
"eslint-plugin-react": "^7.33.2", | ||
"eslint-plugin-react-hooks": "^4.6.0", | ||
"postcss": "latest", | ||
"prettier": "^3.0.3", | ||
"tailwindcss": "latest", | ||
"typescript": "latest" | ||
}, | ||
"scripts": { | ||
"dev": "next dev -p 3001", | ||
"build": "next build", | ||
"start": "next start", | ||
"lint": "eslint . --quiet", | ||
"type-check": "tsc" | ||
} | ||
} |
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,6 @@ | ||
module.exports = { | ||
plugins: { | ||
tailwindcss: {}, | ||
autoprefixer: {}, | ||
}, | ||
}; |
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,32 @@ | ||
{ | ||
"theme_color": "#803b7e", | ||
"background_color": "#f9daf4", | ||
"display": "standalone", | ||
"scope": "/", | ||
"start_url": "/", | ||
"name": "Econominhas", | ||
"short_name": "econominhas", | ||
"description": "Controle suas finanças", | ||
"icons": [ | ||
{ | ||
"src": "/icon-192x192.png", | ||
"sizes": "192x192", | ||
"type": "image/png" | ||
}, | ||
{ | ||
"src": "/icon-256x256.png", | ||
"sizes": "256x256", | ||
"type": "image/png" | ||
}, | ||
{ | ||
"src": "/icon-384x384.png", | ||
"sizes": "384x384", | ||
"type": "image/png" | ||
}, | ||
{ | ||
"src": "/icon-512x512.png", | ||
"sizes": "512x512", | ||
"type": "image/png" | ||
} | ||
] | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,17 @@ | ||
"use client"; | ||
|
||
import { budget } from "assets/data"; | ||
import { BudgetsCarousel } from "components/StoresCarousel"; | ||
import { getMonthId } from "utils/date"; | ||
|
||
export default function Documents() { | ||
return ( | ||
<main className="min-h-[100dvh] w-full"> | ||
<section className="flex justify-center container-padding"> | ||
<h1 className="font-black text-xl">Gastos de Maio</h1> | ||
</section> | ||
|
||
<BudgetsCarousel budget={budget.budgets[getMonthId()]!} /> | ||
</main> | ||
); | ||
} |
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,20 @@ | ||
"use client"; | ||
|
||
import { useAuth } from "hooks/useAuth"; | ||
import { redirect, RedirectType } from "next/navigation"; | ||
import { ReactNode } from "react"; | ||
|
||
interface Props { | ||
children: ReactNode; | ||
} | ||
|
||
const PrivateLayout: FC<Props> = ({ children }) => { | ||
const auth = useAuth(); | ||
const { user } = auth; | ||
|
||
if (user === null) redirect("/login", RedirectType.replace); | ||
|
||
return <>{children}</>; | ||
}; | ||
|
||
export default PrivateLayout; |
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 @@ | ||
const DiscordLoading = () => { | ||
return <div>Carregando...</div>; | ||
}; | ||
|
||
export default DiscordLoading; |
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,48 @@ | ||
"use client"; | ||
|
||
import { setCookie } from "cookies-next"; | ||
import { useRouter, useSearchParams } from "next/navigation"; | ||
import { useEffect, useState } from "react"; | ||
|
||
import Loading from "./loading"; | ||
|
||
const API_URL = process.env["NEXT_PUBLIC_API_URL"]; | ||
|
||
const Discord = () => { | ||
const [token, setToken] = useState(""); | ||
const router = useRouter(); | ||
const searchParams = useSearchParams(); | ||
const code = searchParams.get("code"); | ||
|
||
useEffect(() => { | ||
const tokenFetch = async () => { | ||
try { | ||
const response = await fetch(`${API_URL}/auth/discord`, { | ||
method: "POST", | ||
body: JSON.stringify({ | ||
code, | ||
origin: window.location.href.split("?").shift()!, | ||
}), | ||
headers: { | ||
"Content-Type": "application/json", | ||
}, | ||
}); | ||
const data = await response.json(); | ||
const token = data.accessToken; | ||
|
||
setToken(token); | ||
} catch (error) { | ||
console.log(error); | ||
} | ||
}; | ||
|
||
tokenFetch(); | ||
}, [code]); | ||
|
||
if (!token) return <Loading />; | ||
|
||
setCookie("token", token); | ||
router.push("/"); | ||
}; | ||
|
||
export default Discord; |
Oops, something went wrong.