Skip to content

Latest commit

Β 

History

82 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Overview

Next.js TypeScript Tailwind CSS Stripe Docker

An e-commerce storefront for developer products, built with Next.js and Stripe.

Live Demo

DevStore Screenshot

Features

  • Shopping cart β€” add, remove, and update items with persistent state
  • Product search β€” real-time search with server-side filtering
  • Stripe checkout β€” secure payment processing
  • Responsive layout β€” works on mobile, tablet, and desktop
  • Optimized images β€” Next.js Image component with lazy loading
  • App Router β€” Next.js 15 with React Server Components
  • E2E tests β€” Cypress test suite running on CI

Tech Stack

Layer Technology
Framework Next.js 15 (App Router)
Language TypeScript 5
Styling Tailwind CSS 3
Payments Stripe
Validation Zod
Icons Lucide React
Testing Cypress
Linting ESLint + Rocketseat config

Project Structure

ecommerce-next/
β”œβ”€β”€ cypress/                    # E2E test specs
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ app/
β”‚   β”‚   β”œβ”€β”€ (store)/            # Store route group
β”‚   β”‚   β”‚   β”œβ”€β”€ (home)/         # Home page
β”‚   β”‚   β”‚   β”œβ”€β”€ product/[slug]/ # Product detail page
β”‚   β”‚   β”‚   └── search/         # Search results page
β”‚   β”‚   β”œβ”€β”€ api/
β”‚   β”‚   β”‚   └── products/       # Product API routes
β”‚   β”‚   β”œβ”€β”€ globals.css
β”‚   β”‚   └── layout.tsx
β”‚   β”œβ”€β”€ components/             # React components
β”‚   β”œβ”€β”€ contexts/               # React Context providers
β”‚   β”œβ”€β”€ data/                   # Types and data definitions
β”‚   └── env.ts                  # Environment variable validation
β”œβ”€β”€ public/                     # Static assets
β”œβ”€β”€ cypress.config.ts
β”œβ”€β”€ next.config.js
β”œβ”€β”€ tailwind.config.ts
└── tsconfig.json

Getting Started

Prerequisites

  • Node.js 18+
  • Yarn (or npm)

Installation

# Clone the repository
git clone https://github.com/rafaumeu/ecommerce-next.git

# Enter the project directory
cd ecommerce-next

# Install dependencies
yarn install

# Set up environment variables
cp .env.example .env.local

# Start the dev server
yarn dev

Open http://localhost:3000 in your browser.


Environment Variables

Variable Description
NEXT_PUBLIC_API_BASE_URL API base URL for product data
APP_URL Application public URL

Create a .env.local file in the project root:

NEXT_PUBLIC_API_BASE_URL=https://your-api-url.com
APP_URL=http://localhost:3000

Scripts

Command Description
yarn dev Start development server
yarn build Build for production
yarn start Start production server
yarn lint Run ESLint

Testing

This project uses Cypress for end-to-end testing. Tests run automatically on every push via GitHub Actions.

# Run Cypress in headless mode
npx cypress run

# Open Cypress interactive runner
npx cypress open

Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/my-feature)
  3. Commit your changes (git commit -m 'Add my feature')
  4. Push to the branch (git push origin feature/my-feature)
  5. Open a Pull Request

License

This project is licensed under the MIT License. See the LICENSE file for details.


LinkedIn GitHub


Built with ❀️ by Rafael Zendron

Use this template

About

πŸ›’ DevStore β€” Next.js 15 SSR e-commerce with Stripe payments, TailwindCSS & Cypress E2E

Topics

Resources

Security policy

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages