PluginBench
Skill
Fail
Audit score 45

nodejs-express-server

aj-geddes/useful-ai-prompts

Build production-ready Express.js servers with routing, middleware, authentication, and database integration.

What is nodejs-express-server?

Create robust REST APIs and server applications using Express.js with proper middleware chains, authentication mechanisms, and database connections. Use this skill when building Node.js backends, implementing request/response handling, managing cross-cutting concerns, or connecting to databases.

  • Set up Express.js applications with middleware and routing
  • Implement authentication and authorization with JWT
  • Create RESTful routes with CRUD operations
  • Integrate databases like PostgreSQL with Sequelize
  • Build middleware chains for cross-cutting concerns
  • Handle errors and implement logging

How to install nodejs-express-server

npx skills add https://github.com/aj-geddes/useful-ai-prompts --skill nodejs-express-server
Prerequisites
  • Node.js installed
  • npm or yarn package manager
Claude Code
Cursor
Windsurf
Cline

How to use nodejs-express-server

  1. 1.Install the skill using the provided npx command
  2. 2.Review the Quick Start example to understand basic Express setup
  3. 3.Choose relevant reference guides from the references/ directory based on your needs
  4. 4.Implement middleware chains for your cross-cutting concerns
  5. 5.Set up routes and CRUD operations for your API endpoints
  6. 6.Configure authentication (JWT) for protected routes
  7. 7.Integrate your database using the provided PostgreSQL/Sequelize guide
  8. 8.Implement error handling middleware

Use cases

Good for
  • Building REST APIs with Node.js
  • Implementing server-side request/response handling
  • Creating authentication systems for web applications
  • Connecting Node.js applications to PostgreSQL databases
  • Setting up middleware for logging, validation, and error handling
Who it's for
  • Backend developers
  • Full-stack developers
  • API developers
  • Node.js developers

nodejs-express-server FAQ

When should I use this skill?

Use this skill when building REST APIs, implementing server-side logic, creating middleware chains, managing authentication, or connecting to databases in Node.js applications.

What databases are supported?

The skill includes detailed guidance for PostgreSQL with Sequelize. You can adapt the patterns for other databases.

How do I handle authentication?

The skill provides a reference guide for JWT-based authentication, including token generation, validation, and protecting routes.

What error handling approach is recommended?

Implement dedicated error handling middleware that catches errors, logs them appropriately, and returns consistent error responses without exposing stack traces in production.

Should I use callbacks or async/await?

Use async/await for async operations instead of callbacks to avoid callback hell and improve code readability.

Full instructions (SKILL.md)

Source of truth, from aj-geddes/useful-ai-prompts.


name: nodejs-express-server description: > Build production-ready Express.js servers with middleware, authentication, routing, and database integration. Use when creating REST APIs, managing requests/responses, implementing middleware chains, and handling server logic.

Node.js Express Server

Table of Contents

Overview

Create robust Express.js applications with proper routing, middleware chains, authentication mechanisms, and database integration following industry best practices.

When to Use

  • Building REST APIs with Node.js
  • Implementing server-side request handling
  • Creating middleware chains for cross-cutting concerns
  • Managing authentication and authorization
  • Connecting to databases from Node.js
  • Implementing error handling and logging

Quick Start

Minimal working example:

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

// Middleware
app.use(express.json());
app.use(express.urlencoded({ extended: true }));

// Routes
app.get("/health", (req, res) => {
  res.json({ status: "OK", timestamp: new Date().toISOString() });
});

// Error handling
app.use((err, req, res, next) => {
  console.error(err.stack);
  res.status(err.status || 500).json({
    error: err.message,
    requestId: req.id,
  });
});

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

Reference Guides

Detailed implementations in the references/ directory:

GuideContents
Basic Express SetupBasic Express Setup
Middleware Chain ImplementationMiddleware Chain Implementation
Database Integration (PostgreSQL with Sequelize)Database Integration (PostgreSQL with Sequelize)
Authentication with JWTAuthentication with JWT
RESTful Routes with CRUD OperationsRESTful Routes with CRUD Operations
Error Handling MiddlewareError Handling Middleware
Environment ConfigurationEnvironment Configuration

Best Practices

✅ DO

  • Use middleware for cross-cutting concerns
  • Implement proper error handling
  • Validate input data before processing
  • Use async/await for async operations
  • Implement authentication on protected routes
  • Use environment variables for configuration
  • Add logging and monitoring
  • Use HTTPS in production
  • Implement rate limiting
  • Keep route handlers focused and small

❌ DON'T

  • Handle errors silently
  • Store sensitive data in code
  • Use synchronous operations in routes
  • Forget to validate user input
  • Implement authentication in route handlers
  • Use callback hell (use promises/async-await)
  • Expose stack traces in production
  • Trust client-side validation only