Deployment Requirements
Clue2App automatically detects and builds your applications. This guide covers the requirements for successful deployments.
Supported Languages
Clue2App automatically detects and builds applications written in:
| Language | Frameworks |
|---|---|
| Python | FastAPI, Flask, Django, etc. |
| Node.js | Express, Next.js, React, Vue, etc. |
| Java | Spring Boot, Quarkus, etc. |
| Go | Standard library, Gin, Echo, etc. |
| .NET Core | ASP.NET, Blazor, etc. |
Project Structure
Detection Files
Clue2App needs specific files at the repository root to detect your application:
| Language | Required File |
|---|---|
| Python | requirements.txt, pyproject.toml, or setup.py |
| Node.js | package.json |
| Java | pom.xml or build.gradle |
| Go | go.mod |
| .NET | *.csproj or *.fsproj |
Monorepo / Subdirectory Projects
If your code is in a subdirectory (e.g., backend/), create wrapper files at the root:
Python Example
my-repo/
├── requirements.txt # Points to backend
├── Procfile # Runs from backend
├── backend/
│ ├── requirements.txt # Actual dependencies
│ └── app/
│ └── main.py
└── frontend/
└── ...
Root requirements.txt:
-r backend/requirements.txt
Root Procfile:
web: cd backend && uvicorn app.main:app --host 0.0.0.0 --port 8000
Node.js Example
my-repo/
├── package.json # Wrapper
├── Procfile # Runs from backend
├── backend/
│ ├── package.json
│ └── src/
└── frontend/
└── ...
Root package.json:
{
"name": "app-wrapper",
"scripts": {
"start": "cd backend && npm start"
}
}
Procfile
A Procfile specifies how to run your application. It's optional for simple projects but recommended for:
- Monorepo projects
- Custom startup commands
- Specific runtime configurations
Format:
web: <command to start your app>
Examples:
# Python FastAPI
web: uvicorn app.main:app --host 0.0.0.0 --port 8000
# Python Flask
web: gunicorn app:app --bind 0.0.0.0:8000
# Node.js
web: node server.js
# Java
web: java -jar target/app.jar
Port Configuration
Your application must listen on the PORT environment variable (defaults to 8080):
Python:
import os
port = int(os.environ.get("PORT", 8080))
Node.js:
const port = process.env.PORT || 8080;
Java:
int port = Integer.parseInt(System.getenv().getOrDefault("PORT", "8080"));
Environment Variables
Set environment variables via:
- Console: App Settings → Environment Variables
- CLI:
c2a env set <app> KEY=value
Common variables:
| Variable | Purpose |
|---|---|
DATABASE_URL | Database connection string |
SECRET_KEY | Application secret |
NODE_ENV | Node.js environment |
LOG_LEVEL | Logging verbosity |
Troubleshooting
Build fails with "detection error"
Cause: Required files not found at repository root.
Solution:
- Ensure detection files (
requirements.txt,package.json, etc.) are at the repo root - For subdirectory projects, create wrapper files as shown above
Build succeeds but app crashes
Cause: Missing configuration or incorrect startup command.
Solution:
- Check app logs:
c2a logs show <app-name> - Verify
Procfilecommand is correct - Ensure all required environment variables are set
App not accessible
Cause: App not listening on correct port.
Solution:
- Ensure your app reads the
PORTenvironment variable - Default to port
8080ifPORTis not set - Bind to
0.0.0.0, notlocalhost
Best Practices
- Keep dependencies minimal - Faster builds, smaller images
- Use a Procfile - Explicit is better than implicit
- Set PORT dynamically - Don't hardcode ports
- Use environment variables - Never commit secrets
- Test locally first - Ensure your app runs before deploying