惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

宝玉的分享
宝玉的分享
小众软件
小众软件
J
Java Code Geeks
I
InfoQ
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
腾讯CDC
L
LangChain Blog
博客园 - 司徒正美
量子位
Y
Y Combinator Blog
C
Check Point Blog
T
Tailwind CSS Blog
D
DataBreaches.Net
Blog — PlanetScale
Blog — PlanetScale
N
Netflix TechBlog - Medium
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
F
Fortinet All Blogs
云风的 BLOG
云风的 BLOG
A
About on SuperTechFans
B
Blog RSS Feed
酷 壳 – CoolShell
酷 壳 – CoolShell
大猫的无限游戏
大猫的无限游戏
V
V2EX
阮一峰的网络日志
阮一峰的网络日志

Hacker News: Show HN

PurrrrrFocus: Pomodoro Timer App - App Store Workflow Engine — Multi-Step Orchestration for Bun RapidPhoto: Pro Photo Editor App - App Store GitHub - DheerG/swarms: Achieve extraordinary results with claude code across a variety of tasks SPICE simulation → oscilloscope → verification with Claude Code — Lucas Gerads Show HN: VCoding – A 5 MB native Windows IDE with no dynamic dependencies Show HN: LLMs don't hallucinate because they're bad at math, it's the format GitHub - Agent-FM/agentfm-core: AgentFM is a peer-to-peer network that turns everyday computers into a decentralized AI supercomputer. AgentFM lets you run massive AI workloads directly across a global mesh of idle CPUs and GPUs. Show HN: Tracking Top US Science Olympiad Alumni over Last 25 Years GitHub - Potarix/agent-hub: One place to talk to all your agents Show HN: Runtime security for AI agents(injection,tool abuse, data exfiltration) GitHub - dubeyKartikay/lazyspotify: Terminal Spotify client for macOS and Linux GitHub - the-banana-tool/king-louie: Easy to use GUI Personal AI Assistant. Win/Linux/Mac. Show HN I made my vacation rental bookable by AI agents–no Airbnb, 0% commission GitHub - basteez/jsf-autoreload: maven plugin to enable hot reload on jsf projects uvm32/hosts/host-gdbstub at main · ringtailsoftware/uvm32 GitHub - labsai/EDDI: Config-driven engine that turns JSON into production-grade AI agents. Multi-agent orchestration, 12+ LLM providers, MCP/A2A protocols, RAG, persistent memory, and enterprise compliance (EU AI Act, GDPR, HIPAA). Built on Quarkus. GitHub - glitchnsec/fortyone-oss: AI Executive Assistant Platform Quickstart | Alien GitHub - muxshed/shed: One stream in, or many. Every destination, simultaneously. No cloud middleman, no per-channel fees, no limits. GitHub - ocrbase-hq/ocrbase: 📄 PDF/IMG ->.MD/JSON Document OCR API for PaddleOCR and GLMOCR. Self-hostable. GitHub - impactjo/home-memory: MCP server that lets your AI assistant remember everything about your home. GitHub - Sets88/dbcls: DbCls is a powerful terminal database client that supports various databases GitHub - neptun2000/heor-agent-mcp GitHub - SeanFDZ/macmind: Single-layer transformer in HyperTalk for the classic Macintosh RollQuation: Math Puzzles - Apps on Google Play GitHub - dropbox/witchcraft Show HN: Agent-cache – Multi-tier LLM/tool/session caching for Valkey and Redis GitHub - opentalon/opentalon: OpenTalon is an open-source platform built from the ground up in Go as a robust alternative to OpenClaw LinkedIn™ 职位抓取工具 - Chrome 应用商店
GitHub - anthonybudd/Express-ts-API-Template: Production-...
johnsmith207 · 2026-04-25 · via Hacker News: Show HN

A mimimal REST API template using Express.ts, Sequelize and MySQL.

  • 🔑 Auth using JWT's with Passport.js. Optional 2FA.
  • ✅ Full Test Coverage with Mocha.js
  • 🔐 Local SSL Termination with NGINX. Optional.
  • 👥 Simple DB Structure: Users -⚟ GroupsUsers ⚞- Groups
  • 🖥️ ShadCN x Vue3 UI: AnthonyBudd/Shadcn-Vue-SaaS-Template
  • 🥇 Real-world tested, handled over $50M of live transactions

YouTube Video
Getting Started: youtu.be/nA5UFuqjQgk

git clone git@github.com:anthonybudd/express-ts-api-template.git
cd express-ts-api-template

# [Optional] Find & Replace (case-sensaive, whole repo): "express-api" => "your-api-name" 
LC_ALL=C find . -type f -name '*.*' -exec sed -i '' s/express-api/your-api-name/g {} +

# Local SSL Cert for HTTPS and RSA key for JWT signing
openssl req -x509 -nodes -days 825 -newkey rsa:2048 -keyout key.pem -out cert.pem -subj "/CN=localhost/O=dev/C=US"
openssl genrsa -out private.pem 2048
openssl rsa -in private.pem -outform PEM -pubout -out public.pem

# Start app
cp .env.example .env
npm install
docker compose up
npm run exec:db:refresh
npm run exec:test

# [Optional] Code generation command
npm run generate -- --model="Book"
npm run exec:db:refresh

DB Structure

The DB structure is the optimum balance of functionality and minimalism. A User can belong to many Groups through the GroupsUsers table. This allows you to make very basic single-user applications that do not even require the concept of groups or full SaaS solutions with complex User-Group relationships.

+--------------+           +---------------+         +--------------+  
| Users        | --------⚟ | GroupsUsers   | ⚞------ | Groups       |  
|--------------|           |---------------|         |--------------|  
| id           |           | id            |         | id           |  
| email        |           | groupID       |         | name         |  
| password     |           | userID        |         | ownerID      |  
| firstName    |           | role          |         | createdAt    |  
| lastName     |           | createdAt     |         | updatedAt    |
| createdAt    |           | updatedAt     |         +--------------+  
| updatedAt    |           +---------------+                                            
| ...          |                                                      
+--------------+                      

OpenAPISpec

Above each route you will see a large comment block with the decorator @swagger, these comments are optional and can be removed if you do not want them. To generate a new OpenAPISpec run the command npm run exec:openapispec

I have found when building large commercial API's that it is far more practical to document the routes next to the code rather than manually updating the OpenAPISpec each time a route is created or modified.

/**
 * @swagger
 * /auth/login:
 *   post:
 *     description: Get an access token
 *     requestBody:
 *       required: true
 *       content:
 *         application/json:
 *         ... 
 */
app.post('/auth/login', [

Generate SDK Client Libraries

There is an OpenAPISpec in the root of the repo. The project includes code generation config files for PHP, JavaScript and Swift. Use the below command to generate SDK Client Libraries for your API to /sdk/dist. A full list of supported langauages can be found here.

npm run build-sdk

Deployment

Full Kubernetes deployment instructions can be found in k8s/Deployment.md.

kubectl apply -f .k8s/api.deployment.yml \
  -f .k8s/api.ingress.yml \
  -f .k8s/api.service.yml 

Routes

Method Route Description Payload Response
GET /_readiness Kuber readiness check -- "healthy"
Auth
POST /api/v1/auth/login Login {email, password} {accessToken}
POST /api/v1/auth/sign-up Sign-up {email, password, firstName, tos} {accessToken}
GET /api/v1/_authcheck Returns {auth: true} if has auth -- {auth: true}
GET /api/v1/auth/verify-email/:emailVerificationKey Verify email -- {success: true}
GET /api/v1/auth/resend-verification-email Resend verification email -- {email}
POST /api/v1/auth/forgot Forgot {email} {success: true}
GET /api/v1/auth/get-user-by-reset-key/:passwordResetKey Get user for given passwordResetKey -- {id, email}
POST /api/v1/auth/reset Reset password {email, password, passwordResetKey} {accessToken}
GET /api/v1/auth/get-user-by-invite-key/:inviteKey Get user for given inviteKey -- {id, email}
POST /api/v1/auth/invite Complete user invite process {inviteKey, email, password, ...} {accessToken}
User
GET /api/v1/user Get the current user {User}
POST /api/v1/user Update the current user {firstName, lastName} {User}
POST /api/v1/user/update-password Update password {password, newPassword} {success: true}
Groups
GET /api/v1/groups/:groupID Returns group by ID -- {Group}
POST /api/v1/groups/:groupID Update group by ID {name: 'New Name'} {Group}
POST /api/v1/groups/:groupID/users/invite Invite user to group {email} {UserID, GroupID}
POST /api/v1/groups/:groupID/users/:userID/resend-invitation-email Resend invitation email {} {email}
POST /api/v1/groups/:groupID/users/:userID/set-role Set user role {role: 'User'/'Admin' } {UserID, role}
DELETE /api/v1/groups/:groupID/users/:userID Remove user from group -- {UserID}

Commands

There are a few helper scripts and commands for interacting with the application.

Some commands need to be run inside the docker container, these commands have been aliased with an underscore prefix, for exmaple npm run exec:db:refresh is an alias for docker exec -ti express-api npm run db:refresh which actually runs ./src/scripts/refresh

Command Description Exmaple
generate.ts Code generation npm run generate -- --model="book"
renderEmail.ts Generate an email locally docker exec -ti express-api ts-node ./src/scripts/renderEmail.ts --template="Verify" --code="512616" --link="https://google.com"
jwt.ts Generate JWT for a user docker exec -ti express-api ts-node ./src/scripts/jwt.ts --userID="c4644733-deea-47d8-b35a-86f30ff9618e"
forgotPassword.ts Generate password reset link docker exec -ti express-api ts-node ./src/scripts/forgotPassword.ts --userID="c4644733-deea-47d8-b35a-86f30ff9618e"
setPassword.ts Set user password docker exec -ti express-api ts-node ./src/scripts/setPassword.ts --userID="c4644733-deea-47d8-b35a-86f30ff9618e" --password="password"