A modern, full-stack ecommerce platform for pet supplies built with Next.js 14, Prisma, and Redux. Features include user authentication, shopping cart functionality, and secure payments via Stripe.
- ποΈ Full ecommerce functionality
- π Authentication with NextAuth.js (including Google OAuth)
- π³ Secure payment processing with Stripe
- π Shopping cart with Redux persistence
- π± Responsive design with Tailwind CSS
- π¨ Modern UI components with Radix UI
- π Type-safe with TypeScript
- ποΈ PostgreSQL database with Prisma ORM
- Clone the repository:
git clone https://github.com/yourusername/petshop-ecommerce.git
cd petshop-ecommerce
- Create a
.env
file in the root directory:
# Database
DATABASE_URL="postgresql://username:password@localhost:5432/petshop?schema=public"
# Auth
AUTH_SECRET="your-auth-secret-key"
NEXTAUTH_URL="http://localhost:3000"
# Google OAuth
GOOGLE_CLIENT_ID="your-google-client-id"
GOOGLE_CLIENT_SECRET="your-google-client-secret"
# Stripe
STRIPE_SECRET_KEY="your-stripe-secret-key"
STRIPE_WEBHOOK_SECRET="your-stripe-webhook-secret"
- Configure the database in
docker-compose.yaml
:
version: '3.8'
services:
postgres:
image: postgres:latest
environment:
POSTGRES_USER: your_username
POSTGRES_PASSWORD: your_password
POSTGRES_DB: petshop
ports:
- '5432:5432'
volumes:
- postgres_data:/var/lib/postgresql/data
volumes:
postgres_data:
- Start the PostgreSQL database:
docker-compose up -d
- Install dependencies:
npm install
# or
yarn install
- Run Prisma migrations:
npx prisma migrate dev
- Seed the database (optional):
npx prisma db seed
- Start the development server:
npm run dev
# or
yarn dev
Visit http://localhost:3000 to see your application running! π
petshop/
βββ .next/ # Next.js build output
βββ node_modules/ # Project dependencies
βββ postgresql/ # Database container data
βββ prisma/ # Database schema and migrations
βββ public/ # Static assets and images
βββ src/ # Source code
β βββ app/ # Next.js app router components and pages
β βββ hooks/ # Custom React hooks
β βββ lib/ # Utility functions and shared logic
β βββ mocks/ # Mock data and testing utilities
β βββ store/ # Redux store configuration
β βββ types/ # TypeScript type definitions
β βββ routes.ts # Routes in app
β βββ middleware.ts # Next.js middleware configuration
β βββ auth.ts # Authentication configuration
βββ .env # Environment variables
βββ docker-compose.yaml # Docker configuration
βββ next.config.js # Next.js configuration
βββ package.json # Project dependencies and scripts
βββ postcss.config.js # PostCSS configuration
βββ README.md # Project documentation
βββ tailwind.config.js # Tailwind CSS configuration
βββ tsconfig.json # TypeScript configuration
.next/
: Contains the built production codeprisma/
: Houses the database schema, migrations, and seed datasrc/
: Main source code directorytypes/
: TypeScript type definitionsapp/
: Frontend pages and components using Next.js App Routerhooks/
: Reusable React hookslib/
: Shared utilities and helper functionsmocks/
: Testing utilities and mock datastore/
: Redux store setup, slices, and actions
-
Frontend
- Next.js 14
- React
- Redux Toolkit
- Tailwind CSS
- Radix UI Components
- React Hook Form
-
Backend
- Next.js API Routes and Server Actions
- Prisma ORM
- PostgreSQL
- Auth.js v5
- Stripe API
# Development server
npm run dev
# Build for production
npm run build
# Production server
npm start
# Lint code
npm run lint
# Generate Prisma client
npx prisma generate
# Open Prisma Studio
npx prisma studio
# Run migrations
npx prisma migrate dev
This project is open source and free.
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the project
- Create your feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Give a βοΈ if this project helped you!
Camilo Ordonez Herrera - @92iMAHC - cronox20@gmail.com
Project Link: https://store.caoh29.dev