PromptBase
PromptBase SelectGet Select
Close icon
General
Home
Marketplace
Create
Hire
Login
Chat
Sell
Explore

Prompt Details

Model
Chat - (gpt-6-luna)
Token size
228
Example input
[AUDIENCE]: Junior backend developer [GOAL]: Design a REST API for a food delivery app that handles 10,000 daily orders
Example output
1. Direct answer For 10,000 daily orders (roughly 1-2 requests per second on average, 20-50 at peak), a stateless Node.js + Express REST API backed by Postgres is the simplest fit. Skip microservices for now - one well-structured service is far easier to deploy and debug at this scale. 2. Example code ```js // POST /orders - create a new order app.post('/orders', validate(orderSchema), async (req, res, next) => { try { // Transaction keeps inventory + order writes consistent const order = await db.transaction(async (trx) => { await trx('inventory').decrement('stock', req.body.items); const [created] = await trx('orders').insert(req.body).returning('*'); return created; }); res.status(201).json(order); } catch (err) { next(err); } }); ``` 3. Step-by-step explanation - Validation middleware rejects bad payloads before they touch the database. - The transaction wraps inventory and order writes so they succeed or fail together. - Returning 201 with the created resource is the REST convention for creation. 4. Common pitfalls - No pagination on list endpoints (add ?limit= and ?cursor=). - Storing money as floats - use integers (cents) instead. - Forgetting idempotency keys on POST /orders, which creates duplicate orders on client retries. 5. Next steps - Add rate limiting (e.g., 100 requests per minute per client). - Load-test with k6 at 3x your expected peak traffic. - Add request logging with correlation IDs for tracing.
Add to Cart
Instant accessInstant access
Usage rightsCommercial use
Money-back guaranteeMoney‑back
By purchasing this prompt, you agree to our terms of service
GPT-6-LUNA
Tested icon
Guide icon
4 examples icon
Free credits icon
52 professional developer prompts for AI. Supercharge your workflow with expert prompts for debugging, system design, code review, testing, documentation and more.
...more
Added 4 weeks ago
Report
Browse Marketplace