SnapDeploy is a modern, automated web application deployment platform that allows developers to deploy their GitHub repositories to the cloud with just a few clicks. Think of it as a simplified version of Vercel or Netlify, built with a microservices architecture.
Live Demo: Experience SnapDeploy's lightning-fast deployments at snapdeploy.me
- ๐ GitHub Integration: Connect your GitHub account and deploy repositories directly
- โก Instant Deployment: Deploy your applications in seconds with automated build pipelines
- ๐ Custom Subdomains: Each project gets a unique subdomain (e.g.,
your-project.snapdeploy.me
) - ๐ Private Repository Support: Deploy both public and private GitHub repositories
- ๐ Real-time Logs: Monitor your deployment progress with live build logs
- ๐ง Environment Variables: Configure custom environment variables for your projects
- ๐ Dark/Light Theme: Modern UI with theme switching support
- ๐ฑ Responsive Design: Works seamlessly on desktop and mobile devices
SnapDeploy consists of four main microservices:
- Technology: React 18 + Vite + Tailwind CSS
- Purpose: User interface for project management and deployment
- Features:
- Project creation and management
- GitHub repository selection
- Real-time deployment monitoring
- User authentication and profile management
- Technology: Node.js + Express + MongoDB
- Purpose: Backend API handling authentication, project management, and deployments
- Key Features:
- JWT-based authentication
- GitHub OAuth integration
- Project CRUD operations
- Deployment orchestration
- Real-time log streaming
- Technology: Docker + Node.js + AWS ECS
- Purpose: Automated build and deployment pipeline
- Process:
- Clones repository from GitHub
- Installs dependencies (
npm install
) - Builds the project (
npm run build
) - Uploads build artifacts to AWS S3
- Streams logs back to the API server
- Technology: Node.js + Express + HTTP Proxy
- Purpose: Routes subdomain requests to appropriate S3-hosted sites
- Features:
- Subdomain-based routing
- Project lookup caching
- Proxy to S3 static hosting
- Runtime: Node.js
- Framework: Express.js
- Database: MongoDB with Mongoose ODM
- Authentication: JWT + GitHub OAuth
- Cloud: AWS (ECS, S3, VPC)
- Message Queue: Kafka
- Validation: Zod
- Framework: React 18
- Build Tool: Vite
- Styling: Tailwind CSS
- Routing: React Router DOM
- HTTP Client: Axios
- Icons: Lucide React
- Notifications: React Hot Toast
- Containerization: Docker
- Orchestration: AWS ECS (Fargate)
- Storage: AWS S3
- Proxy: Custom Node.js reverse proxy
- CI/CD: Automated via ECS tasks
-
User Authentication
- User signs up/logs in to SnapDeploy
- Connects GitHub account via OAuth
-
Project Creation
- User selects a GitHub repository
- Configures project settings (name, branch, environment variables)
- Generates unique subdomain
-
Build Process
- API server triggers ECS task
- Build container clones the repository
- Installs dependencies and builds the project
- Uploads build artifacts to S3
-
Deployment
- S3 reverse proxy routes subdomain traffic
- Project becomes accessible at
subdomain.domain.com
- Real-time logs stream to the frontend
{
name: String,
gitURL: String,
subdomain: String,
owner: ObjectId, // User reference
frontendPath: String,
envVariables: Map,
githubBranch: String,
isPrivateRepo: Boolean,
deployments: [ObjectId] // Deployment references
}
{
projectId: ObjectId,
status: String, // QUEUED, IN_PROGRESS, SUCCESS, FAILED
createdAt: Date,
completedAt: Date,
logs: [String]
}
{
username: String,
email: String,
githubId: String,
githubUsername: String,
githubAccessToken: String, // Encrypted
isGithubConnected: Boolean,
profilePhoto: String
}
- Node.js 18+
- MongoDB
- AWS Account with ECS, S3 access
- GitHub OAuth App
- Kafka instance (optional, for real-time features)
Create .env
files in each service directory:
PORT=8000
MONGODB_URI=mongodb://localhost:27017/snapdeploy
JWT_SECRET=your-jwt-secret
ACCESS_TOKEN_SECRET=your-access-token-secret
REFRESH_TOKEN_SECRET=your-refresh-token-secret
# GitHub OAuth
GITHUB_CLIENT_ID=your-github-client-id
GITHUB_CLIENT_SECRET=your-github-client-secret
# AWS Configuration
AWS_REGION=ap-south-1
AWS_ACCESS_KEY_ID=your-aws-access-key
AWS_SECRET_ACCESS_KEY=your-aws-secret-key
ECS_CLUSTER_NAME=your-ecs-cluster
ECS_TASK_DEFINITION=your-task-definition
# Encryption
ENCRYPTION_KEY=your-32-character-encryption-key
VITE_API_BASE_URL=http://localhost:8000
VITE_REVERSE_PROXY_URL=your-domain.com
AWS_ACCESS_KEY_ID=your-aws-access-key
AWS_SECRET_ACCESS_KEY=your-aws-secret-key
AWS_BUCKET_NAME=your-s3-bucket
KAFKA_BROKER=your-kafka-broker
KAFKA_USERNAME=your-kafka-username
KAFKA_PASSWORD=your-kafka-password
-
Clone the repository
git clone https://github.com/Pavan0228/SnapDeploy.git cd SnapDeploy
-
Install API Server dependencies
cd api-server npm install
-
Install Frontend dependencies
cd ../frontend npm install
-
Install Build Server dependencies
cd ../build_server npm install
-
Install S3 Reverse Proxy dependencies
cd ../s3-reverse-proxy npm install
-
Set up MongoDB
- Install and start MongoDB
- Create a database named
snapdeploy
-
Configure AWS
- Set up ECS cluster
- Create S3 bucket for hosting
- Configure VPC and security groups
-
Build Docker image for Build Server
cd build_server docker build -t snapdeploy-builder .
-
Start API Server
cd api-server npm run dev
-
Start Frontend
cd frontend npm run dev
-
Start S3 Reverse Proxy
cd s3-reverse-proxy npm start
The application will be available at:
- Frontend:
http://localhost:5173
- API Server:
http://localhost:8000
- Reverse Proxy:
http://localhost:8000
(configured port)
POST /auth/register
- User registrationPOST /auth/login
- User loginPOST /auth/logout
- User logoutGET /auth/me
- Get current user
POST /github/connect
- Connect GitHub accountGET /github/repositories
- Get user's repositoriesGET /github/repositories/:owner/:repo/branches
- Get repository branchesPOST /github/disconnect
- Disconnect GitHub account
POST /projects
- Create new projectGET /projects
- Get user's projectsGET /projects/:id
- Get project detailsPUT /projects/:id
- Update projectDELETE /projects/:id
- Delete project
POST /deployments
- Create new deploymentGET /deployments/:id/status
- Get deployment statusGET /logs/:deploymentId
- Get deployment logs (SSE)
- JWT Authentication: Secure token-based authentication
- Encrypted Tokens: GitHub access tokens are encrypted before storage
- CORS Configuration: Proper CORS setup for cross-origin requests
- Input Validation: Zod schema validation for all API inputs
- Private Repository Support: Secure handling of private GitHub repositories
- Personal Projects: Deploy your side projects and portfolios
- Prototyping: Quickly deploy prototypes for testing and demos
- Static Sites: Deploy React, Vue, Angular, or vanilla HTML/CSS/JS sites
- Documentation: Deploy documentation sites built with tools like Docusaurus
- Landing Pages: Create and deploy marketing landing pages
- Custom domain support
- Build caching for faster deployments
- Team collaboration features
- Deployment rollback functionality
- Integration with more Git providers (GitLab, Bitbucket)
- Advanced analytics and monitoring
- CI/CD webhook integration
- 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
This project is licensed under the ISC License. See the LICENSE
file for details.
- Pavan - @Pavan0228
- Thanks to the open-source community for the amazing tools and libraries
- Inspired by platforms like Vercel, Netlify, and Railway
- Built with โค๏ธ for developers who want to deploy fast
โญ Star this repository if you find it helpful!