https://github.com/runhannah/dog-finder
Find your match! Includes session managment with cookies, protected routes. TypeScript, React, Next.js, Shadcn, Tailwind
https://github.com/runhannah/dog-finder
middleware protected-routes session-cookie
Last synced: 9 months ago
JSON representation
Find your match! Includes session managment with cookies, protected routes. TypeScript, React, Next.js, Shadcn, Tailwind
- Host: GitHub
- URL: https://github.com/runhannah/dog-finder
- Owner: RunHannah
- Created: 2025-03-01T08:35:28.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-04-18T20:16:05.000Z (about 1 year ago)
- Last Synced: 2025-07-13T21:31:48.949Z (12 months ago)
- Topics: middleware, protected-routes, session-cookie
- Language: TypeScript
- Homepage: https://dog-finder-six.vercel.app
- Size: 5.53 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Dog Finder
Find your new best friend! Browse dogs from our network of shelters and rescues.
## Features
### Authentication
- **Login and Logout:** Users can log in and log out using the provided login and logout functions.
- **Session Management:** Sessions are managed using cookies. The session is created with `createSession` and deleted with `deleteSession`.
- **Protected Routes:** Middleware in `middleware.ts` protects `/search` and `/favorites` routes and redirects users based on their authentication status.
### Cookies and Sessions
- **Session Storage:** Sessions are stored in cookies with HTTP-only, secure, and same-site attributes.
- **Authentication Check:** The middleware checks for the session cookie to determine if a user is authenticated.
### Liking and Matching
- **Favorites:** Users can like dogs and view their favorite dogs on the Favorites page (`app/favorites/page.tsx`).
- **Matching:** Users can get a match from their favorite dogs using the `getMatch` function.
- **Match Details:** The Favorites page displays a drawer with match details when a match is found.
### Searching, Filtering and Sorting
- **Search:** By city and state
- **Filter:** By breed, minimum age, and maximum age
- **Sort:** By breed, name, age, and desc or asc order
## Technologies
- **TypeScript**
- **React 19**
- **Next.js 15**
- **React Hook Form**
- **Zod**
- **Tailwind**
- **Shadcn/ui**
## Getting Started
To run this application locally, follow these steps:
### Prerequisites
Ensure you have the following installed:
- [Node.js](https://nodejs.org/) (version 14.0 or higher)
- [npm](https://www.npmjs.com/) (comes with Node.js)
### Installation
**Clone the repository, install packages, start server:**
```bash
git clone https://github.com/RunHannah/dog-finder
npm install
npm run dev
```