npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

express-api-quick-start

v1.0.1

Published

Template de base pour API Express avec Sequelize, MySQL et Swagger

Readme

🚀 Express API Starter

Template de base pour créer une API Express avec Sequelize, MySQL et Swagger en une seule commande !

✨ Fonctionnalités

  • Express.js configuré
  • Sequelize ORM pour MySQL
  • Swagger pour la documentation automatique
  • Structure de dossiers organisée
  • Générateur de routes intégré automatiquement
  • Configuration prête à l'emploi

📦 Installation

npx create-express-api mon-projet

Ça crée automatiquement :

  • 📁 Structure complète du projet
  • 📦 Installation des dépendances
  • 🛠️ Installation du générateur de routes (express-route-gen-cli)

🚀 Quick Start

# 1. Créer le projet
npx create-express-api mon-api

# 2. Entrer dans le projet
cd mon-api

# 3. Configurer MySQL
# Modifiez src/config/config.json avec vos identifiants

# 4. Créer la base de données
mysql -u root -p
CREATE DATABASE database_dev;
EXIT;

# 5. Générer des routes
express-gen route products
express-gen route users

# 6. Créer les tables
npm run migrate

# 7. Démarrer
npm start

Ouvrez http://localhost:3000/api-docs pour voir la documentation ! 📚

📖 Utilisation

Générer une nouvelle route

express-gen route products

Crée automatiquement :

  • src/modules/v1/products/products.model.js (Modèle Sequelize)
  • src/modules/v1/products/products.controller.js (CRUD complet)
  • src/modules/v1/products/products.routes.js (Routes + Swagger)
  • src/migrations/[timestamp]-create-products.js (Migration MySQL)

Créer les tables

npm run migrate

Scripts disponibles

npm start              # Démarre le serveur
npm run dev            # Mode développement (nodemon)
npm run migrate        # Exécute les migrations
npm run migrate:undo   # Annule la dernière migration

📁 Structure du projet

mon-api/
├── src/
│   ├── config/
│   │   ├── config.json      # Configuration Sequelize
│   │   ├── database.js      # Connexion MySQL
│   │   └── swagger.js       # Configuration Swagger
│   ├── migrations/          # Migrations Sequelize
│   ├── modules/
│   │   └── v1/             # Modules générés
│   ├── routes/
│   │   └── v1/
│   │       └── index.js    # Routes principales
│   ├── app.js              # Configuration Express
│   └── server.js           # Point d'entrée
├── .env.example
├── .sequelizerc
└── package.json

🔧 Configuration

Base de données

Modifiez src/config/config.json :

{
  "development": {
    "username": "root",
    "password": "votre_password",
    "database": "votre_database",
    "host": "127.0.0.1",
    "port": 3306,
    "dialect": "mysql"
  }
}

Ou utilisez le fichier .env :

cp .env.example .env

🎯 Exemple complet

# Créer le projet
npx create-express-api blog-api
cd blog-api

# Configurer MySQL dans src/config/config.json

# Générer les routes
express-gen route posts
express-gen route comments
express-gen route users

# Créer les tables
npm run migrate

# Démarrer
npm start

Vous obtenez instantanément :

  • 15 endpoints (5 par module)
  • Documentation Swagger complète
  • Base de données prête

🛠️ Stack technique

  • Express.js - Framework web
  • Sequelize - ORM MySQL
  • Swagger - Documentation API
  • MySQL - Base de données
  • express-route-gen-cli - Générateur de routes

📚 Documentation

🤝 Contribution

Les contributions sont les bienvenues ! N'hésitez pas à ouvrir une issue ou un pull request.

📄 Licence

MIT

👨‍💻 Auteur

Créé avec ❤️ pour simplifier le développement d'API Express


Bon développement ! 🚀