Create Your First Project

This guide walks you through creating your first Teenode project from scratch. We’ll create a simple web application running in a confidential container.

Prerequisites

  • Teenode CLI installed (Installation Guide)
  • Authenticated account (teenode auth login)
  • Git installed (for Git Deploy projects)

Step 1: Choose Your Project Type

Teenode supports three project types:

  • Git Deploy - Best for web apps and APIs (recommended for beginners)
  • TEE VM - Full virtual machines for complex workloads
  • Container - Direct Docker deployments

For this guide, we’ll create a Git Deploy project.

Step 2: Prepare Your Application

Create a simple Node.js application:

# Create project directory
mkdir my-first-app
cd my-first-app

# Initialize Node.js project
npm init -y

# Install Express
npm install express

Create index.js:

const express = require('express');
const app = express();
const PORT = process.env.PORT || 3000;

app.get('/', (req, res) => {
  res.json({
    message: 'Hello from Teenode!',
    secure: true,
    timestamp: new Date().toISOString()
  });
});

app.listen(PORT, () => {
  console.log(`Server running on port ${PORT}`);
});

Update package.json with start script:

{
  "name": "my-first-app",
  "version": "1.0.0",
  "scripts": {
    "start": "node index.js"
  },
  "dependencies": {
    "express": "^4.18.0"
  }
}

Step 3: Push to Git

# Initialize Git repository
git init
git add .
git commit -m "Initial commit"

# Push to GitHub (or GitLab, Bitbucket)
git remote add origin https://github.com/yourusername/my-first-app.git
git push -u origin main

Step 4: Create Teenode Project

teenode project create \
  --name my-first-app \
  --type GIT_DEPLOY \
  --git-url https://github.com/yourusername/my-first-app \
  --branch main \
  --region us-east
Your project will be created with AMD SEV-SNP encryption enabled by default!

Step 5: Monitor Deployment

Check deployment status:

# View project details
teenode project info my-first-app

# Watch deployment logs
teenode deployment logs <deployment-id> --follow

Step 6: Access Your Application

Once deployed, your app is accessible at:

https://my-first-app.teenode.app

Test it:

curl https://my-first-app.teenode.app

# Response:
# {
#   "message": "Hello from Teenode!",
#   "secure": true,
#   "timestamp": "2024-01-15T14:30:00.000Z"
# }

Step 7: Verify Security

Verify your application is running in a confidential environment:

# Get project details including attestation
teenode project info my-first-app --show-attestation

Step 8: Make Updates

Update your code and push to trigger a new deployment:

// Update index.js
app.get('/status', (req, res) => {
  res.json({
    status: 'healthy',
    uptime: process.uptime()
  });
});
git add .
git commit -m "Add status endpoint"
git push

# Deployment will trigger automatically!

Common Configuration

Environment Variables

teenode env set my-first-app \
  DATABASE_URL="postgres://..." \
  API_KEY="secret123"

Custom Domain

teenode domain add my-first-app \
  --domain www.myapp.com

Auto-Deploy Settings

# Enable auto-deploy for main branch
teenode project update my-first-app \
  --auto-deploy-branch main

# Disable auto-deploy
teenode project update my-first-app \
  --no-auto-deploy

Monitoring and Logs

# View application logs
teenode project logs my-first-app --follow

# View metrics
teenode project metrics my-first-app

# List all deployments
teenode deployment list my-first-app

Cleanup

When you’re done testing, delete the project:

teenode project delete my-first-app
Deleting a project is permanent and cannot be undone.

Next Steps

Troubleshooting

Deployment Failed

Check build logs:

teenode deployment logs <deployment-id> --type build

Application Not Responding

Check if the application is listening on the correct port (PORT environment variable):

const PORT = process.env.PORT || 3000;
app.listen(PORT, '0.0.0.0', () => {
  console.log(`Server running on port ${PORT}`);
});

Git Authentication Issues

For private repositories, add a deploy key:

# Generate SSH key
ssh-keygen -t ed25519 -f teenode_deploy_key

# Add public key to GitHub
# Add private key to Teenode
teenode project update my-first-app \
  --deploy-key teenode_deploy_key
    Create Your First Project - Teenode Guides