An e-commerce storefront for developer products, built with Next.js and Stripe.
- 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
| 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 |
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
- Node.js 18+
- Yarn (or npm)
# 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 devOpen http://localhost:3000 in your browser.
| 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| Command | Description |
|---|---|
yarn dev |
Start development server |
yarn build |
Build for production |
yarn start |
Start production server |
yarn lint |
Run ESLint |
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- Fork the repository
- Create a feature branch (
git checkout -b feature/my-feature) - Commit your changes (
git commit -m 'Add my feature') - Push to the branch (
git push origin feature/my-feature) - Open a Pull Request
This project is licensed under the MIT License. See the LICENSE file for details.
