aj-mini-api / DEPLOYMENT_QUICKSTART.md
tomo14151
Deploy AJ Mini API to Hugging Face Spaces - Created by AJ STUDIOZ
9d79680

🎯 QUICK START: Deploy AJ API for FREE with UNLIMITED Requests

⚑ Fastest Way (3 Minutes)

Option 1: Render.com (EASIEST - Click & Deploy)

  1. Go to https://render.com
  2. Sign up with GitHub (free)
  3. Click "New +" β†’ "Blueprint"
  4. Connect your GitHub repository: tomoacademycare-beep/AJ
  5. Click "Apply"
  6. Wait 5-10 minutes
  7. Get your URL: https://aj-api-xxxx.onrender.com

βœ… Done! Your API is live with unlimited requests!


πŸš€ Option 2: Railway.app (BEST PERFORMANCE)

  1. Go to https://railway.app
  2. Sign up with GitHub
  3. Click "New Project" β†’ "Deploy from GitHub repo"
  4. Select your AJ repository
  5. Wait 5-10 minutes
  6. Get your URL from Railway dashboard

βœ… No sleep mode! Better than Render!


πŸ“‹ Files Already Created

Your repository now has:

  • βœ… render.yaml - Render.com config
  • βœ… railway.json - Railway.app config
  • βœ… fly.toml - Fly.io config
  • βœ… Dockerfile - Docker configuration
  • βœ… DEPLOY_EVERYWHERE.ps1 - Auto-deployment script

🎬 Step-by-Step with Screenshots

RENDER.COM (Recommended)

Step 1: Sign Up

Sign up with GitHub

Step 2: Create Blueprint

  • Click "New +" button (top right)
  • Select "Blueprint"
  • Click "Connect GitHub"

Step 3: Select Repository

  • Choose tomoacademycare-beep/AJ
  • Render auto-detects render.yaml

Step 4: Deploy

  • Click "Apply"
  • Wait for build (5-10 minutes)
  • βœ… Your API is live!

Step 5: Get Your URL

  • Go to Dashboard
  • Click on your service
  • Copy the URL: https://aj-api-xxxx.onrender.com

πŸ§ͺ Test Your Deployed API

Health Check

curl https://YOUR-URL/health

API Info

curl https://YOUR-URL/api/info

Chat (Main Endpoint)

curl -X POST "https://YOUR-URL/api/chat" \
  -H "Content-Type: application/json" \
  -d '{"message":"Hello AJ, who are you?"}'

For ReqBin.com

URL: https://YOUR-URL/api/chat
Method: POST
Headers:
  Content-Type: application/json
Body:
{
  "message": "Hello AJ"
}

πŸ”₯ Keep It Awake (No Sleep Mode)

Render free tier sleeps after 15 minutes of inactivity.

Solution: UptimeRobot (Free)

  1. Go to https://uptimerobot.com
  2. Sign up (free account)
  3. Add Monitor:
    • Type: HTTP(s)
    • URL: https://YOUR-URL/health
    • Interval: 5 minutes
  4. Save

βœ… Your API will never sleep!


πŸ’° Cost Breakdown

Platform Monthly Cost Requests Sleep Mode Build Time
Render $0 Unlimited Yes* 5-10 min
Railway $0 ($5 credit) Unlimited No 5-10 min
Fly.io $0 High No 5-10 min
Hugging Face $0 Unlimited Yes* 10-15 min

*Can be prevented with UptimeRobot


🎯 My Recommendation

Deploy to Both:

  1. Primary: Railway.app (No sleep, best performance)
  2. Backup: Render.com (Always free)

Result:

  • βœ… 99.9% uptime
  • βœ… Unlimited requests
  • βœ… Zero cost
  • βœ… Auto-scaling

πŸ†˜ Troubleshooting

Build Failed?

Check:

  • Dockerfile is present
  • All files committed to GitHub
  • Repository is public

API Not Responding?

Check:

  • Service is running (green status)
  • Health endpoint: /health
  • Check logs in dashboard

Too Slow?

Solutions:

  • Use Railway (no cold starts)
  • Set up UptimeRobot keep-alive
  • Deploy to multiple platforms

πŸ“ž Support

Questions?


πŸŽ‰ What You Get

After deployment:

  • βœ… Public HTTPS URL
  • βœ… Unlimited API requests
  • βœ… Auto-scaling
  • βœ… SSL certificate included
  • βœ… Global CDN
  • βœ… Automatic updates from GitHub
  • βœ… Usage analytics
  • βœ… 24/7 availability

ALL FOR FREE! πŸš€


πŸ”— Quick Links


Created by AJ STUDIOZ Making AI accessible to everyone!