Skip to content

arrazyfathan/typescript-restful-api

Repository files navigation

TypeScript RESTful API : Contact Management

Node.js TypeScript Express

A robust and scalable RESTful API built with TypeScript, Express, and Prisma ORM. This API demonstrates modern backend development practices including proper type safety, database management, and RESTful principles.

✨ Features

  • 🚀 TypeScript support
  • 🔐 Authentication (Login/Register)
  • 🧩 Modular structure (Controllers, Routes, Services, Middlewares)
  • 📦 Environment configuration with dotenv
  • 📚 Validation using zod
  • 🧪 Unit testing with Jest and supertest
  • 🔍 Logging with winston
  • 📁 Organized project architecture for scalability

Installation

  1. Clone the repository

       git clone https://github.com/arrazyfathan/typescript-restful-api.git
       cd typescript-restful-api
  2. Create env files

     DATABASE_URL="mysql://root:rootpass@localhost:3306/contact_db"
  3. Install dependencies

    npm install
  4. Database setup ( Prisma )

    npx prisma migrate dev
    npx prisma generate
  5. Build and Run

    npm run build
    npm run dev / start

🏗️ Tech Stack

  • Node.js
  • Express.js
  • TypeScript
  • Zod (validation)
  • Jest & Supertest (testing)

📂 Project Structure

   src/
   ├── application/       
   ├── controller/       
   ├── error/       
   ├── middleware/  
   ├── model/       
   ├── routes/      
   ├── service/     
   ├── type/        
   ├── validation/   
   └── main.ts    
   test/
   ├── all test case   

📥 Download Postman Collection

You can download the Postman collection for the Contact Management API using the link below:

🔗 Download Contact Management API Postman Collection

Make sure to import this collection into your Postman workspace to test and explore all available endpoints.

If you haven't already, install Postman to get started.

🤝 Contributing

Contributions are welcome! Please open issues or submit pull requests.

License

Distributed under the MIT License. See LICENSE for more information.

About

Contact Management Restful API - TypeScript

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Contributors