Skip to content

OsamaRab3/Node.js-Starter-Template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

3 Commits
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿš€ Node.js Starter Template

A minimal and well-structured Node.js project template to speed up development.

๐Ÿ“ Folder Structure

Node.js-Starter-Template/
|
โ”œโ”€โ”€ README.md               # Project documentation
โ””โ”€โ”€ src/                    # Main application source code
    โ”œโ”€โ”€ api/                # API-related files
    โ”‚   โ”œโ”€โ”€ controllers/    # Controllers (handling requests)
    โ”‚   โ””โ”€โ”€ routes/         # Route definitions
    โ”œโ”€โ”€ app.js              # Main app entry point
    โ”œโ”€โ”€ config/             # Configuration files
    โ”‚   โ”œโ”€โ”€ index.js        # Environment variables and configurations
    โ”‚   โ””โ”€โ”€ init.js         # Middleware and error handling setup
    โ”œโ”€โ”€ middleware/         # Middleware functions
    โ”œโ”€โ”€ models/             # Database models
    โ”œโ”€โ”€ package.json        # Project metadata & dependencies
    โ”œโ”€โ”€ package-lock.json   # Lockfile for dependencies
    โ”œโ”€โ”€ server.js           # Server setup
    โ”œโ”€โ”€ services/           # Business logic services
    โ”œโ”€โ”€ tests/              # Unit and integration tests
    โ””โ”€โ”€ utils/              # Utility functions
        โ”œโ”€โ”€ asyncErrorHandler.js # Async error handling utility
        โ””โ”€โ”€ CustomError.js       # Custom error handling class

๐Ÿš€ Getting Started

  1. Clone the repository

    git clone https://github.com/OsamaRab3/Node.js-Starter-Template.git
    cd Node.js-Starter-Template
  2. Install dependencies

    cd src
    npm install
  3. Run the application

    npm start

โšก Alternative Setup with degit

If you want to create a new project from this template without cloning the Git history, use degit:

  • For JavaScript version:

    npx degit OsamaRab3/Node.js-Starter-Template#master my-new-project
    cd my-new-project/src
    npm install
  • For TypeScript version:

    npx degit OsamaRab3/Node.js-Starter-Template#ts my-new-project
    cd my-new-project/src
    npm install
    npx ts-node server.ts

๐Ÿ“Œ Features

โœ… Predefined project structure
โœ… Organized folders for maintainability
โœ… Ready for Express.js backend development
โœ… Simple and easy-to-use starter template
โœ… Built-in error handling and middleware support

About

Node.js Template Structure for js and ts

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

โšก