credit-card-checkout-nextjs Tailwind Templates

Credit Card Checkout Nextjs

A credit card checkout interface built with Next.js 15, React 19, and TypeScript. This project features a credit card form with Zod validation, and a responsive UI powered by Tailwind CSS and ShadCN UI. It follows best development practices with ESLint, Prettier, and Husky, and includes CI/CD automation with GitHub Actions. ๐Ÿš€

๐Ÿš€ Credit Card Checkout Next.JS 15

React Next.js TypeScript Tailwind CSS Zod ShadCN UI ESLint Prettier GitHub Actions Vercel

๐ŸŒŸ Overview

This project is built with Next.js 15, TypeScript, and Tailwind CSS to provide a modern and scalable web application. It includes React Hook Form, Zod for form validation, ShadCN UI for beautiful components, and follows best coding practices with ESLint, Prettier, and Husky. CI/CD is handled by GitHub Actions with automatic deployments to Vercel.

๐Ÿš€ Live Demo

๐Ÿ”— Check out the deployed application here!

๐Ÿ“– Table of Contents

๐Ÿš€ Project Setup

To get started, make sure you have Node.js >= 22 and npm >= 10 installed.

# Clone the repository
git clone https://github.com/Hechprad/credit-card-checkout-nextjs.git
cd credit-card-checkout-nextjs

# Install dependencies
npm install

# Start the development server
npm run dev

๐Ÿ›  Running Tests

# Run all tests
npm test

# Run all tests with watch mode
npm test:watch

# Run tests with coverage
npm run test:coverage

๐Ÿ“‚ Project Structure

๐Ÿ“ฆ project-name
 โ”ฃ ๐Ÿ“‚ .github             # GitHub-related workflows (e.g., Actions, issue templates)
 โ”ฃ ๐Ÿ“‚ .husky              # Husky configuration for pre-commit and pre-push hooks
 โ”ฃ ๐Ÿ“‚ .vscode             # VS Code settings and extensions for the project
 โ”ฃ ๐Ÿ“‚ src                 # Main source code folder
 โ”ƒ โ”ฃ ๐Ÿ“‚ app               # Next.js App Router structure
 โ”ƒ โ”ฃ ๐Ÿ“‚ assets            # Static assets (images, icons, bgs, etc.)
 โ”ƒ โ”ฃ ๐Ÿ“‚ components        # Reusable UI components
 โ”ƒ โ”ฃ ๐Ÿ“‚ config            # Application configuration files (Jest)
 โ”ƒ โ”ฃ ๐Ÿ“‚ lib               # Utility functions and helpers (ShadCN)
 โ”ƒ โ”ฃ ๐Ÿ“‚ services          # API calls and business logic
 โ”ƒ โ”ฃ ๐Ÿ“‚ styles            # Global styles (Tailwind configurations, custom styles)
 โ”ƒ โ”ฃ ๐Ÿ“‚ types             # TypeScript type definitions
 โ”ฃ ๐Ÿ“œ .editorconfig       # Code style consistency across different editors
 โ”ฃ ๐Ÿ“œ .gitattributes      # Git configuration (e.g., line endings, file handling)
 โ”ฃ ๐Ÿ“œ .gitignore          # Files and folders to be ignored by Git
 โ”ฃ ๐Ÿ“œ .prettierignore     # Files ignored by Prettier formatting
 โ”ฃ ๐Ÿ“œ .prettierrc.json    # Prettier formatting rules
 โ”ฃ ๐Ÿ“œ components.json     # ShadCN UI component registry
 โ”ฃ ๐Ÿ“œ eslint.config.mjs   # ESLint configuration file
 โ”ฃ ๐Ÿ“œ jest.config.ts      # Jest configuration for unit testing
 โ”ฃ ๐Ÿ“œ next.config.ts      # Next.js configuration file
 โ”ฃ ๐Ÿ“œ package.json        # Project dependencies, scripts, and metadata
 โ”ฃ ๐Ÿ“œ postcss.config.mjs  # PostCSS configuration for Tailwind
 โ”ฃ ๐Ÿ“œ README.md           # Project documentation
 โ”ฃ ๐Ÿ“œ tsconfig.json       # TypeScript compiler settings

๐ŸŒ Available Routes

Route Description
/ Home page
/checkout/cart Empty page - Step 1
/checkout/payment Main feature page - Step 2
/checkout/confirmation Empty page - Step 3
/??? Not found page

๐Ÿค– GitHub Actions

This project includes a CI/CD pipeline with GitHub Actions:

  • Lint & Test: Runs ESLint and Jest tests on pull requests
  • Build & Deploy: Deploys to Vercel on push to the main branch

๐Ÿ”ฎ Future Improvements

  • Implement more unit tests ๐Ÿงช
  • Add internationalization (i18n) ๐ŸŒ
  • Build cart and confirmation pages ๐Ÿ“ƒ

๐Ÿ‘ค Author

Jorge Hecherat ๐Ÿ’ป GitHub โ€ข ๐Ÿ“ง Email

๐Ÿ“œ License

This project is licensed under the MIT License. Feel free to use and modify it!

Top categories

Loading Svelte Themes