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.
- 🚀 TypeScript support
- 🔐 Authentication (Login/Register)
- 🧩 Modular structure (Controllers, Routes, Services, Middlewares)
- 📦 Environment configuration with
dotenv - 📚 Validation using
zod - 🧪 Unit testing with
Jestandsupertest - 🔍 Logging with
winston - 📁 Organized project architecture for scalability
-
Clone the repository
git clone https://github.com/arrazyfathan/typescript-restful-api.git cd typescript-restful-api -
Create env files
DATABASE_URL="mysql://root:rootpass@localhost:3306/contact_db"
-
Install dependencies
npm install
-
Database setup ( Prisma )
npx prisma migrate dev npx prisma generate
-
Build and Run
npm run build npm run dev / start
- Node.js
- Express.js
- TypeScript
- Zod (validation)
- Jest & Supertest (testing)
src/
├── application/
├── controller/
├── error/
├── middleware/
├── model/
├── routes/
├── service/
├── type/
├── validation/
└── main.ts
test/
├── all test case
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.
Contributions are welcome! Please open issues or submit pull requests.
Distributed under the MIT License. See LICENSE for more information.