User Guide: Publish Web Application - EyevinnOSC/community GitHub Wiki
This guide provides comprehensive instructions for publishing web applications built using open web services in Eyevinn Open Source Cloud (OSC). The instructions are designed to be clear for both human users and AI agents.
There are three main approaches for publishing web applications and servers in OSC:
- Static Website Publishing - For frontend-only applications (React, Vue, Angular, static sites)
- Full-Stack Application Publishing - For applications with backend services and databases
- MCP Server Hosting - Deploy a custom Model Context Protocol (MCP) server with a public HTTPS endpoint
Before you begin, ensure you have:
- An account on Eyevinn Open Source Cloud (sign up at https://app.osaas.io)
- An API Access Token from Settings/API section in your OSC dashboard
- Your token stored as environment variable:
OSC_ACCESS_TOKEN - Node.js and npm installed (for CLI usage)
- Git installed (for repository management)
Important: OSC instance names must follow these rules:
- Only alphanumeric characters (a-z, A-Z, 0-9)
- No hyphens (-), underscores (_), or special characters
- Must start with a letter
- Maximum length: typically 20-30 characters
Valid Examples: myapp, backend01, database, cache
Invalid Examples: my-app, backend_01, my.app, 123app
Use this method for frontend-only applications such as React, Vue, Angular, or any static HTML/CSS/JS sites.
# Example with React application
npx create-react-app my-app
cd my-app
# Important: Set PUBLIC_URL for proper routing in OSC
# Replace 'myapp' with your actual application name
PUBLIC_URL=/myapp/ npm run buildFor other frameworks:
# Vue.js
npm run build
# Output typically in 'dist' directory
# Angular
ng build --base-href /myapp/
# Output in 'dist/my-app' directory
# Static HTML/CSS/JS
# Ensure all assets use relative paths or absolute paths starting with /myapp/npm install -g @osaas/cli@latest# Set your access token (get from OSC dashboard Settings/API)
export OSC_ACCESS_TOKEN=your_token_here
# Verify authentication
npx @osaas/cli@latest auth status# Deploy the build directory
npx @osaas/cli@latest web publish myapp build/
# For other frameworks, adjust the directory:
# Vue: npx @osaas/cli@latest web publish myapp dist/
# Angular: npx @osaas/cli@latest web publish myapp dist/my-app/After successful deployment, you'll receive:
- A unique URL where your application is hosted:
https://myapp--[unique-id].app.osaas.io - CDN URL for global distribution
Configure CDN settings in OSC dashboard for:
- Custom domain mapping
- Cache control settings
- SSL certificate management
- Geographic distribution
Use this method for applications with backend services, databases, or server-side logic.
First, create any backend services your application needs using OSC CLI or dashboard:
# Create a PostgreSQL database
npx @osaas/cli@latest create birme-osc-postgresql mydb \
-o username=myuser \
-o password=mypassword \
-o database=myappdb
# Create a Valkey (Redis-compatible) cache
npx @osaas/cli@latest create valkey-io-valkey mycache
# Create other services as needed:
# - MariaDB: npx @osaas/cli@latest create linuxserver-docker-mariadb mymariadb -o username=user -o password=pass -o database=mydb
# - ClickHouse: npx @osaas/cli@latest create clickhouse-clickhouse myanalytics -o user=user -o password=pass
# - MinIO: npx @osaas/cli@latest create minio-minio mystorage -o rootUser=admin -o rootPassword=passAvailable OSC Services:
- Databases: PostgreSQL, MariaDB, ClickHouse, CouchDB
- Caching: Valkey (Redis-compatible), DiceDB
- Storage: MinIO (S3-compatible)
- Message Queues: SmoothMQ, Really Simple Message Queue
- Media Processing: FFmpeg, Encore (transcoding)
- Analytics: Umami, Matomo, Plausible
# Ensure your application is in a GitHub repository
git init
git add .
git commit -m "Initial commit"
git remote add origin https://github.com/yourusername/your-app.git
git push -u origin main
# Create a Dockerfile (if your app doesn't have one)
cat > Dockerfile << EOF
FROM node:18-alpine
WORKDIR /app
COPY package*.json ./
RUN npm ci --only=production
COPY . .
EXPOSE 3000
CMD ["npm", "start"]
EOF# Create a Web Runner instance to deploy your app from GitHub
npx @osaas/cli@latest create eyevinn-web-runner myapp \
-o sourceUrl=https://github.com/yourusername/your-app.git \
-o githubToken=your_github_token
# Alternative: Use OSC dashboard to create Web Runner service
# Navigate to Services > Create Service > Web Runner# Create secrets for sensitive data
npx @osaas/cli@latest secrets create myapp DATABASE_PASSWORD mypassword
npx @osaas/cli@latest secrets create myapp API_KEY your_api_key
# Set environment variables through the dashboard or CLI
# Common environment variables for web applications:
# - DATABASE_URL=postgresql://user:pass@host:port/db
# - REDIS_URL=redis://host:port
# - NODE_ENV=production
# - PORT=3000# Get connection URLs for your services
npx @osaas/cli@latest describe birme-osc-postgresql mydb
npx @osaas/cli@latest describe valkey-io-valkey mycache
# Update your application's environment variables with service URLs
# Deploy or redeploy your Web Runner instance
npx @osaas/cli@latest restart eyevinn-web-runner myapp# Check service status
npx @osaas/cli@latest describe eyevinn-web-runner myapp
# View logs
npx @osaas/cli@latest logs eyevinn-web-runner myapp
# Get the application URL
npx @osaas/cli@latest describe eyevinn-web-runner myappUse this method to host a custom Model Context Protocol (MCP) server on OSC and expose it via a public HTTPS endpoint. This lets AI agents (Claude, Cursor, VS Code, etc.) connect to your server from anywhere.
- Your MCP server is in a git repository on any HTTPS git host (GitHub, GitLab, Gitea, or self-hosted)
- The server is written in Node.js, Python, or WebAssembly
- It exposes an HTTP transport endpoint (e.g.
/mcp)
Ensure your repository has a Dockerfile or follows a standard project layout that OSC's My Apps runtime can build.
- Go to app.osaas.io/dashboard/my-apps
- Click Add application
- Choose I have a git repository and enter your git repository URL (any HTTPS URL — GitHub, GitLab, Gitea, etc.), or choose I need a git repository to have OSC provision one for you
- Select the runtime (Node.js, Python, or WebAssembly)
- Give the app a name (alphanumeric only, e.g.
mymcpserver) - Click Deploy
Monorepo support: If your server lives in a subdirectory of a larger repository (e.g.
packages/my-mcp-server), specify the subdirectory path in the Sub Path field when creating the app. The build will run from that subdirectory instead of the repository root.
Note:
.osc.yamlconfiguration files are not currently supported. Apps are built from the repository root (or the specified sub path) using the Dockerfile or standard runtime conventions.
OSC builds and deploys your server automatically. Once running, it receives a public HTTPS URL:
https://<appname>.auto.prod.osaas.io
Use the public URL as the MCP endpoint. For example in Claude Code:
claude mcp add --transport http mymcp https://<appname>.auto.prod.osaas.io/mcpOr in ~/.cursor/mcp.json:
{
"mcpServers": {
"mymcp": {
"type": "http",
"url": "https://<appname>.auto.prod.osaas.io/mcp"
}
}
}For a full step-by-step tutorial, see Deploy an MCP Server on OSC on the OSC website.
For AI agents assisting with deployment, follow this systematic approach:
# Identify application type by checking for:
ls -la # Look for package.json, Dockerfile, etc.
cat package.json # Check dependencies and scripts
find . -name "*.html" -o -name "*.js" -o -name "*.css" # Static files
find . -name "server.js" -o -name "app.js" -o -name "index.js" # Backend filesDecision Matrix:
- Static Only: No server files, only HTML/CSS/JS or build output � Use Method 1
- Full-Stack: Has server files, database dependencies, API endpoints � Use Method 2
# Check OSC CLI installation
npx @osaas/cli@latest --version
# List available services (if backend needed)
npx @osaas/cli@latest listFor Static Applications:
# Build the application
npm run build # or appropriate build command
# Deploy to OSC
npx @osaas/cli@latest web publish ${APPNAME} ${BUILD_DIR}/For Full-Stack Applications:
# Create required services first
npx @osaas/cli@latest create ${SERVICE_TYPE} ${SERVICENAME}
# Deploy application
npx @osaas/cli@latest create eyevinn-web-runner ${APPNAME} \
-o sourceUrl=${GITHUB_URL}For Monorepo Applications (via MCP create-my-app tool):
When the application is in a subdirectory of the repository, pass the subPath parameter:
"Create a Node.js app called
myappfrom https://github.com/org/monorepo with sub pathpackages/backend"
The MCP tool will set subPath=packages/backend so the build runs from that directory.
# Check deployment status
npx @osaas/cli@latest describe eyevinn-web-runner ${APPNAME}
# Test application endpoint
curl -I ${APP_URL}
# Monitor logs for errors
npx @osaas/cli@latest logs eyevinn-web-runner ${APPNAME}-
Authentication Failed: Verify
OSC_ACCESS_TOKENis set correctly -
Build Errors: Check local build first with
npm run build - Service Creation Failed: Verify service name uniqueness
- Deployment Failed: Check repository accessibility and Dockerfile validity
-
Invalid Token: Ensure
OSC_ACCESS_TOKENis correctly set - Build Errors: Verify application builds successfully locally
-
Routing Issues: Check
PUBLIC_URLsetting for static sites - Service Dependencies: Ensure all required services are created and configured
- Join the community Slack: https://slack.osaas.io
- Check OSC documentation
- Contact support through OSC dashboard
- Version Control: Always use version control for your applications
- Environment Variables: Use environment variables for configuration
- Security: Never commit secrets to repositories
- Testing: Test applications locally before deployment
- Monitoring: Set up monitoring for production applications
Step-by-step deployment of a React app with Node.js backend:
# 1. Create and prepare the application
npx create-react-app myfullstackapp
cd myfullstackapp
# 2. Add backend dependencies to package.json
npm install express cors dotenv
# 3. Create basic Express server (server.js)
cat > server.js << 'EOF'
const express = require('express');
const cors = require('cors');
require('dotenv').config();
const app = express();
const PORT = process.env.PORT || 3001;
app.use(cors());
app.use(express.json());
app.get('/api/health', (req, res) => {
res.json({ status: 'OK', timestamp: new Date().toISOString() });
});
app.listen(PORT, () => {
console.log(`Server running on port ${PORT}`);
});
EOF
# 4. Update package.json scripts
npm pkg set scripts.server="node server.js"
npm pkg set scripts.dev="concurrently \"npm start\" \"npm run server\""
# 5. Create Dockerfile
cat > Dockerfile << 'EOF'
FROM node:18-alpine
WORKDIR /app
COPY package*.json ./
RUN npm ci --only=production
COPY . .
EXPOSE 3001
CMD ["npm", "run", "server"]
EOF
# 6. Initialize git and push to GitHub
git init
git add .
git commit -m "Initial commit"
git remote add origin https://github.com/yourusername/myfullstackapp.git
git push -u origin main
# 7. Deploy backend with Web Runner
export OSC_ACCESS_TOKEN=your_token_here
npx @osaas/cli@latest create eyevinn-web-runner myappbackend \
-o sourceUrl=https://github.com/yourusername/myfullstackapp.git
# 8. Build and deploy frontend
PUBLIC_URL=/myappfrontend/ npm run build
npx @osaas/cli@latest web publish myappfrontend build/Deploying a static site that fetches data from OSC services:
# 1. Create database service
npx @osaas/cli@latest create birme-osc-postgresql mydatadb \
-o username=datauser \
-o password=securepass123 \
-o database=appdata
# 2. Create API service to expose database
npx @osaas/cli@latest create eyevinn-web-runner myapi \
-o sourceUrl=https://github.com/yourusername/myapi.git
# 3. Deploy static frontend
npx @osaas/cli@latest web publish mystaticapp dist/
# 4. Configure API endpoint in frontend
# Update your frontend code to use: https://myapi--[id].app.osaas.io/apiComplete e-commerce setup with database, cache, and storage:
# 1. Create all required services
npx @osaas/cli@latest create birme-osc-postgresql ecommercedb \
-o username=ecomuser \
-o password=ecompass123 \
-o database=ecommerce
npx @osaas/cli@latest create valkey-io-valkey ecommercecache
npx @osaas/cli@latest create minio-minio ecommercestorage \
-o rootUser=admin \
-o rootPassword=adminpass123
# 2. Create secrets for sensitive data
npx @osaas/cli@latest secrets create ecommerceapp DB_PASSWORD ecompass123
npx @osaas/cli@latest secrets create ecommerceapp STRIPE_SECRET_KEY sk_test_xxx
npx @osaas/cli@latest secrets create ecommerceapp JWT_SECRET your_jwt_secret
# 3. Deploy the application
npx @osaas/cli@latest create eyevinn-web-runner ecommerceapp \
-o sourceUrl=https://github.com/yourusername/ecommerceapp.git
# 4. Get service URLs and update environment variables
npx @osaas/cli@latest describe birme-osc-postgresql ecommercedb
npx @osaas/cli@latest describe valkey-io-valkey ecommercecache
npx @osaas/cli@latest describe minio-minio ecommercestorageThis guide ensures both users and AI agents can successfully publish web applications in Eyevinn Open Source Cloud using open web services.