Skip to content

Pet adoption services app. View cats and dogs up for adoption, save favorites. Donate to the cause.

Notifications You must be signed in to change notification settings

femke77/pet-adoption-full

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

67 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pawsome Pets Adoption Services

NodeJS JavaScript Express.js Sequelize React React Router Vite TailwindCSS TypeScript React Query Redux Postgres HeadlessUI Stripe

Description ✏️

Match users with the pet of their dreams.


React query handles state from server such as pet data. Auth status and user details client state is handled by Redux Toolkit. User details are encrypted and stored in sessionStorage for persistance across reloads.

React query optimistic UI makes favoriting and unfavoriting instant regardless of server time to response. Unfavoriting on the favorties page is also instant. Filtering by Dog vs Cat vs All uses the cache.

Client built with TailwindCSS and Headless UI for React.

Zod was the original choice for user data validation, but then I found react-hook-form and used it for the contact and donate pages.

Stripe integration for donations.

Routing is done with React Router Dom.

Sequelize is the ORM for a PostgreSQL database. Express is the server. Express Router for routing.

This application uses session authentication with an axios response interceptor to redirect the user to login if session expires, but rolling is set to true with express-sessions so user should stay logged in while active, but also for x amount of time after inactivity.

This app was originally designed with headless architecture, but Safari third party cookie rules made this too difficult for this project without the introduction of sub-domains, which I wasn't interested in doing at this time, but will revisit later.

Table of Contents 📖

Installation

Usage

Issues

Contributing

Tests

Credits

Questions

Installation

To install necessary dependencies, run the following command:

npm i

Usage

Clone the repository, run the install command and then npm run start:dev. Then navigate to the localhost port.

To test the stripe integration, which is in test mode, use the CC number:

  4242 4242 4242 4242 

with any other valid test data of your choosing.

To login with registering, use

Deployed Link

https://pawsome-pets-a74380f52be3.herokuapp.com/

Screenshots

ss1

ss2

ss3

ss4

ss5

ss5


Known Issues

  • Pet data usually won't match pet image. I used fakerjs to generate fake data, and the point of this project is the coding, not the fake data.
  • Again due to limits on time with fake data, I am not concerned with ages of kittens and puppies.

How To Contribute

Fork the repository and make a pull request with your new code.

Tests

To run tests, run the following command:

npm test

Credits

Images of cats & dogs together by Vecteezy.com
Thanks to Lucky Dog Animal Rescue for providing site content and loose specs for this project.
Custom fonts from dafont.com and google fonts.

Questions

If you have any questions about the repo or notice any bugs you want to report, open an issue or contact me directly at [email protected].