Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 4 additions & 4 deletions backend/src/auth/auth.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export class AuthService {
role: dto.role,
});

return this.generateToken(user.id, user.email, user.role);
return this.generateToken(user.id, user.email, user.role, user.name);
}

async login(dto: LoginDto) {
Expand All @@ -39,11 +39,11 @@ export class AuthService {
throw new UnauthorizedException('Credenciais inválidas');
}

return this.generateToken(user.id, user.email, user.role);
return this.generateToken(user.id, user.email, user.role, user.name);
}

private generateToken(userId: string, email: string, role: string) {
const payload = { sub: userId, email, role };
private generateToken(userId: string, email: string, role: string, name: string) {
const payload = { sub: userId, email, role, name };
return {
access_token: this.jwtService.sign(payload),
};
Expand Down
4 changes: 2 additions & 2 deletions backend/src/auth/strategies/jwt.strategy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export class JwtStrategy extends PassportStrategy(Strategy) {
});
}

async validate(payload: { sub: string; email: string; role: string }) {
return { id: payload.sub, email: payload.email, role: payload.role };
async validate(payload: { sub: string; email: string; role: string; name: string }) {
return { id: payload.sub, email: payload.email, role: payload.role, name: payload.name };
}
}
1 change: 0 additions & 1 deletion frontend/public/file.svg

This file was deleted.

1 change: 0 additions & 1 deletion frontend/public/globe.svg

This file was deleted.

1 change: 0 additions & 1 deletion frontend/public/next.svg

This file was deleted.

Binary file added frontend/public/pokecenter_icon.ico
Binary file not shown.
1 change: 0 additions & 1 deletion frontend/public/vercel.svg

This file was deleted.

1 change: 0 additions & 1 deletion frontend/public/window.svg

This file was deleted.

42 changes: 41 additions & 1 deletion frontend/src/app/globals.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,44 @@
@import "tailwindcss";
@plugin "daisyui" {
themes: garden --default;
themes: pokemon --default;
}


@plugin "daisyui/theme" {
name: "PokeCenter";
default: true;
prefersdark: false;
color-scheme: "light";
--color-base-100: oklch(98% 0.001 106.423);
--color-base-200: oklch(92% 0.003 48.717);
--color-base-300: oklch(86% 0.005 56.366);
--color-base-content: oklch(21% 0.006 285.885);
--color-primary: oklch(60% 0.118 184.704);
--color-primary-content: oklch(97% 0.021 166.113);
--color-secondary: oklch(66% 0.179 58.318);
--color-secondary-content: oklch(98% 0.022 95.277);
--color-accent: oklch(38% 0.063 188.416);
--color-accent-content: oklch(96% 0.018 272.314);
--color-neutral: oklch(37% 0.01 67.558);
--color-neutral-content: oklch(98% 0 0);
--color-info: oklch(50% 0.134 242.749);
--color-info-content: oklch(97% 0.013 236.62);
--color-success: oklch(59% 0.145 163.225);
--color-success-content: oklch(98% 0.014 180.72);
--color-warning: oklch(55% 0.135 66.442);
--color-warning-content: oklch(98% 0.026 102.212);
--color-error: oklch(51% 0.222 16.935);
--color-error-content: oklch(97% 0.013 17.38);
--radius-selector: 0.5rem;
--radius-field: 0.5rem;
--radius-box: 0.5rem;
--size-selector: 0.25rem;
--size-field: 0.25rem;
--border: 1.5px;
--depth: 1;
--noise: 1;
}

body {
font-family: var(--font-lato), sans-serif;
}
21 changes: 18 additions & 3 deletions frontend/src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
import type { Metadata } from 'next';
import { Lato } from 'next/font/google';
import './globals.css';
import Footer from '@/components/ui/Footer';

const lato = Lato({
subsets: ['latin'],
weight: ['300', '400', '700', '900'],
variable: '--font-lato',
display: 'swap',
});

export const metadata: Metadata = {
title: 'Centro Pokémon',
title: 'PokéCenter',
description: 'Sistema de gerenciamento de Pokémons',
icons: {
icon: 'pokecenter_icon.ico',
}
};

export default function RootLayout({
Expand All @@ -12,8 +24,11 @@ export default function RootLayout({
children: React.ReactNode;
}) {
return (
<html lang="pt-BR" data-theme="garden">
<body>{children}</body>
<html lang="pt-BR" className={lato.variable}>
<body className="font-lato flex flex-col min-h-screen">
{children}
<Footer />
</body>
</html>
);
}
44 changes: 23 additions & 21 deletions frontend/src/components/pokemon/PokemonForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,29 @@ export default function PokemonForm({ initialData, onSubmit, isLoading }: Pokemo
</div>
)}

{/* Busca na PokéAPI com autocomplete */}
<PokemonSearch
onSelect={handlePokeApiSelect}
initialName={initialData?.name}
/>
{/* Busca na PokéAPI e número da Pokédex — visíveis apenas no cadastro */}
{!initialData && (
<>
<PokemonSearch
onSelect={handlePokeApiSelect}
/>

<label className="form-control">
<div className="label">
<span className="label-text">Número da Pokédex</span>
</div>
<input
type="number"
name="pokedexNumber"
className="input input-bordered input-sm w-full"
value={formData.pokedexNumber}
onChange={handleChange}
min={1}
required
/>
</label>
</>
)}

{/* Apelido */}
<label className="form-control">
Expand All @@ -156,22 +174,6 @@ export default function PokemonForm({ initialData, onSubmit, isLoading }: Pokemo
/>
</label>

{/* Número da Pokédex — preenchido automaticamente */}
<label className="form-control">
<div className="label">
<span className="label-text">Número da Pokédex</span>
</div>
<input
type="number"
name="pokedexNumber"
className="input input-bordered input-sm w-full"
value={formData.pokedexNumber}
onChange={handleChange}
min={1}
required
/>
</label>

{/* Nível e HP */}
<div className="grid grid-cols-2 gap-3">
<label className="form-control">
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/pokemon/PokemonModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default function PokemonModal({
}: PokemonModalProps) {
return (
<dialog id="pokemon_modal" className="modal modal-open">
<div className="modal-box w-11/12 max-w-lg">
<div className="modal-box w-11/12 max-w-lg h-150 overflow-y-auto">

<h3 className="font-bold text-lg mb-4">
{mode === 'create' ? 'Cadastrar Pokémon' : `Editar ${pokemon?.name}`}
Expand Down
100 changes: 100 additions & 0 deletions frontend/src/components/ui/Footer.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
'use client';

import Link from 'next/link';

export default function Footer() {
const technologies = [
{ name: 'Next.js', url: 'https://nextjs.org' },
{ name: 'NestJS', url: 'https://nestjs.com' },
{ name: 'TypeScript', url: 'https://www.typescriptlang.org' },
{ name: 'PostgreSQL', url: 'https://www.postgresql.org' },
{ name: 'TailwindCSS', url: 'https://tailwindcss.com' },
{ name: 'DaisyUI', url: 'https://daisyui.com' },
{ name: 'PokéAPI', url: 'https://pokeapi.co' },
];

return (
<footer className="bg-base-300 border-t border-base-content/10 mt-auto">
<div className="container mx-auto px-4 py-8">
<div className="grid grid-cols-1 md:grid-cols-3 gap-8">

{/* Coluna 1 — Nome e descrição */}
<div className="flex flex-col gap-2">
<h2 className="text-lg font-bold text-primary">
PokéCenter
</h2>
<p className="text-sm text-base-content/60 leading-relaxed">
Sistema para treinadores e Enfermeiras Joy cuidarem dos seus pokémons com carinho. 💚
</p>
<p className="text-xs text-base-content/40 leading-relaxed">
Desenvolvido para o desafio técnico para Desenvolvedor Júnior na SIM INT.
</p>
</div>

{/* Coluna 2 — Tecnologias */}
<div className="flex flex-col gap-2">
<h3 className="text-sm font-semibold text-base-content/80 uppercase tracking-wider">
Feito com
</h3>
<div className="flex flex-wrap gap-2">
{technologies.map((tech) => (
<a
key={tech.name}
href={tech.url}
target="_blank"
rel="noopener noreferrer"
className="badge badge-outline badge-sm hover:badge-primary transition-colors cursor-pointer"
>
{tech.name}
</a>
))}
</div>
</div>

{/* Coluna 3 — Desenvolvedora e links */}
<div className="flex flex-col gap-2">
<h3 className="text-sm font-semibold text-base-content/80 uppercase tracking-wider">
Desenvolvedora
</h3>
<p className="text-sm text-base-content/60">
Feito com 💚 por{' '}
<span className="font-semibold text-base-content">
Samantha Medeiros
</span>
</p>

{/* GitHub */}
<a
href="https://github.com/sammid37/PokemonCenter"
target="_blank"
rel="noopener noreferrer"
className="flex items-center gap-2 text-sm text-base-content/60 hover:text-primary transition-colors w-fit mt-1"
>
{/* Ícone do GitHub em SVG — sem dependência de biblioteca */}
<svg
xmlns="http://www.w3.org/2000/svg"
width="16"
height="16"
viewBox="0 0 24 24"
fill="currentColor"
>
<path d="M12 0C5.374 0 0 5.373 0 12c0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23A11.509 11.509 0 0 1 12 5.803c1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576C20.566 21.797 24 17.3 24 12c0-6.627-5.373-12-12-12z" />
</svg>
<span>sammid37/PokemonCenter/</span>
</a>
</div>

</div>

{/* Linha divisória e versão */}
<div className="divider my-4" />
<div className="flex flex-col sm:flex-row justify-between items-center gap-2 text-xs text-base-content/40">
<p>© {new Date().getFullYear()} PokéCenter — Todos os direitos reservados</p>
<p className="badge badge-ghost badge-sm">v1.0.0</p>
</div>

</div>
</footer>
);
}
2 changes: 1 addition & 1 deletion frontend/src/components/ui/Navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default function Navbar({ user }: NavbarProps) {
<div className="navbar bg-base-100 shadow-md px-4">
<div className="flex-1">
<Link href="/dashboard" className="text-xl font-bold text-primary">
Centro Pokémon
PokéCenter
</Link>
</div>

Expand Down
Loading