Skip to content

Commit 6a8da9f

Browse files
committed
adiciona projeto inicial
0 parents  commit 6a8da9f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+12486
-0
lines changed

.gitignore

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
6+
# next.js
7+
/.next/
8+
/out/
9+
10+
# production
11+
/build
12+
13+
# debug
14+
npm-debug.log*
15+
yarn-debug.log*
16+
yarn-error.log*
17+
.pnpm-debug.log*
18+
19+
# env files
20+
.env*
21+
22+
# vercel
23+
.vercel
24+
25+
# typescript
26+
*.tsbuildinfo
27+
next-env.d.ts

app/globals.css

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
@import "tailwindcss";
2+
3+
@custom-variant dark (&:is(.dark *));
4+
5+
@theme inline {
6+
--radius-sm: calc(var(--radius) - 4px);
7+
--radius-md: calc(var(--radius) - 2px);
8+
--radius-lg: var(--radius);
9+
--radius-xl: calc(var(--radius) + 4px);
10+
--color-background: var(--background);
11+
--color-foreground: var(--foreground);
12+
--color-card: var(--card);
13+
--color-card-foreground: var(--card-foreground);
14+
--color-popover: var(--popover);
15+
--color-popover-foreground: var(--popover-foreground);
16+
--color-primary: var(--primary);
17+
--color-primary-foreground: var(--primary-foreground);
18+
--color-secondary: var(--secondary);
19+
--color-secondary-foreground: var(--secondary-foreground);
20+
--color-muted: var(--muted);
21+
--color-muted-foreground: var(--muted-foreground);
22+
--color-accent: var(--accent);
23+
--color-accent-foreground: var(--accent-foreground);
24+
--color-destructive: var(--destructive);
25+
--color-border: var(--border);
26+
--color-input: var(--input);
27+
--color-ring: var(--ring);
28+
--color-chart-1: var(--chart-1);
29+
--color-chart-2: var(--chart-2);
30+
--color-chart-3: var(--chart-3);
31+
--color-chart-4: var(--chart-4);
32+
--color-chart-5: var(--chart-5);
33+
--color-sidebar: var(--sidebar);
34+
--color-sidebar-foreground: var(--sidebar-foreground);
35+
--color-sidebar-primary: var(--sidebar-primary);
36+
--color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
37+
--color-sidebar-accent: var(--sidebar-accent);
38+
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
39+
--color-sidebar-border: var(--sidebar-border);
40+
--color-sidebar-ring: var(--sidebar-ring);
41+
}
42+
43+
:root {
44+
--radius: 0.625rem;
45+
--background: oklch(1 0 0);
46+
--foreground: oklch(0.145 0 0);
47+
--card: oklch(1 0 0);
48+
--card-foreground: oklch(0.145 0 0);
49+
--popover: oklch(1 0 0);
50+
--popover-foreground: oklch(0.145 0 0);
51+
--primary: oklch(0.205 0 0);
52+
--primary-foreground: oklch(0.985 0 0);
53+
--secondary: oklch(0.97 0 0);
54+
--secondary-foreground: oklch(0.205 0 0);
55+
--muted: oklch(0.97 0 0);
56+
--muted-foreground: oklch(0.556 0 0);
57+
--accent: oklch(0.97 0 0);
58+
--accent-foreground: oklch(0.205 0 0);
59+
--destructive: oklch(0.577 0.245 27.325);
60+
--border: oklch(0.922 0 0);
61+
--input: oklch(0.922 0 0);
62+
--ring: oklch(0.708 0 0);
63+
--chart-1: oklch(0.646 0.222 41.116);
64+
--chart-2: oklch(0.6 0.118 184.704);
65+
--chart-3: oklch(0.398 0.07 227.392);
66+
--chart-4: oklch(0.828 0.189 84.429);
67+
--chart-5: oklch(0.769 0.188 70.08);
68+
--sidebar: oklch(0.985 0 0);
69+
--sidebar-foreground: oklch(0.145 0 0);
70+
--sidebar-primary: oklch(0.205 0 0);
71+
--sidebar-primary-foreground: oklch(0.985 0 0);
72+
--sidebar-accent: oklch(0.97 0 0);
73+
--sidebar-accent-foreground: oklch(0.205 0 0);
74+
--sidebar-border: oklch(0.922 0 0);
75+
--sidebar-ring: oklch(0.708 0 0);
76+
}
77+
78+
.dark {
79+
--background: oklch(0.145 0 0);
80+
--foreground: oklch(0.985 0 0);
81+
--card: oklch(0.205 0 0);
82+
--card-foreground: oklch(0.985 0 0);
83+
--popover: oklch(0.205 0 0);
84+
--popover-foreground: oklch(0.985 0 0);
85+
--primary: oklch(0.922 0 0);
86+
--primary-foreground: oklch(0.205 0 0);
87+
--secondary: oklch(0.269 0 0);
88+
--secondary-foreground: oklch(0.985 0 0);
89+
--muted: oklch(0.269 0 0);
90+
--muted-foreground: oklch(0.708 0 0);
91+
--accent: oklch(0.269 0 0);
92+
--accent-foreground: oklch(0.985 0 0);
93+
--destructive: oklch(0.704 0.191 22.216);
94+
--border: oklch(1 0 0 / 10%);
95+
--input: oklch(1 0 0 / 15%);
96+
--ring: oklch(0.556 0 0);
97+
--chart-1: oklch(0.488 0.243 264.376);
98+
--chart-2: oklch(0.696 0.17 162.48);
99+
--chart-3: oklch(0.769 0.188 70.08);
100+
--chart-4: oklch(0.627 0.265 303.9);
101+
--chart-5: oklch(0.645 0.246 16.439);
102+
--sidebar: oklch(0.205 0 0);
103+
--sidebar-foreground: oklch(0.985 0 0);
104+
--sidebar-primary: oklch(0.488 0.243 264.376);
105+
--sidebar-primary-foreground: oklch(0.985 0 0);
106+
--sidebar-accent: oklch(0.269 0 0);
107+
--sidebar-accent-foreground: oklch(0.985 0 0);
108+
--sidebar-border: oklch(1 0 0 / 10%);
109+
--sidebar-ring: oklch(0.556 0 0);
110+
}
111+
112+
@layer base {
113+
* {
114+
@apply border-border outline-ring/50;
115+
}
116+
body {
117+
@apply bg-background text-foreground;
118+
}
119+
}

app/layout.tsx

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import type React from "react"
2+
import { Inter } from "next/font/google"
3+
import "./globals.css"
4+
import { AuthProvider } from "@/context/auth-context"
5+
import { FavoritesProvider } from "@/context/favorites-context"
6+
import Header from "@/components/header"
7+
import Footer from "@/components/footer"
8+
9+
const inter = Inter({ subsets: ["latin"] })
10+
11+
export const metadata = {
12+
title: "Movie Catalog",
13+
description: "A simple movie catalog application",
14+
generator: 'v0.dev'
15+
}
16+
17+
export default function RootLayout({
18+
children,
19+
}: {
20+
children: React.ReactNode
21+
}) {
22+
return (
23+
<html lang="en">
24+
<body className={inter.className}>
25+
<AuthProvider>
26+
<FavoritesProvider>
27+
<div className="flex flex-col min-h-screen">
28+
<Header />
29+
<main className="grow container mx-auto px-4 py-8">{children}</main>
30+
<Footer />
31+
</div>
32+
</FavoritesProvider>
33+
</AuthProvider>
34+
</body>
35+
</html>
36+
)
37+
}
38+
39+
40+
import './globals.css'

app/loading.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export default function Loading() {
2+
return null
3+
}

app/login/page.tsx

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
"use client"
2+
3+
import type React from "react"
4+
5+
import { useState } from "react"
6+
import { useRouter } from "next/navigation"
7+
import Link from "next/link"
8+
import { useAuth } from "@/context/auth-context"
9+
import { Button } from "@/components/ui/button"
10+
import { Input } from "@/components/ui/input"
11+
import { Label } from "@/components/ui/label"
12+
import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "@/components/ui/card"
13+
import { AlertCircle } from "lucide-react"
14+
import { Alert, AlertDescription } from "@/components/ui/alert"
15+
16+
export default function LoginPage() {
17+
const [username, setUsername] = useState("")
18+
const [password, setPassword] = useState("")
19+
const [error, setError] = useState("")
20+
const { login } = useAuth()
21+
const router = useRouter()
22+
23+
const handleSubmit = (e: React.FormEvent) => {
24+
e.preventDefault()
25+
setError("")
26+
27+
if (!username || !password) {
28+
setError("Please enter both username and password")
29+
return
30+
}
31+
32+
const success = login(username, password)
33+
if (success) {
34+
window.location.href = "/"
35+
router.push("/")
36+
} else {
37+
setError("Invalid username or password")
38+
}
39+
}
40+
41+
return (
42+
<div className="flex justify-center items-center min-h-[70vh]">
43+
<Card className="w-full max-w-md">
44+
<CardHeader>
45+
<CardTitle role="heading" className="text-2xl">Login</CardTitle>
46+
<CardDescription>Sign in to your account to access your profile and favorites</CardDescription>
47+
</CardHeader>
48+
<form onSubmit={handleSubmit}>
49+
<CardContent className="space-y-4">
50+
{error && (
51+
<Alert variant="destructive">
52+
<AlertCircle className="h-4 w-4" />
53+
<AlertDescription>{error}</AlertDescription>
54+
</Alert>
55+
)}
56+
<div className="space-y-2">
57+
<Label htmlFor="username">Username</Label>
58+
<Input
59+
id="username"
60+
type="text"
61+
value={username}
62+
onChange={(e) => setUsername(e.target.value)}
63+
placeholder="Enter your username"
64+
/>
65+
</div>
66+
<div className="space-y-2">
67+
<Label htmlFor="password">Password</Label>
68+
<Input
69+
id="password"
70+
type="password"
71+
value={password}
72+
onChange={(e) => setPassword(e.target.value)}
73+
placeholder="Enter your password"
74+
/>
75+
</div>
76+
</CardContent>
77+
<CardFooter className="flex flex-col space-y-2">
78+
<Button type="submit" className="w-full">
79+
Login Now
80+
</Button>
81+
<p className="text-sm text-center text-gray-500 dark:text-gray-400">
82+
Don&apos;t have an account?{" "}
83+
<Link href="/register" className="text-primary hover:underline">
84+
Register
85+
</Link>
86+
</p>
87+
</CardFooter>
88+
</form>
89+
</Card>
90+
</div>
91+
)
92+
}

0 commit comments

Comments
 (0)