Ditto is a lightweight mock API server, simulate dynamic responses...
- Creating mock endpoints with custom request/response behavior
- Viewing and logging incoming requests
- Organizing mocks by collections
- Frontend: React (TailwindCSS, Vite or CRA)
- Backend: Node.js + Express
- Database: PostgreSQL for database
- Containerization: Docker & Docker Compose
git clone https://github.com/baraklabs/ditto.git
cd ditto
### ✅ 2. Build & Start Docker Compose
```bash
docker-compose up --buildThis will:
- Pull the
postgresimage - Build your Node.js app image
- Start the database and wait for it
- Run migrations using
migrateAndSeed.js - Start your Express app on port
3001
Once up:
-
Check logs:
docker-compose logs -f
-
Health check:
curl http://localhost:3001/api/ditto/health
If successful, you'll see:
{ "status": "ok" }GET /api/ditto/health
GET /api/ditto/collectionsGET /api/ditto/collections/:idPOST /api/ditto/collectionsPUT /api/ditto/collections/:idDELETE /api/ditto/collections/:id
GET /api/ditto/mocksGET /api/ditto/mocks/:idPOST /api/ditto/mocksPUT /api/ditto/mocks/:idDELETE /api/ditto/mocks/:id
GET /api/ditto/request-responseDELETE /api/ditto/request-response/:id
Ditto/
├── Dockerfile
├── docker-compose.yml
├── .env
├── docker-entrypoint.sh
├── package.json
├── app.js
├── runMigrations.js
├── db.js
├── routes/
│ ├── index.js
│ ├── health.js
│ ├── collection.js
│ ├── mock.js
│ └── requestResponse.js
└── sql/
├── 001_create_collections.sql
├── 002_create_mocks.sql
└── 003_create_request_response.sql
Sponsorships help keep Ditto running smoothly and actively maintained.
Your support will go directly toward keeping the product afloat — covering hosting, bug fixes, and continuous improvements.
However, we would love to know why you're choosing to sponsor us.
It could be as simple as:
"Ditto helped in our day-to-day tasks!"
or
"Hi 👋 – just wanted to show appreciation!"
Please drop us a quick note at [email protected]
– Team BarakLabs 💚