Skip to content

Full-stack application demonstrating comprehensive CI/CD pipeline with multiple languages and security scanning

Notifications You must be signed in to change notification settings

Rishirandhawa/fullstack-cicd-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fullstack CI/CD Demo

CI CI License: MIT TypeScript FastAPI Docker Kubernetes PRs Welcome

A production-ready fullstack application demonstrating modern CI/CD practices, with React frontend and FastAPI backend.

πŸš€ Features

Frontend (React + TypeScript)

  • TypeScript for type safety
  • React with modern hooks and patterns
  • Redux Toolkit for state management
  • Comprehensive testing setup with Jest and Testing Library
  • ESLint and Prettier for code quality
  • Multi-stage Docker builds for optimal image size

Backend (FastAPI + PostgreSQL)

  • FastAPI for high-performance API development
  • PostgreSQL with SQLAlchemy ORM
  • Alembic for database migrations
  • Comprehensive testing with pytest
  • Type hints and Pydantic models
  • OpenAPI documentation

DevOps & CI/CD

  • GitHub Actions for automated CI/CD
  • Separate workflows for frontend and backend
  • Automated testing on each PR
  • Security scanning for dependencies
  • Docker containerization
  • Kubernetes deployment manifests
  • Automated deployments to production

πŸ“‹ Prerequisites

  • Node.js 18+
  • Python 3.11+
  • Docker and Docker Compose
  • Kubernetes cluster (for production deployment)
  • PostgreSQL (for local development)

πŸ›  Local Development

Backend Setup

# Navigate to backend directory
cd backend

# Create virtual environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

# Set up environment variables
cp .env.example .env
# Edit .env with your configurations

# Run migrations
alembic upgrade head

# Start development server
uvicorn app.main:app --reload

Frontend Setup

# Navigate to frontend directory
cd frontend

# Install dependencies
npm install

# Start development server
npm start

πŸ§ͺ Running Tests

Backend Tests

cd backend
pytest -v --cov

Frontend Tests

cd frontend
npm test

πŸ‹ Docker Development

# Build and run all services
docker-compose up --build

# Run specific service
docker-compose up backend
docker-compose up frontend

πŸš€ Deployment

Prerequisites

  • Kubernetes cluster
  • kubectl configured
  • GitHub Container Registry access

Deployment Steps

# Apply Kubernetes configurations
kubectl apply -f kubernetes/

# Verify deployments
kubectl get deployments
kubectl get pods
kubectl get services

πŸ”’ Security Features

  • CORS configuration
  • Environment variables management
  • Kubernetes secrets for sensitive data
  • Resource limits and quotas
  • Health checks and probes
  • Regular security scanning
  • Dependency updates

πŸ“Š Monitoring and Logging

  • Kubernetes liveness and readiness probes
  • Health check endpoints
  • Resource monitoring
  • Application logs through Kubernetes

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Commit your changes
  4. Push to the branch
  5. Create a Pull Request

πŸ“ Development Workflow

  1. Pull Requests are required for all changes
  2. CI must pass before merging
  3. Reviews required for all PRs
  4. Squash merge for clean history
  5. Delete branches after merging

πŸ“„ License

MIT

πŸ”— Architecture

β”œβ”€β”€ frontend/                # React frontend
β”‚   β”œβ”€β”€ src/                # Source code
β”‚   β”œβ”€β”€ tests/              # Test files
β”‚   └── Dockerfile          # Frontend container
β”œβ”€β”€ backend/                # FastAPI backend
β”‚   β”œβ”€β”€ app/                # Application code
β”‚   β”œβ”€β”€ tests/              # Test files
β”‚   └── Dockerfile          # Backend container
β”œβ”€β”€ kubernetes/             # K8s manifests
└── .github/
    └── workflows/          # CI/CD pipelines

βš™οΈ Environment Variables

Backend

  • POSTGRES_SERVER: Database host
  • POSTGRES_USER: Database user
  • POSTGRES_PASSWORD: Database password
  • POSTGRES_DB: Database name

Frontend

  • REACT_APP_API_URL: Backend API URL

πŸ‘₯ Support

For support, please open an issue in the repository.

About

Full-stack application demonstrating comprehensive CI/CD pipeline with multiple languages and security scanning

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published