This is an open-source web application designed to help animal shelters manage their operations efficiently. The app provides a user-friendly interface for potential adopters to view available pets and a comprehensive dashboard for employees to manage pet and user information.
- Framework: Next.js (React)
- Backend: Node.js
- ORM: Prisma
- Database: PostgreSQL
- Authentication: Auth.js
- Containerization: Docker
Here are some screenshots of the app:
Caption: Homepage
Caption: Showing available pets for adoption.
Caption: Showing pet information.
Caption: Admin dashboard homepage.
Caption: Admin dashboard for managing pets.
Caption: Admin dashboard: form for editing pet information.
To run this project, you will need to add the following environment variables to your .env
file:
AUTH_SECRET
: A secret key for authentication. You can generate a secret key by running the commandopenssl rand -base64 32
in your terminal. Ensure OpenSSL is installed:- macOS/Linux: OpenSSL is usually pre-installed. Verify by running
openssl version
. - Windows: Install OpenSSL from the OpenSSL website or using Chocolatey with the command
choco install openssl
.
- macOS/Linux: OpenSSL is usually pre-installed. Verify by running
AUTH_GITHUB_ID
(optional): Your GitHub OAuth client ID. Obtain this from your GitHub Developer settings.AUTH_GITHUB_SECRET
(optional): Your GitHub OAuth client secret. Obtain this from your GitHub Developer settings.AUTH_TRUST_HOST
: Set totrue
orfalse
to indicate whether to trust the host for authentication.POSTGRES_USER
: The PostgreSQL database username.POSTGRES_PASSWORD
: The PostgreSQL database password.POSTGRES_HOST
: The PostgreSQL database host. Uselocalhost
for local development or the Docker Compose service namepostgres
.POSTGRES_DB
: The PostgreSQL database name.POSTGRES_PORT
: The PostgreSQL database port.POSTGRES_URL
: The PostgreSQL connection URL, which is constructed using the above variables.
To test the admin dashboard, use the following credentials:
- Username: admin@example.com
- Password: admin123
To run the app in a Docker container, follow these steps:
- Clone the repository
git clone https://github.com/albdangarcia/animal-shelter.git
- Navigate to the project directory
cd animal-shelter
- Copy the
.env.example
file to.env
:cp .env.example .env
- Download the official PostgreSQL image from Docker Hub:
docker pull postgres
- Start the PostgreSQL container (This step starts a new PostgreSQL container with the specified password and user):
docker run --name some-postgres -e POSTGRES_PASSWORD=mysecretpassword -d postgres
- Install the dependencies:
npm install
- Push the Prisma schema to the database:
npx prisma db push
- Push the Prisma schema to the database:
npx prisma generate
- Seed the database:
npx prisma db seed
- Run the app:
npm run dev
To run the app in a Docker container, follow these steps:
- Clone the repository
git clone https://github.com/albdangarcia/animal-shelter.git
- Navigate to the project directory
cd animal-shelter
- Copy the
.env.example
file to.env
:cp .env.example .env
- Build the Docker image:
docker compose build
- Run the Docker container:
docker compose up
- Open your browser and navigate to
http://localhost:3000
Please follow these steps to contribute:
- Fork the repository.
- Create a new branch:
git checkout -b feature/your-feature-name
- Make your changes and commit them:
git commit -m 'Add some feature'
- Push to the branch:
git push origin feature/your-feature-name
- Open a pull request.
I would like to give credit to the authors of the royalty-free images used in this project:
- Image of a dog displayed on the homepage by Brett Sayles
- The rest of the pet images by Pixabay
This project is licensed under the MIT License.