
- ✨ Introduction
- ⚙️ Tech Stack
- 🔋 Features
- 🤸 Quick Start
- 🔗 Assets
- 🚀 More
This repository contains the code corresponding to an in-depth tutorial available on our YouTube channel, JavaScript Mastery.
If you prefer visual learning, this is the perfect resource for you. Follow our tutorial to learn how to build projects like these step-by-step in a beginner-friendly manner!
Nike-style eCommerce built with Devin AI, Next.js, Drizzle ORM, and Better Auth. In this project, you’ll master prompting as Devin helps generate sleek product pages powered by Next.js 15, TypeScript, and TailwindCSS. The backend runs on Neon PostgreSQL with Drizzle ORM, authentication is handled with Better Auth, and Zustand manages state — all packaged in a clean, modular UI to help you ship faster.
If you're getting started and need assistance or face any bugs, join our active Discord community with over 50k+ members. It's a place where people help each other out.
-
Better Auth is a framework-agnostic authentication and authorization library for TypeScript. It provides built-in support for email and password authentication, social sign-on (Google, GitHub, Apple, and more), and multi-factor authentication, simplifying user authentication and account management.
-
Devin AI is an autonomous AI software engineer by Cognition Labs that independently plans, writes, debugs, and deploys full applications from natural language prompts. It integrates with tools like Slack, Linear, and Jira to manage tasks and pull requests, and learns new technologies on the fly by reading documentation.
-
Drizzle ORM is a lightweight and performant TypeScript ORM designed with developer experience in mind. It provides a seamless interface between application code and database operations while maintaining high performance and reliability.
-
Neon is a fully managed, serverless PostgreSQL database platform. It offers features like instant provisioning, autoscaling, and database branching, enabling developers to build scalable applications without managing infrastructure.
-
Next.js is a powerful React framework for building full-stack web applications. It simplifies development with features like server-side rendering, static site generation, and API routes, enabling developers to focus on building products and shipping quickly.
-
TailwindCSS is a utility-first CSS framework that allows developers to build custom, responsive designs quickly without leaving their HTML. It provides pre-defined classes for layout, typography, colors, and more.
-
TypeScript is a superset of JavaScript that adds static typing, providing better tooling, code quality, and error detection for developers. It is ideal for building large-scale applications and enhances the development experience.
-
Zustand is a minimal, hook-based state management library for React. It lets you manage global state with zero boilerplate, no context providers, and excellent performance through selective state subscriptions.
👉 Landing Page: A fast, engaging homepage that introduces your brand and products with smooth animations and clear calls to action.
👉 Product Listing Page: Browse all products with filters, sorting, and real-time availability—powered by Devin AI-generated content for dynamic updates.
👉 Product Details Page: Detailed product info, images, and reviews with AI-enhanced descriptions to help customers make confident buying decisions.
👉 Auth Pages: Secure and seamless user signup, login, and password recovery using Better Auth, ensuring smooth access without backend hassles.
And many more, including code architecture and reusability.
Follow these steps to set up the project locally on your machine.
Prerequisites
Make sure you have the following installed on your machine:
Cloning the Repository
git clone https://github.com/JavaScript-Mastery-Pro/e-commerce.git
cd e-commerce
Installation
Install the project dependencies using npm:
npm install
Set Up Environment Variables
Create a new file named .env
in the root of your project and add the following content:
# Database
DATABASE_URL="postgresql://username:password@host:port/database"
# Better Auth
BETTER_AUTH_SECRET="your-secret-key-here"
BETTER_AUTH_URL="http://localhost:3000"
# GitHub OAuth (optional)
GITHUB_CLIENT_ID=""
GITHUB_CLIENT_SECRET=""
# Google OAuth (optional)
GOOGLE_CLIENT_ID=""
GOOGLE_CLIENT_SECRET=""
Replace the placeholder values with your credentials. You can get these by signing up at: NeonDB, Better-Auth.
Running the Project
npm run dev
Open http://localhost:3000 in your browser to view the project.
src/
├── app/
│ ├── api/auth/[...all]/route.ts # Better Auth API routes
│ └── page.tsx # Homepage
├── lib/
│ ├── auth/
│ │ └── index.ts # Better Auth configuration
│ └── db/
│ ├── index.ts # Database connection
│ └── schema.ts # Database schema
└── store/
├── auth.ts # Authentication state
└── cart.ts # Shopping cart state
The application includes the following tables:
- users: User accounts and profiles
- sessions: User sessions for Better Auth
- accounts: OAuth accounts and credentials
- verifications: Email verification tokens
- products: Product catalog
- orders: Customer orders
- order_items: Individual items in orders
Assets and snippets used in the project can be found in the video kit.

Advance your skills with Next.js Pro Course
Enjoyed creating this project? Dive deeper into our PRO courses for a richer learning adventure. They're packed with detailed explanations, cool features, and exercises to boost your skills. Give it a go!
