A full-stack web application that provides an interactive exploration of our solar system's planets. Built with Node.js, Express, MongoDB, and deployed using Kubernetes with a comprehensive CI/CD pipeline.
- Interactive Planet Explorer: Browse through 8 planets of our solar system with detailed information
- Dynamic Data Loading: Real-time planet data fetched from MongoDB database
- Responsive Design: Beautiful UI with animated solar system background
- Health Monitoring: Built-in health check endpoints for production monitoring
- Container-Ready: Fully containerized application with Docker support
- Cloud-Native: Kubernetes-ready with separate development and production configurations
- Runtime: Node.js (v18, v20)
- Framework: Express.js
- Database: MongoDB with Mongoose ODM
- Testing: Mocha, Chai, NYC for code coverage
- HTML5/CSS3: Responsive design with custom animations
- JavaScript: Vanilla JS for client-side interactions
- Styling: Custom CSS with gradient backgrounds and animations
- Containerization: Docker
- Orchestration: Kubernetes
- CI/CD: GitHub Actions
- Cloud Storage: AWS S3 for test reports
- Monitoring: Slack notifications
- Node.js (v18 or v20)
- MongoDB (local or cloud instance)
- Docker (for containerization)
- Kubernetes cluster (for deployment)
-
Clone the repository
git clone <repository-url> cd solar-system
-
Install dependencies
npm install
-
Set up environment variables Create a `.env` file in the root directory:
MONGO_URI=mongodb://localhost:27017/superData MONGO_USERNAME=your-username MONGO_PASSWORD=your-password NODE_ENV=development
-
Start the application
npm start
The application will be available at `http://localhost:3000\`
- Build the Docker image
docker build -t solar-system:latest . - Run the container
docker run -d \ -p 3000:3000 \ -e MONGO_URI=your-mongo-uri \ -e MONGO_USERNAME=your-username \ -e MONGO_PASSWORD=your-password \ solar-system:latest
npm testnpm run coverage- Health Check: `GET /live` - Returns `{"status": "live"}`
- Readiness Check: `GET /ready` - Returns `{"status": "ready"}`
- OS Info: `GET /os` - Returns pod hostname and environment
- Planet Data: `POST /planet` - Returns planet information
solar-system/
βββ app.js # Express application setup
βββ app-controller.js # Client-side JavaScript
βββ app.test.js # Test suite
βββ index.html # Frontend interface
βββ package.json # Dependencies and scripts
βββ Dockerfile # Container configuration
βββ .github/
β βββ workflows/
β β βββ solar-system.yml # Main CI/CD pipeline
β β βββ reuse-deployments.yml # Reusable deployment workflow
β βββ custom-actions/ # Custom GitHub Actions
βββ kubernetes/
β βββ development/ # Dev environment K8s manifests
β βββ production/ # Prod environment K8s manifests
βββ images/ # Static assets
The project includes a comprehensive GitHub Actions pipeline that:
- Unit Testing: Runs tests on Node.js v18 and v20
- Code Coverage: Generates coverage reports with NYC/Istanbul
- Containerization: Builds and pushes Docker images to Docker Hub and GHCR
- Artifact Storage: Uploads test reports to AWS S3
- Deployment: Automated deployment to Kubernetes (dev/prod)
- Integration Testing: Validates deployment health
- Notifications: Sends status updates to Slack
- Main branch: Deploys to production
- Feature branches: Deploys to development
POST /planet
Content-Type: application/json
{
"id": 3
}Response:
{
"id": 3,
"name": "Earth",
"description": "Earth is the third planet from the Sun...",
"image": "https://example.com/earth.jpg",
"velocity": "29.78 km/s",
"distance": "149.6 million km"
}kubectl apply -f kubernetes/development/kubectl apply -f kubernetes/production/kubectl create secret generic mongo-db-creds \
--from-literal=MONGO_URI=your-uri \
--from-literal=MONGO_USERNAME=your-username \
--from-literal=MONGO_PASSWORD=your-password- MongoDB credentials stored as Kubernetes secrets
- Environment-specific configurations
- Health check endpoints for monitoring
- Secure container registry (GHCR)
For questions or support, please open an issue in the GitHub repository.
Note: Make sure to populate your MongoDB with planet data before running the application. The application expects planets with IDs 1-8 in the database.

