This project is a React application built with Vite for lightning-fast development, TypeScript for type safety, and Vitest for testing.
It also uses JSON Server to simulate backend APIs during development.
| Technology | Description |
|---|---|
| ⚡ Vite | A blazing-fast build tool for modern frontend development |
| ⚛️ React | A JavaScript library for building user interfaces |
| 🧠 TypeScript | A superset of JavaScript that adds static typing |
| 🧪 Vitest | A fast unit testing framework for Vite |
| 🌐 JSON Server | A mock REST API for simulating backend data |
| 🧹 ESLint | A linter to maintain code consistency and quality |
Make sure you have Node.js (>=18) and npm/pnpm/yarn installed.
# Clone the repository
git clone https://github.com/username/repository-name.git
# Navigate to the project folder
cd repository-name
# Install dependencies
npm installRun the following command to start the React app along with two instances of JSON Server:
npm run serve- Frontend: http://localhost:5173
- Mock API Step 1: http://localhost:4001
- Mock API Step 2: http://localhost:4002
To create a production-ready build:
npm run buildThe output will be available in the dist/ directory.
To preview the production build:
npm run previewIf you only need one of the mock servers running:
# Step 1
npm run json:step1
# Step 2
npm run json:step2This project uses Vitest with the jsdom environment.
Run all tests:
npm testOr enable watch mode:
npm run test -- --watchTo ensure code consistency and quality, run:
npm run lint.
├── src/
│ ├── api/
│ ├── components/
│ ├── hooks/
│ ├── pages/
│ ├── utils/
│ ├── App.tsx
│ └── main.tsx
│ └── style.css
├── data/
│ ├── db-step1.json
│ └── db-step2.json
├── public/
├── tsconfig.json
├── vite.config.ts
└── package.json
Made with ❤️ by Andrian Robby