Skip to content

adeeshperera/coursegenix-infra-test

Repository files navigation

Infrastructure Test Application

A production-grade Next.js application designed to validate deployment infrastructure, CI/CD pipelines, and modern web technology stack compatibility.

🎯 Project Purpose

This test application serves as a proof-of-concept for production-grade deployment workflows, validating:

  • βœ… Docker containerization and multi-stage builds
  • βœ… Automated CI/CD pipeline with GitHub Actions
  • βœ… Multi-VPS deployment strategies
  • βœ… Modern React/Next.js stack compatibility
  • βœ… Infrastructure scalability and reliability

πŸ›  Technology Stack

Frontend

  • Next.js 15.3.2 - React framework with App Router
  • React 19.1.0 - Latest React with concurrent features
  • TypeScript 5 - Type-safe development
  • Tailwind CSS v4 - Modern utility-first CSS framework

Development Tools

  • pnpm - Fast, disk space efficient package manager
  • Turbopack - Ultra-fast development bundler
  • ESLint 9 - Code quality and consistency
  • Google Fonts (Geist) - Modern typography

Infrastructure

  • Docker - Containerization with multi-stage builds
  • GitHub Actions - Automated CI/CD pipeline
  • Multi-VPS Deployment - Redundant server architecture

πŸš€ Getting Started

Prerequisites

  • Node.js 18+
  • pnpm (recommended) or npm/yarn
  • Docker (for containerization)

Local Development

  1. Clone the repository

    git clone <repository-url>
    cd do-infra-test-app.coursegenix.me
  2. Install dependencies

    pnpm install
    # or
    npm install
  3. Start development server

    pnpm dev
    # or
    npm run dev
  4. Open your browser Navigate to http://localhost:3000

Available Scripts

Command Description
pnpm dev Start development server with Turbopack
pnpm build Build production application
pnpm start Start production server
pnpm lint Run ESLint code analysis

🐳 Docker Deployment

Build Docker Image

docker build -t coursegenix-test-app .

Run Container

docker run -p 3000:3000 coursegenix-test-app

Multi-stage Build Features

  • deps: Install dependencies only
  • builder: Build application with optimizations
  • runner: Minimal production runtime (Node.js 18 Alpine)

πŸ”„ CI/CD Pipeline

The project includes automated deployment via GitHub Actions:

Workflow Features

  • βœ… Multi-environment deployment (VPS1, VPS2)
  • βœ… Docker Hub integration for image registry
  • βœ… Automated container management (stop, remove, deploy)
  • βœ… SSH-based VPS deployment

Required Secrets

Configure the following in GitHub repository settings:

DOCKER_USERNAME     # Docker Hub username
DOCKER_PASSWORD     # Docker Hub access token
VPS1_HOST          # VPS 1 IP address
VPS1_USERNAME      # VPS 1 SSH username
VPS2_HOST          # VPS 2 IP address
VPS2_USERNAME      # VPS 2 SSH username
VPS_SSH_KEY        # SSH private key for VPS access

Deployment Trigger

Pipeline automatically deploys on push to main branch.

πŸ“ Project Structure

β”œβ”€β”€ .github/workflows/    # CI/CD pipeline configuration
β”œβ”€β”€ public/              # Static assets
β”œβ”€β”€ src/
β”‚   └── app/            # Next.js App Router pages
β”‚       β”œβ”€β”€ globals.css # Global styles with Tailwind
β”‚       β”œβ”€β”€ layout.tsx  # Root layout component
β”‚       └── page.tsx    # Homepage component
β”œβ”€β”€ Dockerfile          # Multi-stage container build
β”œβ”€β”€ next.config.ts      # Next.js configuration
β”œβ”€β”€ package.json        # Dependencies and scripts
β”œβ”€β”€ tailwind.config.js  # Tailwind CSS configuration
└── tsconfig.json       # TypeScript configuration

πŸ”§ Configuration

Next.js Configuration

  • Standalone output enabled for Docker optimization
  • App Router architecture for modern React patterns
  • TypeScript strict mode enabled

Docker Configuration

  • Multi-stage builds for optimized image size
  • Non-root user for security best practices
  • Alpine Linux base for minimal attack surface

🌐 Production Considerations

This test application validates the foundation for production deployment. For full production use, consider adding:

  • Environment variable management
  • Database integration and migrations
  • Authentication and authorization
  • Rate limiting and security headers
  • Comprehensive testing suite (unit, integration, E2E)
  • Monitoring and observability (health checks, metrics)
  • Error tracking and logging
  • CDN and caching strategies

πŸ“„ License

This project is licensed under the Apache License 2.0.

Note: This is a test project designed to validate production deployment workflows and infrastructure reliability before full-scale application development.

About

Infrastructure test application built with Next.js 15, Docker, and automated CI/CD to validate production deployment workflows and modern web technology stack.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors