Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
219 changes: 219 additions & 0 deletions REPOSITORY_EXPLANATION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,219 @@
# πŸ“‹ SnapDeploy Repository Explanation - Complete Summary

## πŸ€” What is this repository?

This repository contains **SnapDeploy** - a complete web application deployment platform that automatically deploys static websites from GitHub repositories to the cloud. Think of it as your personal Vercel or Netlify!

## 🎯 What does SnapDeploy do?

**In simple terms:** SnapDeploy takes any GitHub repository containing a website and automatically:
1. Clones it
2. Builds it (npm install + npm run build)
3. Hosts it on a live URL
4. Gives you real-time progress updates

**Result:** Your website goes from GitHub code to a live URL like `your-project.snapdeploy.me` in under 2 minutes!

## πŸ—οΈ What's in this repository?

The repository contains **4 main applications** that work together:

### 1. `frontend/` - The Web Interface (React App)
- **What it is:** The website you use to manage your deployments
- **Technology:** React + Vite + Tailwind CSS
- **What you can do:** Login, connect GitHub, create projects, watch deployments

### 2. `api-server/` - The Backend (Express.js API)
- **What it is:** The brain that handles all the business logic
- **Technology:** Node.js + Express + MongoDB
- **What it does:** User auth, GitHub integration, project management, deployment coordination

### 3. `build_server/` - The Builder (Docker Container)
- **What it is:** The automated build system that processes your code
- **Technology:** Docker + Node.js + AWS ECS
- **What it does:** Clones repos, installs dependencies, builds projects, uploads to cloud

### 4. `s3-reverse-proxy/` - The Router (Proxy Server)
- **What it is:** The system that makes your websites accessible via custom URLs
- **Technology:** Node.js + Express + HTTP Proxy
- **What it does:** Routes `your-project.domain.com` to the right website files

## πŸ”„ How does it all work together?

```
You (Developer)
↓ (creates project)
Frontend (React UI)
↓ (sends request)
API Server (Express)
↓ (triggers build)
Build Server (Docker)
↓ (uploads files)
AWS S3 (File Storage)
↓ (serves files)
S3 Proxy (Router)
↓ (delivers website)
Your Users (Website Visitors)
```

## πŸ› οΈ What technologies are used?

### Backend Technologies:
- **Node.js** - JavaScript runtime
- **Express.js** - Web framework
- **MongoDB** - Database for storing projects and users
- **Docker** - Containerization for builds
- **AWS ECS** - Container orchestration
- **AWS S3** - File hosting
- **Kafka** - Real-time messaging for logs

### Frontend Technologies:
- **React 18** - User interface library
- **Vite** - Build tool and development server
- **Tailwind CSS** - Styling framework
- **Axios** - HTTP requests to backend

### DevOps & Cloud:
- **AWS ECS Fargate** - Serverless containers
- **AWS S3** - Static website hosting
- **GitHub OAuth** - User authentication
- **JWT** - Secure token authentication

## πŸ“ What types of projects can you deploy?

SnapDeploy works with any static website project:

βœ… **React applications** (Create React App, Vite, Next.js static)
βœ… **Vue.js applications**
βœ… **Angular projects**
βœ… **HTML/CSS/JavaScript** websites
βœ… **Documentation sites** (Docusaurus, GitBook)
βœ… **Landing pages** and portfolios
βœ… **Gatsby or Nuxt.js** static sites

❌ **What it DOESN'T support:**
- Server-side applications (Express servers, PHP, etc.)
- Databases or backend APIs
- Applications that need persistent storage

## πŸš€ How do you use it?

### For End Users:
1. Sign up on the SnapDeploy website
2. Connect your GitHub account
3. Select a repository with a website
4. Click "Deploy"
5. Get a live URL in 1-2 minutes!

### For Developers (working on this codebase):
1. Clone this repository
2. Install dependencies for each service
3. Set up environment variables
4. Run the services locally for development

## πŸ“ Repository Structure Explained

```
SnapDeploy/
β”œβ”€β”€ frontend/ # React web app (what users see)
β”‚ β”œβ”€β”€ src/
β”‚ β”‚ β”œβ”€β”€ components/ # Reusable UI components
β”‚ β”‚ β”œβ”€β”€ pages/ # Different app pages
β”‚ β”‚ └── App.jsx # Main app component
β”‚ └── package.json # Frontend dependencies
β”‚
β”œβ”€β”€ api-server/ # Express.js backend
β”‚ β”œβ”€β”€ controllers/ # Request handling logic
β”‚ β”œβ”€β”€ models/ # Database schemas
β”‚ β”œβ”€β”€ routes/ # API endpoint definitions
β”‚ β”œβ”€β”€ services/ # Business logic (GitHub, AWS)
β”‚ └── app.js # Express app setup
β”‚
β”œβ”€β”€ build_server/ # Docker build container
β”‚ β”œβ”€β”€ script.js # Main build logic
β”‚ β”œβ”€β”€ main.sh # Git cloning script
β”‚ └── Dockerfile # Container definition
β”‚
β”œβ”€β”€ s3-reverse-proxy/ # Subdomain routing service
β”‚ β”œβ”€β”€ index.js # Proxy server logic
β”‚ └── model/ # Project lookup schemas
β”‚
β”œβ”€β”€ README.md # Main documentation
β”œβ”€β”€ ARCHITECTURE.md # System design details
β”œβ”€β”€ QUICKSTART.md # Getting started guide
└── docs-homepage.png # Homepage screenshot
```

## 🎯 Who is this for?

### Target Users:
- **Developers** who want to deploy static websites quickly
- **Students** learning web development
- **Freelancers** showing projects to clients
- **Small businesses** needing simple website hosting
- **Anyone** who wants to turn GitHub code into live websites

### Skill Level Needed:
- **To Use SnapDeploy:** Basic web development knowledge
- **To Contribute:** Intermediate JavaScript/Node.js skills
- **To Deploy:** Experience with React, MongoDB, AWS helpful

## πŸ’‘ Why was this built?

SnapDeploy solves these problems:
- **Manual deployment is tedious** - No more manual git clone, npm install, npm build
- **Infrastructure is complex** - No need to set up AWS, domains, SSL certificates
- **No real-time feedback** - See exactly what's happening during builds
- **Limited free options** - Provides a self-hosted alternative to paid services

## πŸ”§ Current Status

βœ… **What Works:**
- User authentication and GitHub OAuth
- Repository browsing and selection
- Automated builds with Docker
- Real-time deployment logs
- Custom subdomain routing
- Private repository support

🚧 **Known Issues:**
- 54 ESLint warnings in frontend (non-blocking)
- No automated tests currently
- Some dependency vulnerabilities (typical for Node.js projects)

πŸ“‹ **Future Plans:**
- Custom domain support
- Build caching for faster deployments
- Team collaboration features
- More Git providers (GitLab, Bitbucket)
- Advanced analytics

## πŸŽ“ Learning from this codebase

This repository is an excellent example of:
- **Microservices architecture** - 4 separate services working together
- **Real-world React application** - Complex UI with state management
- **Node.js backend development** - Express, MongoDB, authentication
- **Docker containerization** - Build isolation and deployment
- **AWS cloud integration** - ECS, S3, practical cloud usage
- **GitHub API integration** - OAuth, repository access
- **Real-time features** - Server-Sent Events for live logs

## πŸŽ‰ Getting Started

1. **To understand the code:** Read this document, then explore the README.md
2. **To run locally:** Follow the QUICKSTART.md guide
3. **To contribute:** Check out CONTRIBUTING.md
4. **To deploy:** Use the production deployment guide in README.md

## πŸ“ž Getting Help

If you want to understand specific parts:
- **Architecture details:** See `TECHNICAL_ARCHITECTURE.md`
- **Visual workflow:** See `VISUAL_WORKFLOW.md`
- **Setup instructions:** See `QUICKSTART.md`
- **Code documentation:** Browse the source files (well-commented)

---

**🎯 Summary:** SnapDeploy is a complete, production-ready web application that automates static website deployment from GitHub to live URLs. It's built with modern technologies and demonstrates professional-grade full-stack development practices.
Loading