An application for managing the adoption of puppies. This backend project is built using TypeScript, Node.js, Fastify, Zod, Prisma, and is deployed using Render.
Make sure you have the following installed before running this project:
- Node.js (v18)
- npm (Node Package Manager)
- PostgreSQL
- Clone the repository:
git clone [repository-url]
- Change into the project's directory:
cd adopt-a-puppy
- Install the dependencies:
npm install
- Create a
.env
file in the root directory and configure the database connection:
DATABASE_URL=postgresql://<username>:<password>@<host>:<port>/<database-name>
- Start the PostgreSQL database using Docker:
docker run -d --name puppy-database -e POSTGRES_USER=<username> -e POSTGRES_PASSWORD=<password> -e POSTGRES_DB=<database-name> -p 5432:5432 postgres
- Run the database migrations:
npx prisma migrate dev
- Start the server:
npm run dev
- The API should now be available at
http://localhost:3000
.
-
Create an account on Render and set up a new service.
-
Configure a PostgreSQL database and take note of the connection URL.
-
Set up the following environment variables on Render:
DATABASE_URL
: The PostgreSQL connection URL.
-
Push the code to your Render service repository.
-
Render will automatically build and deploy the application.