Skip to content

pakzad17ahp/nodejs-api-astek

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚀 Node.js API Starter Kit (ASTEK)

A professional, modular starter kit for building powerful APIs with Node.js and TypeScript

Stars Forks Issues
TypeScript Express TypeORM Swagger


Features

  • Modular Architecture – Clean and scalable code with modules (user, auth, role, product)
  • JWT Authentication – Secure login and registration with tokens
  • TypeORM Integration – Easy work with relational databases (PostgreSQL/MySQL)
  • Auto-generated Documentation – Swagger UI for testing and documenting your API at /api-docs
  • Centralized Error Handling – Handle errors in one place with a dedicated middleware
  • Auto-create Database – Creates the database on first run if it doesn't exist
  • Seed Scripts – Populate the database with initial data (available in commits)
  • Environment Variables – Easy configuration with dotenv and .env file
  • TypeScript – Type-safe code with better development experience
  • Hot Reload – Use ts-node-dev in development mode

Core Technologies

Area Technology
Language TypeScript
Framework Express.js
ORM TypeORM
Database PostgreSQL / MySQL
Documentation Swagger (OpenAPI)
Authentication JWT + bcrypt
Environment dotenv
Code Formatter Prettier

Installation

Prerequisites

  • Node.js (version 16 or higher)
  • npm or yarn
  • PostgreSQL or MySQL (installed and running)

Steps

1️⃣ Clone the repository

git clone https://github.com/Morez-Momeni/nodejs-api-astek.git
cd nodejs-api-astek

2️⃣ Install dependencies

npm install
# or
yarn install

3️⃣ Set up environment variables

Copy .env.example to .env and fill in your values (port, database credentials, JWT secret):

cp .env.example .env

4️⃣ Run the project

# Development mode 
npm run dev

# Build the project
npm run build

# Run production version
npm start

The server will start at http://localhost:3000

API Documentation

Once the project is running, you can view the complete API documentation at:

  • http://localhost:3000/api-docs
  • This documentation is automatically generated by Swagger and includes all endpoints, request examples, and responses.

Main API Routes

Route Description
/api/auth Registration, login, token management
/api/users User management
/api/roles TypeORM
/api/products Product management

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors