$120 tested Claude codes · real before/after data · Full tier $15 one-timebuy --sheet=15 →
$Free 40-page Claude guide — setup, 120 prompt codes, MCP servers, AI agents. download --free →
clskills.sh — terminal v2.4 — 2,347 skills indexed● online
[CL]Skills_
Scaffoldingbeginner

Express Starter

Share

Scaffold Express.js project with structure

Works with OpenClaude

You are a Node.js scaffolding expert. The user wants to create a new Express.js project with a proper directory structure, essential middleware, and a basic routing setup ready for development.

What to check first

  • Run node --version to ensure Node.js 14+ is installed
  • Verify npm is available with npm --version
  • Choose or create an empty directory for your project

Steps

  1. Create a new directory and initialize npm with npm init -y
  2. Install Express and essential middleware: npm install express dotenv cors body-parser
  3. Create directories: mkdir src src/routes src/middleware src/controllers
  4. Create .env file in root with PORT=3000 and NODE_ENV=development
  5. Create src/middleware/errorHandler.js for centralized error handling
  6. Create src/routes/index.js with basic route structure
  7. Create src/app.js to configure Express app with middleware
  8. Create server.js as entry point that imports and starts the app
  9. Update package.json scripts with "start": "node server.js" and "dev": "node --watch server.js"

Code

// server.js
require('dotenv').config();
const app = require('./src/app');

const PORT = process.env.PORT || 3000;

app.listen(PORT, () => {
  console.log(`Server running on http://localhost:${PORT}`);
});

// src/app.js
const express = require('express');
const cors = require('cors');
const bodyParser = require('body-parser');
const errorHandler = require('./middleware/errorHandler');
const routes = require('./routes');

const app = express();

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

// Request logging middleware
app.use((req, res, next) => {
  console.log(`${req.method} ${req.path}`);
  next();
});

// Routes
app.use('/api', routes);

// Health check endpoint
app.get('/health', (req, res) => {
  res.json({ status: 'OK', timestamp: new Date().toISOString() });
});

// 404 handler
app.use((req, res) => {
  res.status(404).json({ error: 'Route not found' });
});

// Error handler (must be last)
app.use(errorHandler);

module.exports = app;

// src/middleware/errorHandler.js
module.exports = (err, req, res, next) => {
  const status = err.status || 500;
  const message = err.message || 'Internal Server Error';
  
  console.error(`[Error] ${status}: ${message}`);
  
  res.status(status).json({
    error: {
      status,

Note: this example was truncated in the source. See the GitHub repo for the latest full version.

Common Pitfalls

  • Treating this skill as a one-shot solution — most workflows need iteration and verification
  • Skipping the verification steps — you don't know it worked until you measure
  • Applying this skill without understanding the underlying problem — read the related docs first

When NOT to Use This Skill

  • When a simpler manual approach would take less than 10 minutes
  • On critical production systems without testing in staging first
  • When you don't have permission or authorization to make these changes

How to Verify It Worked

  • Run the verification steps documented above
  • Compare the output against your expected baseline
  • Check logs for any warnings or errors — silent failures are the worst kind

Production Considerations

  • Test in staging before deploying to production
  • Have a rollback plan — every change should be reversible
  • Monitor the affected systems for at least 24 hours after the change

Quick Info

CategoryScaffolding
Difficultybeginner
Version1.0.0
AuthorClaude Skills Hub
scaffoldingexpressstarter

Install command:

curl -o ~/.claude/skills/express-starter.md https://claude-skills-hub.vercel.app/skills/scaffolding/express-starter.md

Related Scaffolding Skills

Other Claude Code skills in the same category — free to download.

Want a Scaffolding skill personalized to YOUR project?

This is a generic skill that works for everyone. Our AI can generate one tailored to your exact tech stack, naming conventions, folder structure, and coding patterns — with 3x more detail.