A modern, full-stack e-commerce application built with Next.js, featuring user authentication, product browsing, shopping cart, order management, and integrated clickstream analytics for computer products.
This Next.js application serves as the frontend for an e-commerce platform selling computer products. It integrates seamlessly with AWS services for hosting, authentication, payments, and data management, while collecting user interaction data for analytics.
The app is designed to provide a smooth shopping experience with features like product search, categorization, wishlists, and secure checkout powered by Stripe.
For a comprehensive overview of the entire Clickstream Analytics Platform, including backend architecture, data pipelines, and analytics dashboards, please refer to profile/README.md.
- User Authentication: Secure login and registration using Amazon Cognito
- Product Catalog: Browse and search computer products with categories and brands
- Shopping Cart: Add, remove, and manage cart items with quantity controls
- Wishlist: Save favorite products for later
- Order Management: View order history and details
- Responsive Design: Mobile-first design with Tailwind CSS
- Clickstream Analytics: Integrated event tracking for user behavior analysis
- SEO Optimized: Server-side rendering and static generation for better performance
- Next.js 15 - React framework with App Router
- React 18 - UI library
- TypeScript - Type-safe JavaScript
- Tailwind CSS - Utility-first CSS framework
- Radix UI - Accessible UI components
- Lucide React - Icon library
- Prisma - ORM for database operations
- PostgreSQL - Operational database (OLTP)
- Sanity - Headless CMS for content management
- AWS Amplify - Hosting and deployment
- Amazon Cognito - User authentication
- Amazon S3 - Static assets and clickstream data storage
- Amazon CloudFront - CDN for global distribution
- Stripe - Payment processing
- Custom Clickstream Client - Event tracking and analytics
- ESLint - Code linting
- PostCSS - CSS processing
- Turbopack - Fast bundler for development
- Node.js 18.x or later
- npm or yarn package manager
- PostgreSQL database (for local development)
- AWS account (for deployment and services)
- Stripe account (for payments)
-
Clone the repository
git clone <repository-url> cd ClickSteam.NextJS
-
Install dependencies
npm install
-
Set up environment variables
Create a
.env.localfile in the root directory and add the following variables:# Database DATABASE_URL="postgresql://username:password@localhost:5432/database_name" # AWS Amplify NEXT_PUBLIC_AMPLIFY_REGION=your-aws-region NEXT_PUBLIC_AMPLIFY_USER_POOL_ID=your-user-pool-id NEXT_PUBLIC_AMPLIFY_USER_POOL_CLIENT_ID=your-client-id # Sanity CMS NEXT_PUBLIC_SANITY_PROJECT_ID=your-sanity-project-id NEXT_PUBLIC_SANITY_DATASET=production SANITY_AUTH_TOKEN=your-sanity-auth-token # Stripe NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=your-stripe-publishable-key STRIPE_SECRET_KEY=your-stripe-secret-key STRIPE_WEBHOOK_SECRET=your-stripe-webhook-secret # Clickstream NEXT_PUBLIC_CLICKSTREAM_API_URL=your-api-gateway-url
-
Set up the database
# Generate Prisma client npx prisma generate # Run database migrations npx prisma migrate dev # Seed the database (optional) npm run db:seed
-
Configure Sanity (if using CMS features)
# Extract and generate types npm run typegen
-
Start the development server
npm run dev
-
Open your browser
Navigate to http://localhost:3000 to view the application.
-
Build the application
npm run build
-
Start the production server
npm run start
This application is designed to be deployed on AWS Amplify:
-
Connect to AWS Amplify
- Push your code to a Git repository (GitHub, GitLab, etc.)
- Connect the repository to AWS Amplify Console
-
Configure Build Settings
- Build command:
npm run build - Build output directory:
.next
- Build command:
-
Environment Variables
- Set all required environment variables in Amplify Console
-
Domain Configuration
- Configure custom domain if needed
- Set up SSL certificates
For detailed deployment instructions and architecture considerations, see profile/README.md.
βββ actions/ # Server actions for API operations
βββ app/ # Next.js App Router pages and layouts
β βββ (client)/ # Client-side routes
β βββ api/ # API routes
β βββ globals.css # Global styles
βββ components/ # Reusable React components
β βββ ui/ # UI components (Radix UI based)
β βββ ... # Feature-specific components
βββ constants/ # Application constants
βββ contexts/ # React contexts for state management
βββ hooks/ # Custom React hooks
βββ lib/ # Utility libraries and configurations
βββ prisma/ # Database schema and migrations
βββ public/ # Static assets
βββ sanity/ # Sanity CMS configuration
βββ profile/ # Project documentation and architecture
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request


