Skip to content

dualSync-cli/backend-expressjs-full

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

⚡ Express.js Full Backend

Express.js + TypeScript + Swagger + JWT + Security template.

Stack

  • Express.js
  • TypeScript
  • Swagger (OpenAPI 3.0)
  • JWT Authentication
  • Zod Validation
  • Helmet (Security)
  • CORS
  • Rate Limiting
  • Bcrypt (Password Hashing)

Getting Started

# Install dependencies
npm install

# Setup environment
cp .env.example .env

# Run in development mode
npm run dev

API Documentation

Swagger UI is available at: http://localhost:3000/api/docs

API Endpoints

General

Method Endpoint Description
GET / Welcome message
GET /health Health check

Authentication

Method Endpoint Description
POST /auth/register Register new user
POST /auth/login Login user
GET /auth/me Get current user (protected)

Project Structure

src/
├── index.ts
├── routes/
│   ├── index.ts
│   └── auth.routes.ts
├── middleware/
│   ├── errorHandler.ts
│   ├── auth.ts
│   └── validate.ts
├── utils/
│   ├── jwt.ts
│   └── hash.ts
└── schemas/
    └── auth.schema.ts

Security Features

  • Helmet: Sets various HTTP headers for security
  • CORS: Cross-Origin Resource Sharing
  • Rate Limiting: 100 requests per 15 minutes per IP
  • Password Hashing: Bcrypt with 12 salt rounds
  • JWT: JSON Web Token authentication

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published