Skip to content

A modern Express.js boilerplate with TypeScript, featuring JWT, sessions, Google OAuth, Drizzle ORM, CSRF protection, and a modular architecture for secure and scalable app development.

License

Notifications You must be signed in to change notification settings

tajbinkhan/express-authentication-boilerplate

Repository files navigation

Express Authentication Server

A secure authentication server built with Express.js featuring comprehensive security measures and modern authentication capabilities.

Features

  • 🔐 Authentication

    • Custom authentication strategy
    • Google OAuth integration
    • Session-based authentication
    • Passport.js integration
  • 🛡️ Security

    • CSRF protection
    • Helmet security headers
    • Rate limiting
    • CORS configuration
    • Cookie security
  • 🔧 Core Features

    • MongoDB integration
    • WebSocket support (Socket.IO)
    • File upload handling
    • Request logging
    • Error handling middleware
    • Environment configuration

Getting Started

Prerequisites

  • Node.js
  • MongoDB
  • npm or yarn

Installation

  1. Clone the repository
  2. Install dependencies:
npm install
  1. Create a .env file with the following variables:
PORT=8080
NODE_ENV=development
MONGODB_URI=your_mongodb_uri
SESSION_SECRET=your_session_secret
GOOGLE_CLIENT_ID=your_google_client_id
GOOGLE_CLIENT_SECRET=your_google_client_secret
  1. Start the server:
npm run dev

API Endpoints

The server will be available at:

Technology Stack

  • Express.js
  • MongoDB
  • Socket.IO
  • Passport.js
  • Helmet
  • CORS
  • Cookie Parser
  • Express Session

Security Features

  • Double CSRF Protection
  • Rate Limiting
  • Secure Sessions
  • Helmet Security Headers
  • CORS Configuration
  • Error Handling

Contributing

Feel free to submit issues and pull requests.

License

This project is licensed under the MIT License.

About

A modern Express.js boilerplate with TypeScript, featuring JWT, sessions, Google OAuth, Drizzle ORM, CSRF protection, and a modular architecture for secure and scalable app development.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published