The Open Source Netlify Alternative
Deploy your static sites instantly with a simple API and CLI
Originally built for Flavortown Hack Club 🍔
Swiftly is a lightweight, open-source platform for deploying and hosting static HTML sites. Built with Flask, it provides a simple REST API and CLI tool to manage your deployments.
This project was originally created for the Flavortown Hack Club community to provide an easy way to deploy and share static sites.
Perfect for:
- 🎨 Personal portfolios
- 📝 Static blogs
- 🌐 Landing pages
- 🧪 Prototype demos
- 🏫 Student projects
- 🚀 Simple API - Upload and deploy HTML files via REST API
- 💻 CLI Tool - Command-line interface for easy deployment
- 📦 File Upload - Direct HTML file upload support
- 📦 File & Directory Upload - Direct HTML file upload and full directory upload (preserves structure)
- 📊 Dashboard UI - Web interface for managing sites (login, deploy, delete)
- 📊 Analytics system - Encrypted per-site visit collection with integrated dashboard
- 🗂️ Site Management - List, add, and delete sites easily
- 🔒 Secure - File name sanitization and validation
- 📊 JSON Database - Simple file-based storage
- 🆓 100% Open Source - MIT License
- Python 3.8+
./swiftly.shDouble-click swiftly.bat or run in Command Prompt:
swiftly.batThat's it! The scripts will automatically:
- ✅ Check Python installation
- 📦 Install
requestsif needed - 🚀 Launch the CLI
- Clone the repository
git clone https://github.com/ruikdev/Swiftly.git
cd Swiftly- Create a virtual environment
python3 -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate- Install dependencies
pip install -r requirements.txt- Run the server
python app.pyThe server will start on http://localhost:5000 🎉
Swiftly now includes a web dashboard to manage your sites without the CLI.
- URL:
http://localhost:5000/dashboard - Features:
- Login / Register from the browser
- List your sites (preview, file count)
- Deploy via a form (upload full folder or individual files)
- Delete sites
The dashboard uses Tailwind and matches the landing page style. To use it, start the server (python app.py) and open the URL above. The deploy form supports drag & drop of folders and validates the presence of an index.html.
http://localhost:5000
Check if the API is running.
Response:
{
"status": "ok"
}List all deployed sites.
Response:
{
"sites": {
"my-site": "my-site.html",
"blog": "blog.html"
}
}Upload and deploy a new site.
Content-Type: multipart/form-data
Parameters:
name(string, required): The site name/identifierfile(file, required): HTML file to upload
Example with curl:
curl -X POST http://localhost:5000/api/sites \
-F "name=my-awesome-site" \
-F "file=@index.html"Success Response (201):
{
"message": "Site 'my-awesome-site' ajouté avec succès",
"site": {
"my-awesome-site": "my-awesome-site.html"
},
"url": "/sites/my-awesome-site"
}Error Responses:
400- Missing required fields or invalid file404- No file in request409- Site name already exists
Delete a deployed site.
Example:
curl -X DELETE http://localhost:5000/api/sites/my-siteSuccess Response (200):
{
"message": "Site 'my-site' supprimé avec succès"
}Access a deployed site.
Example:
http://localhost:5000/sites/my-awesome-site
Swiftly now supports wildcard subdomains! This means you can deploy your sites to subdomains like example.swiftly.ruikdev.me effortlessly. Simply configure your DNS settings and let Swiftly handle the rest.
- Automatic SSL certificates for wildcard subdomains.
- Seamless routing for static files and resources.
- Easy setup with Cloudflare DNS.
Refer to the documentation for detailed instructions.
Swiftly comes with a powerful interactive CLI tool for managing your deployments. The CLI can be used independently from the server!
If you only want to use the CLI (without running the server):
- Download the CLI file:
curl -O https://raw.githubusercontent.com/ruikdev/Swiftly/main/swiftly_cli.pyOr copy swiftly_cli.py from the repository.
- Install the only required dependency:
pip install requests- Run the CLI:
python3 swiftly_cli.pyIf you want to run both the server and CLI:
git clone https://github.com/ruikdev/Swiftly.git
cd Swiftly
pip install -r requirements.txtStart the interactive CLI:
python3 swiftly_cli.pyOn the first run, you'll be asked to select your language:
- 🇫🇷 Français (French)
- 🇬🇧 English
The CLI offers an interactive menu with the following options:
Account Management:
- Create a new account (email + password)
- Login
- View your profile
- Change your email
- Change your password
- Logout
Site Management:
- List all your deployed sites
- Deploy a new site (upload HTML file)
- Delete a site
Other:
- Check API health
- Change language anytime (option 9)
1. Start CLI: python3 swiftly_cli.py
2. Select language (French or English)
3. Create account or login
4. Deploy your HTML files
5. List your sites
6. Share your site URLs!
Your credentials are securely stored locally in ~/.swiftly_config.json with restricted permissions (600). You won't need to login again on the same machine.
All API requests made by the CLI automatically include your credentials in these headers:
X-User-Email: Your emailX-User-Password: Your password
Swiftly comes with a powerful CLI tool for testing and managing your deployments.
Swiftly/
├── ANALYTICS.md
├── app.py
├── LICENSE
├── README.fr.md
├── README.md
├── requirements.txt
├── swiftly_cli.py
├── swiftly.bat
├── swiftly.sh
├── db/
│ └── sites.json
├── sites/
├── static/
│ └── images/
├── swiftly/
│ ├── __init__.py
│ ├── analytics.py
│ ├── config.py
│ ├── database.py
│ ├── models/
│ │ ├── __init__.py
│ │ ├── site.py
│ │ └── user.py
│ ├── routes/
│ │ ├── __init__.py
│ │ ├── auth.py
│ │ ├── dashboard.py
│ │ ├── main.py
│ │ ├── sites.py
│ │ └── user.py
│ └── utils/
│ ├── __init__.py
│ └── decorators.py
└── templates/
├── base.html
├── dashboard_layout.html
├── dashboard_home.html
├── dashboard_site.html
├── dashboard_deploy.html
├── dashboard_profile.html
├── auth_login.html
└── auth_register.html
The application uses the following defaults:
- Host:
0.0.0.0 - Port:
5000 - Database:
db/sites.json - Sites folder:
sites/
You can modify these in app.py.
Swiftly includes an email-based account verification system and password reset via a code. To enable email sending, create a .env file at the project root and configure the following SMTP variables (a .env.example file has been added):
SMTP_HOST=smtp.gmail.com
SMTP_PORT=587
SMTP_USER=your_email@gmail.com
SMTP_PASSWORD=your_app_password
SMTP_FROM=your_email@gmail.com
SECRET_KEY=some_random_secret_keyNotes:
- For Gmail, use an App Password and TLS (port 587).
- If SMTP configuration is missing or invalid, emails will not be sent and the verification/reset features will not work.
- Codes expire after 15 minutes.
For details about the flow: registration -> send code -> verify -> create account, see the auth routes (/auth/register, /auth/verify, /auth/forgot-password, /auth/reset-password).
Swiftly includes a lightweight analytics system that collects and encrypts visit data per site. Below are the main routes and functions you’ll find in the codebase (see swiftly/analytics.py and templates/dashboard_site.html).
-
Routes:
GET /dashboard/site/<site_name>— site dashboard with analytics.- Serving a site's
index.html(via/sites/<site_name>/) triggerstrack_visit()to record visits.
-
Module
swiftly.analytics(main functions):init_analytics_db(site_name: str) -> bool— create the.analytics.jsonfor a site.track_visit(site_name: str) -> bool— record a visit (called when a site page is served).get_analytics(site_name: str, decrypt: bool = True) -> dict— retrieve raw analytics data.get_analytics_stats(site_name: str) -> dict— compute KPIs and aggregated stats for the dashboard.encrypt_data(data: dict) -> str/decrypt_data(encrypted_hex: str) -> dict— utilities for Fernet encryption.
-
Storage: analytics are stored per-site in
sites/<site>/.analytics.json. -
Security: sensitive fields are encrypted with Fernet. Configure
ANALYTICS_ENCRYPTION_KEYinswiftly/config.pyor via an environment variable in production.
- ✅ Filename sanitization with
secure_filename() - ✅ HTML file validation
- ✅ Duplicate name prevention
- ✅ Path traversal protection
- Custom domain support
- SSL/TLS certificates automation
- Multi-file site deployment (entire directories)
- Git integration for automatic deployments
- Environment variables support
- Site analytics
- CDN integration
- Webhook support for CI/CD
Contributions are welcome! Feel free to:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Built with Flask
- Inspired by Netlify
- Styled with Tailwind CSS
- Created for Flavortown Hack Club community
Made with ❤️ by ruikdev
⭐ Star this repo if you find it useful!