An open API service indexing awesome lists of open source software.

https://github.com/rasyosef/heirarch-square

e-commerce site built with Next.js, TypeScript, React, Shadcn, Prisma, PostgreSQL, Redis, Upstash AI Search, NextAuth, and Docker
https://github.com/rasyosef/heirarch-square

docker docker-compose e-commerce next-auth nextjs postgresql prisma-orm react redis shadcn-ui typescript upstash-search vercel

Last synced: about 2 months ago
JSON representation

e-commerce site built with Next.js, TypeScript, React, Shadcn, Prisma, PostgreSQL, Redis, Upstash AI Search, NextAuth, and Docker

Awesome Lists containing this project

README

          

# Heirarch Square


Heirarch Square is an e-commerce site built with Next.js and PostgreSQL



Deployed URL: [heirarch-square.vercel.app](https://heirarch-square.vercel.app)

![homepage](public/homepage-screenshot.png)

## Running Locally

First, create a `.env` file in the root directory of the project and set the following environment variables.

```shell
# a secret for NextAuth, can be generated using https://generate-secret.vercel.app/32

AUTH_SECRET=
AUTH_TRUST_HOST=true
NEXTAUTH_URL=http://localhost:3000

# postgres database connection string

DATABASE_URL=

# vercel blob write token, used when uploading product images
BLOB_READ_WRITE_TOKEN=
```

Then, run the development server:

```bash
pnpm install
pnpm prisma db push
pnpm prisma generate
pnpm dev
```

Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.

Visit [http://localhost:3000/seed](http://localhost:3000/seed) to seed the database.

## Running with Docker

First, create a `.env` file and set the following environment variables.

```shell
# a secret for NextAuth, can be generated using https://generate-secret.vercel.app/32

AUTH_SECRET=
AUTH_TRUST_HOST=true
NEXTAUTH_URL=http://localhost:3000

# postgres database connection string

DATABASE_URL=postgresql://postgres:postgres@db:5432/postgres

# vercel blob write token, used when uploading product images
BLOB_READ_WRITE_TOKEN=
```

Then, start the docker containers

```bash
docker compose up
```

Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.

Visit [http://localhost:3000/seed](http://localhost:3000/seed) to seed the database.