Skip to content

Commit

Permalink
feat: changing to uerj database
Browse files Browse the repository at this point in the history
  • Loading branch information
MarceloBxD committed Jun 23, 2024
1 parent 08f6753 commit 17004d3
Show file tree
Hide file tree
Showing 11 changed files with 6,234 additions and 26 deletions.
2 changes: 2 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
DATABASE_URL="mongodb+srv://dbuser:[email protected]/
"
Binary file modified app/favicon.ico
Binary file not shown.
4 changes: 2 additions & 2 deletions app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import { AppProvider } from "@/contexts/AppContext";

const inter = Inter({ subsets: ["latin"] });

const PAGE_TITLE = "IGMA CHALLENGE | API";
const PAGE_DESCRIPTION = "REGISTER CLIENT";
const PAGE_TITLE = "ROADKILL | API";
const PAGE_DESCRIPTION = "APPLICATION TO DATABASE MANAGEMENT OF ROADKILL";
const PAGE_LANG = "pt-br";

const TOAST_AUTO_CLOSE = 5000;
Expand Down
25 changes: 14 additions & 11 deletions app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import Image from "next/image";

const AUTHOR_NAME = "Marcelo Bracet";
const AUTHOR_URL = "www.linkedin.com/in/marcelo-bracet/";
const AUTHORS_NAMES = ["Marcelo Bracet", "João Victor Carneiro", "Nathan"];

const MAIN_IMAGE = {
src: "/igma.jpg",
src: "/iprj.gif",
width: 180,
height: 37,
};
Expand Down Expand Up @@ -33,18 +32,22 @@ export default function Home() {
<p className="fixed left-0 top-0 flex w-full justify-center border-b border-gray-300 bg-gradient-to-b from-zinc-200 pb-6 pt-8 backdrop-blur-2xl dark:border-neutral-800 dark:bg-zinc-800/30 dark:from-inherit lg:static lg:w-auto lg:rounded-xl lg:border lg:bg-gray-200 lg:p-4 lg:dark:bg-zinc-800/30">
Created By
<code className="font-mono font-bold ml-2">
<a
href={`https://${AUTHOR_URL}`}
target="_blank"
rel="noopener noreferrer"
>
@<span>{AUTHOR_NAME}</span>
</a>
<div rel="noopener noreferrer">
@
<span>
{AUTHORS_NAMES.map((name: string, idx: number) => (
<span>
{name}
{idx < AUTHORS_NAMES.length - 1 ? ", " : ""}
</span>
))}
</span>
</div>
</code>
</p>
</div>

<div className="relative flex place-items-center before:absolute before:h-[300px] before:w-full sm:before:w-[480px] before:-translate-x-1/2 before:rounded-full before:bg-gradient-radial before:from-white before:to-transparent before:blur-2xl before:content-[''] after:absolute after:-z-20 after:h-[180px] after:w-full sm:after:w-[240px] after:translate-x-1/3 after:bg-gradient-conic after:from-yellow-200 after:via-yellow-200 after:blur-2xl after:content-[''] before:dark:bg-gradient-to-br before:dark:from-transparent before:dark:to-yellow-500 before:dark:opacity-10 after:dark:from-yellow-300 after:dark:opacity-40 before:lg:h-[360px] z-[-1]">
<div className="relative flex place-items-center before:absolute before:h-[300px] before:w-full sm:before:w-[480px] before:-translate-x-1/2 before:rounded-full before:bg-gradient-radial before:from-white before:to-transparent before:blur-2xl before:content-[''] after:absolute after:-z-20 after:h-[180px] after:w-full sm:after:w-[240px] after:translate-x-1/3 after:bg-gradient-conic after:from-slate-300 after:via-slate-400 after:blur-2xl after:content-[''] before:dark:bg-gradient-to-br before:dark:from-transparent before:dark:to-yellow-500 before:dark:opacity-10 after:dark:from-yellow-300 after:dark:opacity-40 before:lg:h-[360px] z-[-1]">
<Image
className="relative dark:drop-shadow-[0_0_0.3rem_#ffffff70] "
src={MAIN_IMAGE.src}
Expand Down
2 changes: 1 addition & 1 deletion assets/svgs/LeftArrow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export function LeftArrow(props: LeftArrowProps) {
return (
<svg
viewBox="0 0 1024 1024"
fill="currentColor"
fill="#fff"
height="1em"
width="1em"
{...props}
Expand Down
2 changes: 1 addition & 1 deletion components/FormBackground/FormBackground.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export const FormBackground = ({ form }: { form: React.ReactNode }) => {
{form}
<BackButton />
</div>
<div className="hidden md:flex bg-[url('/bg-igma.jpg')] grayscale flex-1 bg-no-repeat bg-cover bg-center" data-testid='image-testid'></div>
<div className="hidden md:flex bg-[url('/bg-roadkill.png')] grayscale flex-1 bg-no-repeat bg-cover bg-center" data-testid='image-testid'></div>
</div>
);
};
108 changes: 97 additions & 11 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
// This is your Prisma schema file,
// learn more about it in the docs: https://pris.ly/d/prisma-schema

generator client {
provider = "prisma-client-js"
}
Expand All @@ -10,13 +7,102 @@ datasource db {
url = env("DATABASE_URL")
}

model Client {
id String @id @default(auto()) @map("_id") @db.ObjectId
name String
cpf String @unique
birthday String
createdAt DateTime @default(now()) @map("created_at")
updatedAt DateTime @default(now()) @updatedAt @map("updated_at")
model Especie {
id String @id @default(auto()) @map("_id") @db.ObjectId
nomeComum String
nomeCientifico String
valor String
classeTaxonomica ClasseTaxonomica @relation(fields: [classeTaxonomicaId], references: [id])
classeTaxonomicaId String @db.ObjectId
Ocorrencia Ocorrencia[]
@@map("especies")
}

model ClasseTaxonomica {
id String @id @default(auto()) @map("_id") @db.ObjectId
nome String
especies Especie[]
@@map("classesTaxonomicas")
}

model CategoriaLocal {
id String @id @default(auto()) @map("_id") @db.ObjectId
nome String
locais Local[]
@@map("categoriasLocais")
}

model Local {
id String @id @default(auto()) @map("_id") @db.ObjectId
descricao String
tipoMovimento TipoMovimento @relation(fields: [tipoMovimentoId], references: [id])
tipoMovimentoId String @db.ObjectId
tipoLocal TipoLocal @relation(fields: [tipoLocalId], references: [id])
tipoLocalId String @db.ObjectId
categoriaLocal CategoriaLocal @relation(fields: [categoriaLocalId], references: [id])
categoriaLocalId String @db.ObjectId
Ocorrencia Ocorrencia[]
@@map("locais")
}

model TipoMovimento {
id String @id @default(auto()) @map("_id") @db.ObjectId
descricao String
locais Local[]
@@map("tiposMovimentos")
}

model TipoLocal {
id String @id @default(auto()) @map("_id") @db.ObjectId
descricao String
locais Local[]
@@map("tiposLocais")
}

model Rodovia {
id String @id @default(auto()) @map("_id") @db.ObjectId
nome String
ufs Uf[]
@@map("rodovias")
}

model Uf {
id String @id @default(auto()) @map("_id") @db.ObjectId
nome String
rodoviaId String
rodovia Rodovia @relation(fields: [rodoviaId], references: [id])
@@map("ufs")
}

model SituacaoEnvolvidoAnimal {
id String @id @default(auto()) @map("_id") @db.ObjectId
descricao String
ocorrencias Ocorrencia[]
@@map("situacoesEnvolvidoAnimal")
}

model Ocorrencia {
id String @id @default(auto()) @map("_id") @db.ObjectId
km Int
numeroPista Int
velocidadeMaxima Int
dataHora DateTime
havaiaAgua Boolean
especie Especie @relation(fields: [especieId], references: [id])
especieId String @db.ObjectId
local Local @relation(fields: [localId], references: [id])
localId String @db.ObjectId
situacaoEnvolvidoAnimal SituacaoEnvolvidoAnimal @relation(fields: [situacaoEnvolvidoAnimalId], references: [id])
situacaoEnvolvidoAnimalId String @db.ObjectId
@@map("clients")
@@map("ocorrencias")
}
Binary file added public/bg-roadkill.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/iprj.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/iprj.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 17004d3

Please sign in to comment.