This project demonstrates a Node.js (Express JS) application with TypeScript that uses Axios for making HTTP requests to an external API, caches data, and saves it to a database for DOT Assessment Test.
- Implements HTTP methods (GET, POST, PUT, PATCH, DELETE) with Axios.
- Caches API responses to minimize external requests using lru-cache.
- Saves data to MySQL database using Prisma ORM.
- Follows MVC architecture (Contract & Service Pattern).
-
Clone the repository:
git clone https://github.com/ilhamsg7/dot-assessment-test.git cd dot-assessment-test
-
Install dependency
pnpm install
-
Copy .env.example to .env
cp .env.example .env
-
Setup your database in .env file
DATABASE_URL=mysql://your_username:your_password@localhost:3306/your_database
-
Migrate and run seeder for database
pnpx prisma migrate dev
pnpm exec tsx ./prisma/seed.ts
-
To develop all apps and packages, run the following command
pnpm run dev