Skip to content

A web app streamlining animal shelter operations by connecting potential adopters with available pets and providing staff with tools to manage information.

License

Notifications You must be signed in to change notification settings

albdangarcia/animal-shelter

Repository files navigation

Animal Shelter Web App

Project Description

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.

Tech Stack

  • Framework: Next.js (React)
  • Backend: Node.js
  • ORM: Prisma
  • Database: PostgreSQL
  • Authentication: Auth.js
  • Containerization: Docker

Screenshots

Here are some screenshots of the app:

Homepage

Caption: Homepage

PublicPets

Caption: Showing available pets for adoption.

PublicPetDetails

Caption: Showing pet information.

DashboardHome

Caption: Admin dashboard homepage.

DashboardPets

Caption: Admin dashboard for managing pets.

DashboardEditPet

Caption: Admin dashboard: form for editing pet information.

Environment Variables

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 command openssl 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.
  • 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 to true or false 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. Use localhost for local development or the Docker Compose service name postgres.
  • 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.

Admin Dashboard Access

To test the admin dashboard, use the following credentials:

Running the App

Run Locally

To run the app in a Docker container, follow these steps:

  1. Clone the repository
    git clone https://github.com/albdangarcia/animal-shelter.git
  2. Navigate to the project directory
    cd animal-shelter
  3. Copy the .env.example file to .env:
    cp .env.example .env
  4. Download the official PostgreSQL image from Docker Hub:
    docker pull postgres
  5. 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
  6. Install the dependencies:
    npm install
  7. Push the Prisma schema to the database:
    npx prisma db push
  8. Push the Prisma schema to the database:
    npx prisma generate
  9. Seed the database:
    npx prisma db seed
  10. Run the app:
    npm run dev

Using Docker

To run the app in a Docker container, follow these steps:

  1. Clone the repository
    git clone https://github.com/albdangarcia/animal-shelter.git
  2. Navigate to the project directory
    cd animal-shelter
  3. Copy the .env.example file to .env:
    cp .env.example .env
  4. Build the Docker image:
    docker compose build
  5. Run the Docker container:
    docker compose up
  6. Open your browser and navigate to http://localhost:3000

Contributing

Please follow these steps to contribute:

  1. Fork the repository.
  2. Create a new branch:
    git checkout -b feature/your-feature-name
  3. Make your changes and commit them:
    git commit -m 'Add some feature'
  4. Push to the branch:
    git push origin feature/your-feature-name
  5. Open a pull request.

Credits

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

License

This project is licensed under the MIT License.

About

A web app streamlining animal shelter operations by connecting potential adopters with available pets and providing staff with tools to manage information.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published