Skip to content

Commit 2f1a75c

Browse files
authored
Merge pull request #3 from brutal-45/patch-1
Patch 1
2 parents 8172798 + 9bf721c commit 2f1a75c

7 files changed

Lines changed: 748 additions & 39 deletions

File tree

‎.github/workflows/python-package.yml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,4 @@ jobs:
5757
python 02-data-types/lists.py
5858
python 04-functions/basics.py
5959
echo "All scripts executed successfully!"
60+

‎.gitignore‎

Lines changed: 1 addition & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,2 @@
11
```
2-
# Dependencies
3-
__pycache__/
4-
*.pyc
5-
*.pyo
6-
*.pyd
7-
.Python
8-
env/
9-
venv/
10-
.venv/
11-
.venv-local/
12-
.ENV/
13-
.ENV.local/
14-
.env
15-
.env.local
16-
.env.*
17-
.envrc
18-
pip-log.txt
19-
pip-delete-this-directory.txt
20-
.tox/
21-
.coverage
22-
.coverage.*
23-
.cache
24-
nosetests.xml
25-
coverage.xml
26-
*.cover
27-
*.log
28-
.git
29-
.mypy_cache/
30-
.pytest_cache/
31-
.hypothesis/
32-
.ropeproject/
33-
.vscode/
34-
.idea/
35-
*.swp
36-
*.swo
37-
*~
38-
.DS_Store
39-
Thumbs.db
40-
```
2+

‎DEPLOYMENT.md‎

Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
1+
# Deployment Guide
2+
3+
This repository is configured for seamless deployment on multiple platforms.
4+
5+
## 🚀 Vercel Deployment (Recommended)
6+
7+
### Quick Deploy
8+
9+
1. **Install Vercel CLI** (optional, for local testing):
10+
```bash
11+
npm install -g vercel
12+
```
13+
14+
2. **Deploy to Vercel**:
15+
```bash
16+
# Login to Vercel
17+
vercel login
18+
19+
# Deploy
20+
vercel
21+
```
22+
23+
3. **Or use the Vercel Dashboard**:
24+
- Go to [vercel.com](https://vercel.com)
25+
- Import your GitHub repository
26+
- Vercel will automatically detect the `vercel.json` configuration
27+
- Click "Deploy"
28+
29+
### What Gets Deployed
30+
31+
- **Frontend**: `index.html` - Interactive dashboard
32+
- **API Endpoints**:
33+
- `GET /api/health` - Health check
34+
- `GET /api/status` - Repository status
35+
- `GET /api/lessons` - List all lessons
36+
- `GET /api/run?script=<name>` - Run Python scripts
37+
38+
### Local Testing
39+
40+
```bash
41+
# Install Vercel CLI
42+
npm install -g vercel
43+
44+
# Run locally
45+
vercel dev
46+
```
47+
48+
Visit `http://localhost:3000` to test.
49+
50+
---
51+
52+
## 🐙 GitHub Actions Workflow
53+
54+
The repository includes a CI/CD workflow that:
55+
56+
1. **Tests** on Python 3.9, 3.10, 3.11, 3.12
57+
2. **Runs linting** with flake8
58+
3. **Checks formatting** with black
59+
4. **Executes tests** with pytest
60+
5. **Verifies Vercel deployment** readiness
61+
62+
### Workflow Triggers
63+
64+
- Push to `main` or `master` branch
65+
- Pull requests
66+
- Manual trigger via GitHub Actions UI
67+
68+
---
69+
70+
## 🔧 Alternative Deployment Options
71+
72+
### Docker
73+
74+
Create a `Dockerfile`:
75+
76+
```dockerfile
77+
FROM python:3.11-slim
78+
79+
WORKDIR /app
80+
COPY . .
81+
82+
RUN pip install --no-cache-dir -r requirements.txt
83+
84+
EXPOSE 8000
85+
CMD ["python", "-m", "http.server", "8000"]
86+
```
87+
88+
### Netlify
89+
90+
1. Connect your GitHub repository
91+
2. Set build command: `echo "No build needed"`
92+
3. Set publish directory: `/`
93+
4. Add serverless functions in `api/` directory
94+
95+
### Render
96+
97+
1. Create new Web Service
98+
2. Connect GitHub repository
99+
3. Build Command: `pip install -r requirements.txt`
100+
4. Start Command: `python -m http.server $PORT`
101+
102+
---
103+
104+
## 📁 Project Structure
105+
106+
```
107+
├── api/ # Vercel serverless functions
108+
│ └── __init__.py # API endpoints
109+
├── .github/workflows/ # GitHub Actions CI/CD
110+
│ └── python-package.yml
111+
├── 01-basics/ # Lesson modules
112+
├── 02-data-types/
113+
├── ...
114+
├── projects/ # Example projects
115+
├── index.html # Frontend dashboard
116+
├── vercel.json # Vercel configuration
117+
├── requirements.txt # Python dependencies
118+
└── README.md # Documentation
119+
```
120+
121+
---
122+
123+
## ✅ Pre-Deployment Checklist
124+
125+
- [ ] All Python scripts run without errors
126+
- [ ] Tests pass (`pytest`)
127+
- [ ] Code is formatted (`black .`)
128+
- [ ] `vercel.json` is properly configured
129+
- [ ] API endpoints are tested locally
130+
- [ ] Environment variables are set (if needed)
131+
132+
---
133+
134+
## 🎯 Post-Deployment
135+
136+
After deploying to Vercel:
137+
138+
1. Visit your deployed URL
139+
2. Test all API endpoints via the dashboard
140+
3. Share your deployment link!
141+
142+
### Environment Variables (Optional)
143+
144+
Set these in Vercel dashboard if needed:
145+
146+
- `SECRET_KEY` - For API security
147+
- `DATABASE_URI` - For database connections
148+
- `JWT_SECRET_KEY` - For JWT authentication
149+
150+
---
151+
152+
## 📞 Support
153+
154+
For issues or questions:
155+
- Check the [README.md](./README.md)
156+
- Review [CONTRIBUTING.md](./CONTRIBUTING.md)
157+
- Open an issue on GitHub

0 commit comments

Comments
 (0)