-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #74 from emiliosheinz/dev
chore: 🚀 release
- Loading branch information
Showing
8 changed files
with
53 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
# SOS Pet | ||
|
||
![Banner with a white dog in the mud](./docs/images/banner.png) | ||
SOS Pet is a system dedicated to connecting animals rescued from floods with available temporary shelters. We believe that in times of crisis, every life is important, and it is our mission to help ensure that animals at risk find a safe and welcoming place while awaiting their return home or a new beginning. | ||
|
||
O SOS Pet é um sistema dedicado a conectar animais resgatados de enchentes com abrigos temporários disponíveis. Acreditamos que, em momentos de crise, cada vida é importante, e é nossa missão ajudar a garantir que animais em situação de risco encontrem um local seguro e acolhedor enquanto aguardam seu retorno ao lar ou um novo começo. | ||
![Banner with a white dog in the mud](./docs/images/banner.png) | ||
|
||
Com o SOS Pet, as pessoas que resgatam animais de enchentes podem rapidamente encontrar abrigos próximos com vagas disponíveis, obtendo informações cruciais, como capacidade, contato e localização. Nosso sistema permite que abrigos se cadastrem e atualizem suas informações, proporcionando uma base de dados confiável para os resgatadores. | ||
With SOS Pet, people who rescue animals from floods can quickly find nearby shelters with available spaces, obtaining crucial information such as capacity, contact details, and location. Our system allows shelters to register and update their information, providing a reliable database for rescuers. | ||
|
||
## Rodando o projeto localmente | ||
## Local Development | ||
|
||
1. Clone o repositório | ||
1. Instale as dependências | ||
1. Crie um arquivo `.env` baseando se no `.env.example` | ||
1. Assegure se de preencher todas as variáveis ambiente. | ||
1. Suba o baco de dados: `docker-compose up -d` | ||
1. Rode as migrations: `npx prisma migrate dev` | ||
1. Rode o projeto com o script `dev` disponível no `package.json` | ||
1. Clone the repository | ||
1. Install the dependencies | ||
1. Create a `.env` file based on `.env.example` | ||
1. Ensure all environment variables are filled in | ||
1. Start the database with `docker-compose up -d` | ||
1. Run the migrations with `npx prisma migrate dev` | ||
1. Run the project using the dev script available in `package.json` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
export function OrSeparator() { | ||
return ( | ||
<div className="relative my-5"> | ||
<span className="absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 transform bg-white pb-1 text-lg tracking-widest text-neutral-500"> | ||
ou | ||
</span> | ||
<hr /> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,16 @@ | ||
import { Loader2 } from "lucide-react"; | ||
import { redirect } from "next/navigation"; | ||
import { Suspense, type PropsWithChildren } from "react"; | ||
import { getServerAuthSession } from "~/server/auth"; | ||
"use client"; | ||
|
||
import { useSession } from "next-auth/react"; | ||
import { redirect, usePathname } from "next/navigation"; | ||
import { type PropsWithChildren } from "react"; | ||
|
||
export default function ShelterLayout({ children }: PropsWithChildren) { | ||
const pathname = usePathname(); | ||
const { data: session } = useSession(); | ||
|
||
export default async function ShelterLayout({ children }: PropsWithChildren) { | ||
const session = await getServerAuthSession(); | ||
if (!session) { | ||
redirect("/signin?callbackUrl=/user/shelters"); | ||
redirect(`/signin?callbackUrl=${pathname}`); | ||
} | ||
return ( | ||
<Suspense | ||
fallback={ | ||
<div className="flex w-full justify-center pt-28"> | ||
<Loader2 className="size-8 animate-spin" /> | ||
</div> | ||
} | ||
> | ||
{children} | ||
</Suspense> | ||
); | ||
|
||
return children; | ||
} |