Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
88d22fe
⬆️ chore: upgrade next-auth version
Moeefa Mar 22, 2024
54763fc
⬆️ chore: upgrade next-auth version
Moeefa Mar 22, 2024
c7e3798
⬆️ chore: upgrade next-auth version
Moeefa Mar 22, 2024
02a5e22
⬆️ chore: upgrade next-auth version
Moeefa Mar 22, 2024
b9e2cca
⬆️ chore: upgrade next-auth version
Moeefa Mar 22, 2024
05c47cc
✨ feat: add custom signin page
Moeefa Mar 22, 2024
59ad2b0
✨ feat: redirect user to home on callback
Moeefa Mar 22, 2024
b5e3319
✨ feat: add ssr and typings
Moeefa Jun 16, 2024
fef1243
🤡 feat: mock and log auth data
Moeefa Jun 16, 2024
9aae6a2
🤡 feat: log auth data
Moeefa Jun 16, 2024
bf971da
🤡 feat: log auth data
Moeefa Jun 16, 2024
e3111e8
🐛 fix: check if api returned data
Moeefa Jun 16, 2024
a9a7f05
✨ feat: remove break from signin page
Moeefa Jun 16, 2024
1e91d34
✨ feat: remove logging
Moeefa Jun 16, 2024
79286f7
✨ feat: update typings, add suspense api
Moeefa Jun 16, 2024
50ce2f0
💄 feat: update ui
Moeefa Jun 16, 2024
ab9e9a8
💄 feat: update ui
Moeefa Jun 16, 2024
7eef733
📝 docs: update readme file
Moeefa Jun 16, 2024
40aecc1
💄 feat: update ui
Moeefa Jun 16, 2024
9fa0615
⬆️ chore: bump dependencies
Moeefa Jul 29, 2024
59f17a3
🐛 fix: get csrf token
Moeefa Jul 29, 2024
ce13b3e
🐛 fix: redirect to custom auth
Moeefa Aug 7, 2024
db3996e
✨ feat: add correct implementation of periods
Moeefa Sep 22, 2024
93f2dee
✨ feat: display current period to user
Moeefa Oct 6, 2024
f3bb9df
🐛 fix: mobile layout overlapping screen
Moeefa Oct 6, 2024
63c7319
📄 chore: add license
Moeefa Oct 6, 2024
75de375
📄 chore: remove duplicate license
Moeefa Oct 6, 2024
13615e8
🐛 fix: fetch most recent available data
Moeefa Oct 7, 2024
2f5d7c6
🐛 fix: check for 404 status
Moeefa Oct 8, 2024
9af6f75
🐛 fix: suspense data
Moeefa Oct 8, 2024
2d61a5b
🐛 fix: scrollarea on skeleton
Moeefa Oct 8, 2024
f587665
🐛 fix: add section title to loading
Moeefa Oct 8, 2024
cacac35
✨ feat: add biannual tab
Moeefa Oct 8, 2024
8e13c8e
✨ feat: revamp ui
Moeefa Nov 8, 2024
36ff0fb
✨ feat: revamp ui
Moeefa Nov 9, 2024
78e6488
✨ feat: revamp ui
Moeefa Nov 9, 2024
d5b5cc5
✨ feat: revamp loading skeleton
Moeefa Nov 9, 2024
61b49eb
✨ feat: gradient mask header
Moeefa Nov 13, 2024
dcba07f
✨ feat: add ifrn oauth
Moeefa Dec 13, 2024
ad62ea2
✨ feat: add ifrn oauth
Moeefa Dec 13, 2024
f0919cc
✨ feat: add ifrn oauth
Moeefa Dec 13, 2024
5c0bc57
✨ feat: add ifrn oauth
Moeefa Dec 13, 2024
9336f73
✨ feat: add ifrn oauth
Moeefa Dec 13, 2024
cb4c1dc
✨ feat: add ifrn oauth
Moeefa Dec 13, 2024
72ccb4d
✨ feat: add ifrn oauth
Moeefa Dec 13, 2024
063f177
✨ feat: add ifrn oauth
Moeefa Dec 13, 2024
f95e60c
💄 feat: update contributor redirect
Moeefa Dec 13, 2024
fd955b8
✨ feat: add average type setting
Moeefa Jan 2, 2025
7fc90a8
💄 fix: ui overlapping
Moeefa Jan 2, 2025
1d961f1
build(deps): bump next from 14.2.5 to 14.2.21
dependabot[bot] Jan 4, 2025
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 .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
.pnp.js
.yarn/install-state.gz
pnpm-lock.yaml
bun.lockb

# testing
/coverage
Expand Down Expand Up @@ -36,3 +37,5 @@ yarn-error.log*
# typescript
*.tsbuildinfo
next-env.d.ts

.vercel
21 changes: 21 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 Luiz Henrique

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
45 changes: 35 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,46 @@
O IFCalc foi feito em Next.js no intuito de auxiliar os alunos do Instituto Federal de Mato Grosso a visualizarem suas notas de uma maneira simplificada.
### O [IFCalc](https://ifcalc.vercel.app) foi feito com Next.js no intuito de auxiliar os alunos do Instituto Federal de Mato Grosso a visualizarem suas notas de uma maneira simplificada.

## Autenticação OAuth 🗝️
O Oauth do SUAP só funcionará em campi de MT.
# Autenticação OAuth 🗝️

O Oauth do SUAP só funcionará em campi que está na lista de `providers` em `src/auth.ts`.
Pois cada IF possui SUAPs diferentes, utilizando OAuths diferentes.
Se deseja criar uma versão pro seu estado, [confira esta seção](#fazer-o-próprio-deploy-da-aplicação-🚀).
Se deseja adicionar o SUAP do seu campi confira a seção abaixo, ou caso queira criar uma versão para os campi do seu estado, confira a seção de como fazer o deploy da aplicação.

Além disso, não possuímos informação de sua senha de login,
pois o seu login é verificado pelo SUAP, que então envia um JWT (Json Web Token),
pois o seu login é verificado pelo SUAP, que então envia um JWT (Json Web Token),
cujo você não deve compartilhar com ninguém, pois contém acesso aos seus dados pessoais,
para obtermos seus dados e assim acessar suas notas a partir da API do próprio SUAP.

## Fazer o próprio deploy da aplicação 🚀
# Como adicionar o seu campus ao IFCalc 📚

- Você deve criar uma aplicação OAuth no seu SUAP (https://suap.ifmt.edu.br/admin/api/aplicacaooauth2/);

- O nome da aplicação necessariamente deve ser somente "IFCalc";
- A aplicação deve ser do tipo Authorization Code e Confidential;
- O campo de Redirect URIs deve conter o seu callback de login utilizado nos ambientes de teste e produção do IFCalc. Substitua `[SIGLA_DO_ESTADO]` pela sigla do seu estado em minúsculo (exemplo: mt, sp, rj...), cada URL deve ser separado por um espaço.

- ```
https://ifcalc.vercel.app/api/auth/callback/suap_if[SIGLA_DO_ESTADO]

http://localhost:3000/api/auth/callback/suap_if[SIGLA_DO_ESTADO]

https://ifcalc-git-preview-moeefa.vercel.app/api/auth/callback/suap_if[SIGLA_DO_ESTADO]

https://ifcalc-git-preview-moes-projects-45a4825b.vercel.app/api/auth/callback/suap_if[SIGLA_DO_ESTADO]
```

- Não é necessário um algoritmo específico, pois não é usado OIDC (OpenID Connect) no projeto.

- Devido ao token do OAuth correr o risco de ser exposto ou caso de duvidas, você pode entrar em contato comigo atráves das redes sociais incluídas na página de autenticação do IFCalc ou no perfil do GitHub.

# Fazer deploy da aplicação 🚀

Para fazer o deploy da aplicação é bem simples:
- Você deve criar uma aplicação OAuth (https://suap.ifmt.edu.br/admin/api/aplicacaooauth2/);

- Você deve criar uma aplicação OAuth no seu SUAP (https://suap.ifmt.edu.br/admin/api/aplicacaooauth2/);
- A aplicação deve ser do tipo Authorization Code e Confidential;
- O campo de Redirect URIs deve conter o seu callback de login (exemplo: http://localhost:3000/api/auth/callback/suap);
- O campo de Redirect URIs deve conter o seu callback de login (exemplo: http://localhost:3000/api/auth/callback/[ID_DO_PROVIDER]);
- Não é necessário um algoritmo específico, pois não é usado OIDC (OpenID Connect) no projeto.
- Configure as variáveis de ambiente com o seu client ID (CLIENT_ID) e client secret (CLIENT_SECRET);
- Configure as variáveis de ambiente com o seu client ID (AUTH\_`[ID_DO_PROVIDER]`\_ID) e client secret (AUTH\_`[ID_DO_PROVIDER]`\_SECRET);
- A variável AUTH_SECRET deve ser uma chave aleatória. (https://authjs.dev/reference/core#secret);
- Faça o deploy em uma host ([Vercel](https://vercel.com/) como exemplo).
- Faça o deploy em uma host ([Vercel](https://vercel.com/) como exemplo).
Binary file added bun.lockb
Binary file not shown.
6 changes: 5 additions & 1 deletion next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
/** @type {import('next').NextConfig} */
const nextConfig = {};
const nextConfig = {
env: {
AUTH_SECRET: process.env.AUTH_SECRET,
},
};

export default nextConfig;
60 changes: 32 additions & 28 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,42 +9,46 @@
"lint": "next lint"
},
"dependencies": {
"@auth/core": "^0.24.0",
"@radix-ui/react-accordion": "^1.1.2",
"@radix-ui/react-avatar": "^1.0.4",
"@radix-ui/react-collapsible": "^1.0.3",
"@radix-ui/react-dialog": "^1.0.5",
"@radix-ui/react-dropdown-menu": "^2.0.6",
"@radix-ui/react-accordion": "^1.2.0",
"@radix-ui/react-avatar": "^1.1.0",
"@radix-ui/react-collapsible": "^1.1.2",
"@radix-ui/react-dialog": "^1.1.1",
"@radix-ui/react-dropdown-menu": "^2.1.4",
"@radix-ui/react-hover-card": "^1.1.1",
"@radix-ui/react-icons": "^1.3.0",
"@radix-ui/react-label": "^2.0.2",
"@radix-ui/react-navigation-menu": "^1.1.4",
"@radix-ui/react-scroll-area": "^1.0.5",
"@radix-ui/react-separator": "^1.0.3",
"@radix-ui/react-slot": "^1.0.2",
"@radix-ui/react-tabs": "^1.0.4",
"@radix-ui/react-tooltip": "^1.0.7",
"axios": "^1.6.8",
"@radix-ui/react-label": "^2.1.0",
"@radix-ui/react-navigation-menu": "^1.2.0",
"@radix-ui/react-scroll-area": "^1.1.0",
"@radix-ui/react-select": "^2.1.2",
"@radix-ui/react-separator": "^1.1.0",
"@radix-ui/react-slot": "^1.1.0",
"@radix-ui/react-switch": "^1.1.1",
"@radix-ui/react-tabs": "^1.1.0",
"@radix-ui/react-tooltip": "^1.1.2",
"axios": "^1.7.2",
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.0",
"lucide-react": "^0.316.0",
"next": "14.1.0",
"next-auth": "5.0.0-beta.5",
"clsx": "^2.1.1",
"framer-motion": "^11.11.11",
"lucide-react": "^0.427.0",
"motion": "^11.15.0",
"next": "14.2.21",
"next-auth": "5.0.0-beta.20",
"next-themes": "^0.2.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"swr": "^2.2.5",
"tailwind-merge": "^2.2.2",
"tailwind-merge": "^2.4.0",
"tailwindcss-animate": "^1.0.7"
},
"devDependencies": {
"@types/node": "^20.11.30",
"@types/react": "^18.2.67",
"@types/react-dom": "^18.2.22",
"autoprefixer": "^10.4.18",
"@types/node": "^20.14.13",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"autoprefixer": "^10.4.19",
"eslint": "^8.57.0",
"eslint-config-next": "14.1.0",
"postcss": "^8.4.37",
"tailwindcss": "^3.4.1",
"typescript": "^5.4.2"
"postcss": "^8.4.40",
"tailwindcss": "^3.4.9",
"typescript": "^5.5.4"
}
}
Loading