├── .gitignore ├── README.md ├── admin-template ├── .eslintrc ├── .gitignore ├── README.md ├── next-env.d.ts ├── next.config.js ├── package-lock.json ├── package.json ├── postcss.config.js ├── public │ ├── favicon.ico │ ├── images │ │ ├── avatar.svg │ │ └── loading.gif │ └── vercel.svg ├── src │ ├── components │ │ ├── auth │ │ │ ├── AuthInput.tsx │ │ │ └── ForcarAutenticacao.tsx │ │ ├── icons │ │ │ └── index.tsx │ │ └── template │ │ │ ├── AvatarUsuario.tsx │ │ │ ├── BotaoAlternarTema.tsx │ │ │ ├── Cabecalho.tsx │ │ │ ├── Conteudo.tsx │ │ │ ├── Layout.tsx │ │ │ ├── Logo.tsx │ │ │ ├── MenuItem.tsx │ │ │ ├── MenuLateral.tsx │ │ │ └── Titulo.tsx │ ├── data │ │ ├── context │ │ │ ├── AppContext.tsx │ │ │ └── AuthContext.tsx │ │ └── hook │ │ │ ├── useAppData.ts │ │ │ └── useAuth.ts │ ├── firebase │ │ └── config.js │ ├── model │ │ └── Usuario.ts │ ├── pages │ │ ├── _app.tsx │ │ ├── ajustes.tsx │ │ ├── api │ │ │ └── hello.js │ │ ├── autenticacao.tsx │ │ ├── index.tsx │ │ ├── notificacoes.tsx │ │ └── perfil.tsx │ └── styles │ │ └── globals.css ├── tailwind.config.js └── tsconfig.json ├── exercicios ├── .gitignore ├── README.md ├── components │ ├── Contador.jsx │ ├── Estilo.jsx │ ├── If.jsx │ ├── Item.jsx │ ├── Lista.jsx │ ├── NumeroDisplay.jsx │ ├── Pessoa.tsx │ ├── SomaUm.jsx │ ├── SomentePar.jsx │ ├── Titulo.jsx │ ├── direta │ │ ├── Filho.jsx │ │ └── Pai.jsx │ ├── indireta1 │ │ ├── Filho.jsx │ │ └── Pai.jsx │ └── modulo │ │ └── funcionais.jsx ├── data │ └── listaProdutos.js ├── functions │ └── mega.js ├── model │ └── produto.js ├── next-env.d.ts ├── package-lock.json ├── package.json ├── pages │ ├── _app.js │ ├── api │ │ └── hello.js │ ├── basicos │ │ ├── Teste.jsx │ │ ├── botao.jsx │ │ ├── componenteComFilho.jsx │ │ ├── fragment1.jsx │ │ ├── fragment2.jsx │ │ ├── jsx1.jsx │ │ ├── jsx2.jsx │ │ ├── jsx3.jsx │ │ ├── jsx4.jsx │ │ ├── lista1.jsx │ │ ├── lista2.jsx │ │ ├── lista3.jsx │ │ ├── primeiro.jsx │ │ ├── propsSomenteLeitura.jsx │ │ └── usandoTitulo.jsx │ ├── classe │ │ └── contador.jsx │ ├── comunicacao │ │ ├── direta.jsx │ │ └── indireta1.jsx │ ├── css │ │ ├── integracao1.css │ │ ├── integracao1.jsx │ │ ├── integracao2.jsx │ │ ├── integracao2.module.css │ │ └── usandoEstilo.jsx │ ├── estado │ │ ├── contador.jsx │ │ ├── formulario.jsx │ │ ├── megasena.jsx │ │ └── mouse.jsx │ ├── index.jsx │ ├── modulo │ │ └── teste.jsx │ ├── render │ │ ├── condicional1.jsx │ │ ├── condicional2.jsx │ │ ├── repeticao1.jsx │ │ └── repeticao2.jsx │ └── ts │ │ └── exemplo.tsx ├── public │ ├── favicon.ico │ └── vercel.svg ├── styles │ ├── Home.module.css │ └── globals.css └── tsconfig.json ├── next-basico ├── .eslintrc ├── .gitignore ├── README.md ├── next.config.js ├── package-lock.json ├── package.json ├── public │ ├── favicon.ico │ └── images │ │ └── vercel.svg └── src │ ├── pages │ ├── _app.jsx │ ├── _outraRota.jsx │ ├── api │ │ ├── form.js │ │ ├── hello.js │ │ ├── metodo.js │ │ ├── params │ │ │ └── [[...array]].js │ │ └── questao │ │ │ └── [id].js │ ├── estatico.jsx │ ├── form.jsx │ ├── index.jsx │ ├── outraRota.jsx │ ├── questao.jsx │ └── rotas │ │ ├── [codigo] │ │ ├── [nome].jsx │ │ └── buscar.jsx │ │ ├── index.jsx │ │ └── params.jsx │ └── styles │ ├── Home.module.css │ └── globals.css ├── portas ├── .eslintrc ├── .gitignore ├── README.md ├── components │ ├── Cartao.tsx │ ├── EntradaNumerica.tsx │ ├── Porta.tsx │ └── Presente.tsx ├── functions │ └── portas.ts ├── model │ └── porta.ts ├── next-env.d.ts ├── next.config.js ├── package-lock.json ├── package.json ├── pages │ ├── _app.js │ ├── api │ │ └── hello.js │ ├── index.tsx │ └── jogo │ │ └── [portas] │ │ └── [temPresente].tsx ├── public │ ├── favicon.ico │ └── vercel.svg ├── styles │ ├── Cartao.module.css │ ├── EntradaNumerica.module.css │ ├── Formulario.module.css │ ├── Jogo.module.css │ ├── Porta.module.css │ ├── Presente.module.css │ └── globals.css └── tsconfig.json ├── quiz ├── .eslintrc ├── .gitignore ├── README.md ├── components │ ├── Botao.tsx │ ├── Enunciado.tsx │ ├── Estatistica.tsx │ ├── Questao.tsx │ ├── Questionario.tsx │ ├── Resposta.tsx │ └── Temporizador.tsx ├── functions │ └── arrays.ts ├── model │ ├── questao.ts │ └── resposta.ts ├── next-env.d.ts ├── next.config.js ├── package-lock.json ├── package.json ├── pages │ ├── _app.js │ ├── api │ │ ├── bancoDeQuestoes.ts │ │ ├── questionario │ │ │ └── index.ts │ │ └── questoes │ │ │ └── [id].ts │ ├── index.tsx │ └── resultado.tsx ├── public │ ├── favicon.ico │ └── vercel.svg ├── styles │ ├── Botao.module.css │ ├── Enunciado.module.css │ ├── Estatistica.module.css │ ├── Questao.module.css │ ├── Questionario.module.css │ ├── Resposta.module.css │ ├── Resultado.module.css │ ├── Temporizador.module.css │ └── globals.css └── tsconfig.json ├── renderizacao ├── .eslintrc ├── .gitignore ├── README.md ├── next.config.js ├── package-lock.json ├── package.json ├── pages │ ├── _app.js │ ├── alunos │ │ └── [id].jsx │ ├── api │ │ ├── alunos │ │ │ ├── [id].js │ │ │ └── tutores.js │ │ ├── hello.js │ │ └── produtos.js │ ├── dinamico1.jsx │ ├── dinamico2.jsx │ ├── estatico1.jsx │ ├── estatico2.jsx │ ├── estatico3.jsx │ ├── estatico4.jsx │ └── index.js ├── public │ ├── favicon.ico │ └── vercel.svg └── styles │ ├── Home.module.css │ └── globals.css ├── tabuleiro ├── .gitignore ├── README.md ├── components │ ├── Linha.jsx │ ├── Subdivisao.jsx │ └── Tabuleiro.jsx ├── package-lock.json ├── package.json ├── pages │ ├── _app.js │ ├── api │ │ └── hello.js │ └── index.jsx ├── public │ ├── favicon.ico │ └── vercel.svg └── styles │ ├── Home.module.css │ ├── Linha.module.css │ ├── Subdivisao.module.css │ └── globals.css └── tarefas ├── .eslintrc ├── .gitignore ├── README.md ├── next-env.d.ts ├── next.config.js ├── package-lock.json ├── package.json ├── postcss.config.js ├── public ├── favicon.ico ├── images │ └── background.png └── vercel.svg ├── src ├── components │ ├── formulario │ │ └── Formulario.tsx │ ├── lista │ │ ├── Lista.tsx │ │ ├── ListaBotao.tsx │ │ ├── ListaItem.tsx │ │ ├── ListaRodape.tsx │ │ └── Selecao.tsx │ └── template │ │ ├── Cabecalho.tsx │ │ └── Conteudo.tsx ├── data │ └── mock.ts ├── model │ ├── ListaTarefas.ts │ ├── Tarefa.ts │ └── TipoFiltro.ts ├── pages │ ├── _app.tsx │ ├── api │ │ └── hello.js │ └── index.tsx └── styles │ └── globals.css ├── tailwind.config.js └── tsconfig.json /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | lerna-debug.log* 8 | 9 | # Diagnostic reports (https://nodejs.org/api/report.html) 10 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 11 | 12 | # Runtime data 13 | pids 14 | *.pid 15 | *.seed 16 | *.pid.lock 17 | 18 | # Directory for instrumented libs generated by jscoverage/JSCover 19 | lib-cov 20 | 21 | # Coverage directory used by tools like istanbul 22 | coverage 23 | *.lcov 24 | 25 | # nyc test coverage 26 | .nyc_output 27 | 28 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) 29 | .grunt 30 | 31 | # Bower dependency directory (https://bower.io/) 32 | bower_components 33 | 34 | # node-waf configuration 35 | .lock-wscript 36 | 37 | # Compiled binary addons (https://nodejs.org/api/addons.html) 38 | build/Release 39 | 40 | # Dependency directories 41 | node_modules/ 42 | jspm_packages/ 43 | 44 | # TypeScript v1 declaration files 45 | typings/ 46 | 47 | # TypeScript cache 48 | *.tsbuildinfo 49 | 50 | # Optional npm cache directory 51 | .npm 52 | 53 | # Optional eslint cache 54 | .eslintcache 55 | 56 | # Microbundle cache 57 | .rpt2_cache/ 58 | .rts2_cache_cjs/ 59 | .rts2_cache_es/ 60 | .rts2_cache_umd/ 61 | 62 | # Optional REPL history 63 | .node_repl_history 64 | 65 | # Output of 'npm pack' 66 | *.tgz 67 | 68 | # Yarn Integrity file 69 | .yarn-integrity 70 | 71 | # dotenv environment variables file 72 | .env 73 | .env.test 74 | 75 | # parcel-bundler cache (https://parceljs.org/) 76 | .cache 77 | 78 | # Next.js build output 79 | .next 80 | 81 | # Nuxt.js build / generate output 82 | .nuxt 83 | dist 84 | 85 | # Gatsby files 86 | .cache/ 87 | # Comment in the public line in if your project uses Gatsby and *not* Next.js 88 | # https://nextjs.org/blog/next-9-1#public-directory-support 89 | # public 90 | 91 | # vuepress build output 92 | .vuepress/dist 93 | 94 | # Serverless directories 95 | .serverless/ 96 | 97 | # FuseBox cache 98 | .fusebox/ 99 | 100 | # DynamoDB Local files 101 | .dynamodb/ 102 | 103 | # TernJS port file 104 | .tern-port 105 | 106 | # Mac 107 | .DS_Store -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Curso NextJS da Cod3r 2 | [Acesse o Curso](https://www.cod3r.com.br/courses/nextjs) 3 | -------------------------------------------------------------------------------- /admin-template/.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "extends": ["next", "next/core-web-vitals"] 3 | } 4 | -------------------------------------------------------------------------------- /admin-template/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # next.js 12 | /.next/ 13 | /out/ 14 | 15 | # production 16 | /build 17 | 18 | # misc 19 | .DS_Store 20 | *.pem 21 | 22 | # debug 23 | npm-debug.log* 24 | yarn-debug.log* 25 | yarn-error.log* 26 | 27 | # local env files 28 | .env.local 29 | .env.development.local 30 | .env.test.local 31 | .env.production.local 32 | 33 | # vercel 34 | .vercel 35 | -------------------------------------------------------------------------------- /admin-template/README.md: -------------------------------------------------------------------------------- 1 | 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). 2 | 3 | ## Getting Started 4 | 5 | First, run the development server: 6 | 7 | ```bash 8 | npm run dev 9 | # or 10 | yarn dev 11 | ``` 12 | 13 | Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. 14 | 15 | You can start editing the page by modifying `pages/index.js`. The page auto-updates as you edit the file. 16 | 17 | [API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.js`. 18 | 19 | The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages. 20 | 21 | ## Learn More 22 | 23 | To learn more about Next.js, take a look at the following resources: 24 | 25 | - [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API. 26 | - [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial. 27 | 28 | You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome! 29 | 30 | ## Deploy on Vercel 31 | 32 | 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. 33 | 34 | Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details. 35 | -------------------------------------------------------------------------------- /admin-template/next-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | /// 3 | /// 4 | -------------------------------------------------------------------------------- /admin-template/next.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | reactStrictMode: true, 3 | } 4 | -------------------------------------------------------------------------------- /admin-template/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "admin-template", 3 | "version": "0.1.0", 4 | "private": true, 5 | "scripts": { 6 | "dev": "next dev", 7 | "build": "next build", 8 | "start": "next start", 9 | "lint": "next lint" 10 | }, 11 | "dependencies": { 12 | "firebase": "^8.6.8", 13 | "js-cookie": "^2.2.1", 14 | "next": "11.0.1", 15 | "react": "17.0.2", 16 | "react-dom": "17.0.2" 17 | }, 18 | "devDependencies": { 19 | "@types/react": "^17.0.11", 20 | "autoprefixer": "^10.2.6", 21 | "eslint": "7.29.0", 22 | "eslint-config-next": "11.0.1", 23 | "postcss": "^8.3.5", 24 | "tailwindcss": "^2.2.4", 25 | "typescript": "^4.3.4" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /admin-template/postcss.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: { 3 | tailwindcss: {}, 4 | autoprefixer: {}, 5 | }, 6 | } 7 | -------------------------------------------------------------------------------- /admin-template/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cod3rcursos/curso-nextjs/5c35f41e4da8c20753b5eca2827bcbba2bb31ce6/admin-template/public/favicon.ico -------------------------------------------------------------------------------- /admin-template/public/images/avatar.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 108 | 109 | 110 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 135 | 137 | 138 | 139 | 140 | 142 | 143 | 144 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | -------------------------------------------------------------------------------- /admin-template/public/images/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cod3rcursos/curso-nextjs/5c35f41e4da8c20753b5eca2827bcbba2bb31ce6/admin-template/public/images/loading.gif -------------------------------------------------------------------------------- /admin-template/public/vercel.svg: -------------------------------------------------------------------------------- 1 | 3 | 4 | -------------------------------------------------------------------------------- /admin-template/src/components/auth/AuthInput.tsx: -------------------------------------------------------------------------------- 1 | interface AuthInputProps { 2 | label: string 3 | valor: any 4 | obrigatorio?: boolean 5 | naoRenderizarQuando?: boolean 6 | tipo?: 'text' | 'email' | 'password' 7 | valorMudou: (novoValor: any) => void 8 | } 9 | 10 | export default function AuthInput(props: AuthInputProps) { 11 | return props.naoRenderizarQuando ? null : ( 12 |
13 | 14 | props.valorMudou?.(e.target.value)} 18 | required={props.obrigatorio} 19 | className={` 20 | px-4 py-3 rounded-lg bg-gray-200 mt-2 21 | border focus:border-blue-500 focus:bg-white 22 | focus:outline-none 23 | `} 24 | /> 25 |
26 | ) 27 | } -------------------------------------------------------------------------------- /admin-template/src/components/auth/ForcarAutenticacao.tsx: -------------------------------------------------------------------------------- 1 | import Head from 'next/head' 2 | import Image from 'next/image' 3 | import router from 'next/router' 4 | import loading from '../../../public/images/loading.gif' 5 | import useAuth from '../../data/hook/useAuth' 6 | 7 | export default function ForcarAutenticacao(props) { 8 | 9 | const { usuario, carregando } = useAuth() 10 | 11 | function renderizarConteudo() { 12 | return ( 13 | <> 14 | 15 |