A modern React web application that fetches and displays random Chuck Norris jokes using the Chuck Norris API. The app features a beautiful glassmorphism UI design and is fully containerized for easy deployment.
- 🎭 Random Chuck Norris jokes on demand
- 🎨 Modern glassmorphism UI with gradient backgrounds
- 📱 Fully responsive design for all devices
- ⚡ Fast loading with optimized React components
- 🔒 Security headers and CSP protection
- 🐳 Docker containerization with multi-stage builds
- ☸️ Kubernetes deployment ready
- 🏥 Health check endpoints for monitoring
- Frontend: React 18, CSS3 with glassmorphism effects
- HTTP Client: Axios for API requests
- Web Server: Nginx (production)
- Containerization: Docker with multi-stage builds
- Orchestration: Kubernetes deployment
chuck-app/
├── public/
│ └── index.html # HTML template
├── src/
│ ├── App.js # Main React component
│ ├── App.css # Component styling
│ ├── index.js # React entry point
│ └── index.css # Global styles
├── Dockerfile # Multi-stage Docker build
├── docker-compose.yml # Docker Compose configuration
├── nginx.conf # Production Nginx configuration
├── k8s-deployment.yaml # Kubernetes deployment
├── package.json # Node.js dependencies
└── chuck-app-api.py # Standalone Python version
- Node.js 18+ and npm
- Docker (optional)
- Kubernetes cluster (for K8s deployment)
# Install dependencies
npm install
# Start development server
npm start
# Open http://localhost:3000# Build and run the container
docker-compose up --build
# Access the app at http://localhost:3000# Build the image
docker build -t chuck-app .
# Run the container
docker run -p 3000:80 chuck-app
# Access the app at http://localhost:3000- Kubernetes cluster (local or cloud)
- kubectl configured to access your cluster
- Docker image available at
docker.io/library/chuck-app-chuck-norris-app:latest
# Apply the deployment and service
kubectl apply -f k8s-deployment.yaml
# Check deployment status
kubectl get deployments
kubectl get pods
kubectl get services# Get the NodePort service details
kubectl get service chuck-app-service
# Access the app at http://<node-ip>:30080
# For local clusters (minikube/kind):
kubectl get nodes -o wide # Get node IP- Deployment: 1 replica with resource limits (128Mi memory, 100m CPU)
- Service: NodePort type exposing port 30080
- Health Checks: Liveness and readiness probes on
/healthendpoint - Image:
docker.io/library/chuck-app-chuck-norris-app:latest
# Check pod logs
kubectl logs -l app=chuck-app
# Check pod status
kubectl describe pod -l app=chuck-app
# Test health endpoint
curl http://<node-ip>:30080/healthThe app uses the free Chuck Norris API:
- Endpoint:
https://api.chucknorris.io/jokes/random - Rate Limits: None specified
- Authentication: Not required
- Content Security Policy (CSP) headers
- X-Frame-Options protection
- XSS protection headers
- Secure asset caching
- HTTPS-ready configuration
- Gzip compression for all text assets
- Static asset caching with immutable headers
- Optimized Docker multi-stage builds
- Nginx performance tuning
- Resource limits in Kubernetes
- Fork the repository
- Create a feature branch
- Make your changes
- Test locally and with Docker
- Submit a pull request
This project is open source and available under the MIT License.
For issues and questions:
- Check the health endpoint:
/health - Review container logs
- Ensure API connectivity to
api.chucknorris.io