Skip to content

Template for Node.js with Express, Typescript, jest, ORM Prisma

Notifications You must be signed in to change notification settings

Hooded22/express_template

Repository files navigation

Express application template

Project Overview

This is a robust, versatile starter template designed to accelerate the development of scalable Express applications integrated with TypeScript, Prisma ORM, and Redis caching. It focuses on clean architecture and full-stack functionality with essential backend technologies, including user authentication, database schema management, and more.

Key Functionalities

  • TypeScript Configuration
  • Authentication Logic
  • Prisma ORM
  • Database Connection
  • Folder Structure
  • User Implementation
  • Sample Relation Implementation
  • ESLint Configuration
  • Environment Configuration
  • Logging Infrastructure
  • Data Validation
  • Testing Suite
  • CI/CD Integration
  • API Documentation
  • Security Enhancements
  • Error Handling Middleware

Run Instructions

  1. Clone the Repository:

    git clone <repository_url>
    cd <repository_directory>
  2. Install Dependencies:

    npm install
  3. Set Up Environment Variables: Create a .env file in the root directory with the following content:

    PORT=3000
    DATABASE_URL="mysql://root:express_app@localhost:3307/express_app_db"
  4. Run MySQL in Docker: Execute the following command to run a MySQL database in a Docker container:

    docker run --name my-mysql-express-app -e MYSQL_ROOT_PASSWORD=express_app -e MYSQL_DATABASE=express_app_db -e MYSQL_PASSWORD=express_app -p 3307:3306 -d mysql:8.0
  5. Run Database Migrations:

    npm run migrate
  6. Start the Application:

    npm start

The application will run locally on the specified port (default is 3000). You can access the API via http://localhost:3000. Ensure the Docker container is running before starting the application to allow database connections.

About

Template for Node.js with Express, Typescript, jest, ORM Prisma

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published