无服务器后端托管,无空闲成本 – 开源
Serverless backend hosting without idle costs – open-source

原始链接: https://github.com/aryankashyap0/shorlabs

## Shorlabs:轻松后端部署 Shorlabs 是一个旨在简化 Python 和 Node.js 应用后端部署和管理的平台。它基于 AWS Lambda 构建,提供按需付费模式,具有自动扩展和慷慨的免费套餐,从而消除了开发者对基础设施的担忧。 主要功能包括:一键从 GitHub 部署、自动运行时检测、自定义子域名和安全的环境变量管理。开发者可以配置计算资源(内存、超时、存储)并使用详细日志跟踪部署。 Shorlabs 使用强大的技术栈,包括 Next.js、FastAPI、DynamoDB 以及 AWS 服务,如 Lambda、ECR 和 CloudWatch。部署涉及设置后端 API、通配符子域名路由和使用指标聚合。 目前处于 Alpha 阶段,Shorlabs 旨在弥合前端部署(如 Vercel)的易用性和后端基础设施之间的差距,证明现代后端可以可靠且经济地在函数即服务平台上运行。欢迎通过 GitHub 贡献。

这个Hacker News讨论围绕一个新开源项目,该项目提供无服务器后端托管,旨在消除空闲成本(github.com/aryankashyap0)。虽然核心理念很有吸引力,但评论员们表达了怀疑。 提出的担忧包括,尽管声称“无空闲成本”,但来自AWS的潜在意外成本(例如DDoS攻击),以及质疑它相对于现有的AWS工具(如SAM和Amplify)的优势。 几位用户指出该项目将用户锁定在AWS生态系统中。 主要的批评集中在LLM生成的README文件上,被认为缺乏个性,并引发了对整体代码质量和项目维护的疑虑。 最后,一位评论员指责项目提交者使用多个新帐户进行垃圾信息发布。 目标受众尚不清楚,猜测范围从独立开发者到初创公司。
相关文章

原文

Shorlabs is a platform for deploying, managing, and scaling backend applications built with Python or Node.js—so developers never have to worry about provisioning or maintaining infrastructure.

It is built primarily on AWS Lambda, which means you only pay for what you use while benefiting from automatic scalability by default, along with a generous free tier.

Shorlabs Dashboard


Feature Description
One-Click Deployment Connect your GitHub repository and deploy with a single click. No Docker knowledge required.
Automatic Runtime Detection Shorlabs automatically detects Python or Node.js projects and configures the build accordingly.
Custom Subdomains Every project gets a unique project-name.shorlabs.com subdomain, instantly accessible.
Environment Variables Securely configure environment variables through the dashboard. Supports .env file imports.
Configurable Compute Choose memory (1 GB, 2 GB, 4 GB), timeout (up to 300s), and ephemeral storage (512 MB, 1 GB, 2 GB).
Deployment History Track every deployment with status, build logs, and timestamps.
Runtime Logs View real-time CloudWatch logs directly from the dashboard.
GitHub OAuth Seamless authentication with GitHub for repository access.
Pay-Per-Use Pricing Built on AWS Lambda, so you only pay for actual compute time.

Note: The IAM policy grants access to ECR, Lambda, IAM, S3, CloudWatch, CodeBuild, DynamoDB, SQS, CloudFront, and EventBridge. Create an IAM user with this policy and configure your AWS CLI credentials before deploying.

git clone https://github.com/yourusername/shorlabs.git
cd shorlabs
# Install frontend dependencies (from root)
bun install

# Install backend dependencies
cd apps/backend
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
pip install -r requirements.txt

3. Configure Environment Variables

Frontend (apps/frontend/.env.local):

# Clerk Authentication
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=your_clerk_publishable_key
CLERK_SECRET_KEY=your_clerk_secret_key
NEXT_PUBLIC_CLERK_AFTER_SIGN_IN_URL=/projects
NEXT_PUBLIC_CLERK_AFTER_SIGN_UP_URL=/projects

# Backend API URL
NEXT_PUBLIC_API_URL=http://localhost:8000

Backend (apps/backend/.env):

# AWS Credentials
AWS_ACCESS_KEY_ID=your_aws_access_key
AWS_SECRET_ACCESS_KEY=your_aws_secret_key
AWS_DEFAULT_REGION=us-east-1

# Clerk Authentication
CLERK_SECRET_KEY=your_clerk_secret_key
CLERK_ISSUER=https://your-clerk-instance.clerk.accounts.dev

# Frontend URL (for CORS)
FRONTEND_URL=http://localhost:3000

Start the Backend:

cd apps/backend
source venv/bin/activate
uvicorn api.main:app --reload --port 8000

Start the Frontend (in a new terminal):

# From the root directory
bun run dev

The app will be available at http://localhost:3000.

5. Deploy the Platform to AWS

Shorlabs requires three infrastructure components to be deployed. Run these scripts from apps/backend/:

cd apps/backend
./deploy-lambda.sh

This script deploys the Shorlabs backend API and sets up:

  • ECR Repository — Container registry for the backend Docker image
  • Lambda Function — The main API with Lambda Web Adapter
  • SQS Queues — FIFO queue for background deployment tasks + Dead Letter Queue
  • Function URL — Public HTTPS endpoint for the API
  • IAM Roles — Permissions for Lambda, DynamoDB, ECR, CodeBuild, SQS

After deployment, note the Function URL — you'll update NEXT_PUBLIC_API_URL with this.

5.2 Set Up Wildcard Subdomain Routing

./setup_wildcard_routing.sh

This script enables custom subdomains (*.shorlabs.com) for user projects:

  • Lambda@Edge Function — Routes subdomains to the correct user Lambda
  • CloudFront Distribution — CDN with SSL for all subdomains
  • DNS Configuration — Route 53 or manual CNAME setup for *.yourdomain.com

Note: Requires an ACM certificate for *.yourdomain.com in us-east-1.

5.3 Schedule Usage Metrics Aggregation

./schedule_usage_aggregator.sh

This script configures automated usage tracking:

  • EventBridge Rule — Hourly cron trigger
  • Usage Aggregator — Fetches CloudWatch metrics and stores in DynamoDB

Deploy the Next.js frontend to Vercel or your preferred host:

cd apps/frontend
bun run build

Set these environment variables in your hosting platform:

  • NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY
  • CLERK_SECRET_KEY
  • NEXT_PUBLIC_API_URL (your Lambda Function URL from step 5.1)

Import GitHub Repository

Step 1 — Connect your GitHub account and import an existing repository to get started.

Configure General Settings

Step 2 — Configure your project settings, including name, root directory, and start command.

Configure Compute Resources

Step 3 — Choose compute resources such as memory, timeout, and storage based on your workload.

Set Environment Variables

Step 4 — Add environment variables securely, then deploy with a single click.


Shorlabs is born out of frustration. I've built many applications, and the backend was almost always painful to deploy and manage—while the frontend, on platforms like Vercel, felt effortless. I wanted that same simplicity for backend services: connect a GitHub repository and have everything else handled automatically.

Many developers still believe complex backends require long-running servers or containers, and that Function-as-a-Service platforms like AWS Lambda are only for simple, stateless tasks. That belief is outdated. Modern backends can run reliably on FaaS with far better economics. The real barrier isn't technical—it's tooling. Shorlabs exists to remove that barrier.


Layer Technology
Frontend Next.js 16, React 19, TypeScript
UI Components Radix UI, Tailwind CSS 4, Lucide Icons
Authentication Clerk (GitHub OAuth)
Backend API Python, FastAPI, Mangum (Lambda adapter)
Database DynamoDB (Single-table design)
Deployment Runtime AWS Lambda (Function URLs + Lambda@Edge)
Container Registry Amazon ECR
Build System AWS CodeBuild (Docker-based)
Routing Lambda@Edge (Wildcard subdomain routing)
Monitoring CloudWatch Logs & Metrics
Queue System Amazon SQS (Background deployment tasks)
Scheduling EventBridge (Usage aggregation)
Infrastructure AWS SDK (boto3), IAM Roles & Policies

For questions, issues, or support, please contact me via email at [email protected].


Shorlabs is currently in alpha. Contributions are welcome, but please open an issue first to discuss any major changes before submitting a pull request.


This project is licensed under the Apache 2.0 License. See the LICENSE.md file for more information.

联系我们 contact @ memedata.com