Skip to content

Commit 3f68a9e

Browse files
committed
πŸ“š Added Cloud IDE Startup Guides and Scripts
πŸš€ New Files: - CLOUD-STARTUP-GUIDE.md: Comprehensive cloud deployment guide - CLOUD-QUICK-START.md: Quick reference for cloud IDEs - start-cloud.sh: One-command startup script for cloud environments ✨ Features: - Platform-specific instructions (Codespaces, Gitpod, Theia, Replit) - Automated service health checking - Step-by-step troubleshooting guides - Port forwarding configuration help - Quick startup commands for daily use πŸ“‹ Perfect for: - GitHub Codespaces: Auto-port forwarding - Gitpod: Public port configuration - IBM Cloud/Theia: Custom port setup - Replit: Auto-detection and forwarding Makes cloud deployment as simple as: ./start-cloud.sh
1 parent 5868be8 commit 3f68a9e

File tree

3 files changed

+344
-0
lines changed

3 files changed

+344
-0
lines changed

β€ŽCLOUD-QUICK-START.mdβ€Ž

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# 🌐 Cloud IDE Quick Start
2+
3+
## πŸš€ One-Command Startup
4+
5+
```bash
6+
# Clone and start (first time)
7+
git clone https://github.com/emiflair/xrwvm-fullstack_developer_capstone.git
8+
cd xrwvm-fullstack_developer_capstone
9+
./start-cloud.sh
10+
```
11+
12+
## πŸ”„ Daily Startup (after first setup)
13+
14+
```bash
15+
cd xrwvm-fullstack_developer_capstone
16+
./start-cloud.sh
17+
```
18+
19+
## 🌍 Platform-Specific Access
20+
21+
### GitHub Codespaces
22+
- Ports are auto-forwarded
23+
- Access via: `https://[codespace-name]-8000.githubpreview.dev`
24+
25+
### Gitpod
26+
- Make ports 8000 & 3030 **PUBLIC** in Ports tab
27+
- Access via: `https://8000-[workspace-id].ws-[region].gitpod.io`
28+
29+
### IBM Cloud / Theia
30+
- Configure port forwarding in IDE settings
31+
- Use provided external URLs
32+
33+
### Replit
34+
- Ports auto-detected and forwarded
35+
- Access via Replit's webview URLs
36+
37+
## πŸ”§ Troubleshooting
38+
39+
```bash
40+
# View logs
41+
docker-compose logs -f
42+
43+
# Restart services
44+
docker-compose restart
45+
46+
# Full reset
47+
docker-compose down -v && ./start-cloud.sh
48+
```
49+
50+
**πŸ“– For detailed instructions, see: [CLOUD-STARTUP-GUIDE.md](./CLOUD-STARTUP-GUIDE.md)**

β€ŽCLOUD-STARTUP-GUIDE.mdβ€Ž

Lines changed: 232 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,232 @@
1+
# 🌐 Cloud IDE Startup Guide for Dealership Application
2+
3+
## πŸš€ Quick Start Commands
4+
5+
### **1. Clone and Setup (First Time)**
6+
```bash
7+
# Clone the repository
8+
git clone https://github.com/emiflair/xrwvm-fullstack_developer_capstone.git
9+
cd xrwvm-fullstack_developer_capstone
10+
11+
# Make scripts executable
12+
chmod +x *.sh
13+
14+
# Start the application
15+
./cloud-deploy.sh
16+
```
17+
18+
### **2. Daily Startup (After First Setup)**
19+
```bash
20+
# Navigate to project directory
21+
cd xrwvm-fullstack_developer_capstone
22+
23+
# Start all services
24+
docker-compose up -d
25+
26+
# Check status
27+
docker-compose ps
28+
29+
# View logs (optional)
30+
docker-compose logs -f
31+
```
32+
33+
## πŸ”§ Platform-Specific Instructions
34+
35+
### **GitHub Codespaces**
36+
1. **Open Repository**: Click "Code" β†’ "Create codespace on main"
37+
2. **Wait for Setup**: Codespaces will automatically install Docker
38+
3. **Run Commands**:
39+
```bash
40+
./cloud-deploy.sh
41+
```
42+
4. **Access Application**: Codespaces will automatically forward ports
43+
- Django App: `https://[codespace-name]-8000.githubpreview.dev`
44+
- API: `https://[codespace-name]-3030.githubpreview.dev`
45+
46+
### **Gitpod**
47+
1. **Open in Gitpod**: `https://gitpod.io/#https://github.com/emiflair/xrwvm-fullstack_developer_capstone`
48+
2. **Run Commands**:
49+
```bash
50+
./cloud-deploy.sh
51+
```
52+
3. **Make Ports Public**:
53+
- Go to "Ports" tab in Gitpod
54+
- Make ports 8000 and 3030 "Public"
55+
4. **Access URLs**: Gitpod will provide the public URLs
56+
57+
### **IBM Cloud (Theia IDE)**
58+
1. **Upload Project** or clone via terminal
59+
2. **Run Commands**:
60+
```bash
61+
./cloud-deploy.sh
62+
```
63+
3. **Configure Port Forwarding** in Theia settings
64+
4. **Access**: Use the provided external URLs
65+
66+
### **Replit**
67+
1. **Import Repository**: "Create" β†’ "Import from GitHub"
68+
2. **Run Commands**:
69+
```bash
70+
./cloud-deploy.sh
71+
```
72+
3. **Configure Ports**: Replit auto-detects and forwards ports
73+
4. **Access**: Use Replit's provided URLs
74+
75+
## πŸ“‹ Step-by-Step Startup Process
76+
77+
### **Step 1: Initial Setup**
78+
```bash
79+
# Make sure you're in the project root
80+
ls -la
81+
82+
# You should see: cloud-deploy.sh, docker-compose.yml, README.md
83+
84+
# Make scripts executable
85+
chmod +x cloud-deploy.sh cloud-setup-guide.sh cloud-access.sh
86+
```
87+
88+
### **Step 2: Start Application**
89+
```bash
90+
# One-command deployment (recommended)
91+
./cloud-deploy.sh
92+
93+
# OR manual startup
94+
docker-compose up --build -d
95+
```
96+
97+
### **Step 3: Verify Services**
98+
```bash
99+
# Check all containers are running
100+
docker-compose ps
101+
102+
# Test local access
103+
curl http://localhost:8000/ # Django app
104+
curl http://localhost:3030/health # API health check
105+
```
106+
107+
### **Step 4: Configure Cloud Access**
108+
```bash
109+
# Get cloud-specific URLs and instructions
110+
./cloud-setup-guide.sh
111+
112+
# Quick cloud access helper
113+
./cloud-access.sh
114+
```
115+
116+
## πŸ” Troubleshooting Commands
117+
118+
### **Check Container Status**
119+
```bash
120+
docker-compose ps
121+
docker-compose logs dealership_django
122+
docker-compose logs dealership_api
123+
docker-compose logs dealership_mongodb
124+
```
125+
126+
### **Restart Services**
127+
```bash
128+
# Restart all services
129+
docker-compose restart
130+
131+
# Restart specific service
132+
docker-compose restart dealership_django
133+
```
134+
135+
### **Clean Restart**
136+
```bash
137+
# Stop and remove everything
138+
docker-compose down -v
139+
140+
# Rebuild and start fresh
141+
docker-compose up --build -d
142+
```
143+
144+
### **Health Checks**
145+
```bash
146+
# Django health
147+
curl -I http://localhost:8000/
148+
149+
# API health
150+
curl http://localhost:3030/health
151+
152+
# MongoDB connection test
153+
docker-compose exec dealership_mongodb mongosh --eval "db.adminCommand('ping')"
154+
```
155+
156+
## 🌐 Port Configuration
157+
158+
| Service | Internal Port | External Port | URL |
159+
|---------|---------------|---------------|-----|
160+
| Django | 8000 | 8000 | `http://localhost:8000` |
161+
| API | 3030 | 3030 | `http://localhost:3030` |
162+
| MongoDB | 27017 | 27017 | `mongodb://localhost:27017` |
163+
164+
## 🚨 Common Issues & Solutions
165+
166+
### **Issue: "Port already in use"**
167+
```bash
168+
# Kill processes using the ports
169+
sudo lsof -ti:8000 | xargs kill -9
170+
sudo lsof -ti:3030 | xargs kill -9
171+
docker-compose down -v
172+
```
173+
174+
### **Issue: "Docker not found"**
175+
```bash
176+
# Most cloud IDEs have Docker pre-installed
177+
# If not, contact your cloud provider support
178+
docker --version
179+
```
180+
181+
### **Issue: "Permission denied"**
182+
```bash
183+
# Make scripts executable
184+
chmod +x *.sh
185+
186+
# Run with explicit bash
187+
bash cloud-deploy.sh
188+
```
189+
190+
### **Issue: "Can't access from browser"**
191+
1. **Check port forwarding** in your cloud IDE
192+
2. **Make ports public** (not just open)
193+
3. **Use HTTPS URLs** if provided by cloud IDE
194+
4. **Check firewall settings** in cloud environment
195+
196+
## 🎯 Production Deployment Commands
197+
198+
### **For Cloud Platforms (AWS, Google Cloud, Azure)**
199+
```bash
200+
# Use Docker Compose directly
201+
docker-compose up -d
202+
203+
# Or with custom environment
204+
DJANGO_ENV=production docker-compose up -d
205+
```
206+
207+
### **For Kubernetes**
208+
```bash
209+
# Convert to Kubernetes manifests (if needed)
210+
kompose convert
211+
212+
# Deploy to cluster
213+
kubectl apply -f .
214+
```
215+
216+
## πŸ“± Quick Access URLs
217+
218+
After startup, your application will be available at:
219+
- **Main Application**: Your cloud IDE will provide the Django URL (port 8000)
220+
- **API Endpoints**: Your cloud IDE will provide the API URL (port 3030)
221+
- **API Health Check**: `[API_URL]/health`
222+
223+
## πŸ†˜ Get Help
224+
225+
If you encounter issues:
226+
1. **Run diagnostics**: `./cloud-setup-guide.sh`
227+
2. **Check logs**: `docker-compose logs -f`
228+
3. **Restart services**: `docker-compose restart`
229+
4. **Full reset**: `docker-compose down -v && ./cloud-deploy.sh`
230+
231+
---
232+
**Happy Coding! πŸš€**

β€Žstart-cloud.shβ€Ž

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
#!/bin/bash
2+
3+
echo "πŸš€ Starting Dealership Application in Cloud IDE"
4+
echo "=============================================="
5+
6+
# Check if we're in the right directory
7+
if [ ! -f "docker-compose.yml" ]; then
8+
echo "❌ Error: docker-compose.yml not found!"
9+
echo "Please run this script from the project root directory."
10+
exit 1
11+
fi
12+
13+
# Make all scripts executable
14+
echo "πŸ”§ Setting up permissions..."
15+
chmod +x *.sh
16+
17+
# Start the application
18+
echo "🌐 Starting all services..."
19+
docker-compose up -d
20+
21+
# Wait for services to start
22+
echo "⏳ Waiting for services to initialize..."
23+
sleep 10
24+
25+
# Check service status
26+
echo "πŸ” Checking service status..."
27+
docker-compose ps
28+
29+
# Test local connectivity
30+
echo "πŸ§ͺ Testing service connectivity..."
31+
echo -n "Django App: "
32+
if curl -s -o /dev/null -w "%{http_code}" http://localhost:8000/ | grep -q "200\|302"; then
33+
echo "βœ… Running"
34+
else
35+
echo "❌ Not responding"
36+
fi
37+
38+
echo -n "API Service: "
39+
if curl -s http://localhost:3030/health | grep -q "ok"; then
40+
echo "βœ… Healthy"
41+
else
42+
echo "❌ Not healthy"
43+
fi
44+
45+
echo ""
46+
echo "πŸŽ‰ Application started successfully!"
47+
echo ""
48+
echo "πŸ“‹ Next Steps:"
49+
echo "1. Configure port forwarding in your cloud IDE:"
50+
echo " - Port 8000 (Django App)"
51+
echo " - Port 3030 (API Service)"
52+
echo ""
53+
echo "2. Make ports PUBLIC (not just open) in your IDE settings"
54+
echo ""
55+
echo "3. Access your application using the URLs provided by your cloud IDE"
56+
echo ""
57+
echo "πŸ”§ Useful commands:"
58+
echo " View logs: docker-compose logs -f"
59+
echo " Stop services: docker-compose down"
60+
echo " Restart: docker-compose restart"
61+
echo ""
62+
echo "❓ Need help? Run: ./cloud-setup-guide.sh"

0 commit comments

Comments
Β (0)