S — Slice to Essentials (build the thin slice)

Definition of the slice

1 screen (+ success state)

2 endpoints (POST /action, GET /status)

3 tests (happy, bad input, mocked failure)

1 metric instrumented (per attempt)

Minimal folder skeleton

/app
/api # endpoints
/ui # …


This content originally appeared on DEV Community and was authored by Manuel S. Martone

Definition of the slice

  • 1 screen (+ success state)
  • 2 endpoints (POST /action, GET /status)
  • 3 tests (happy, bad input, mocked failure)
  • 1 metric instrumented (per attempt)

Minimal folder skeleton

/app
  /api        # endpoints
  /ui         # one screen + success
  /tests      # 3 tests
  /metrics    # logger/tracker

Fastify stubs (copy‑paste)

app.post('/action', async (req, reply) => {
  const { input } = req.body || {};
  if (!input) {
      reply.statusCode = 400:
      return { error: 'missing input' };
  }
  const id = Date.now().toString();
  // TODO: enqueue or mock work
  return { id };
});

app.get('/status', async (req, reply) => {
  const { id } = req.query || {};
  // TODO: return mocked result for demo
  return { id, state: 'done', result: { ok: true } };
});

Tests (Given/When/Then)

Given valid input → When POST /action → Then receive id
Given missing input → When POST /action → Then 400
Given id → When GET /status → Then state in {'queued','done'} and result?

Instrumentation (pseudo)

log('attempt', { id, ts });
log('success', { id, ts, useful: rating });

Ship boring. Learn fast. The goal isn’t elegance; it’s evidence.

Full checklist + copy blocks → https://shipwithai.substack.com/p/pasta-al-dente-ship-a-one-feature?utm_source=devto&utm_medium=social&utm_campaign=issue_pasta_al_dente_week


This content originally appeared on DEV Community and was authored by Manuel S. Martone


Print Share Comment Cite Upload Translate Updates
APA

Manuel S. Martone | Sciencx (2025-09-27T08:53:15+00:00) S — Slice to Essentials (build the thin slice). Retrieved from https://www.scien.cx/2025/09/27/s-slice-to-essentials-build-the-thin-slice/

MLA
" » S — Slice to Essentials (build the thin slice)." Manuel S. Martone | Sciencx - Saturday September 27, 2025, https://www.scien.cx/2025/09/27/s-slice-to-essentials-build-the-thin-slice/
HARVARD
Manuel S. Martone | Sciencx Saturday September 27, 2025 » S — Slice to Essentials (build the thin slice)., viewed ,<https://www.scien.cx/2025/09/27/s-slice-to-essentials-build-the-thin-slice/>
VANCOUVER
Manuel S. Martone | Sciencx - » S — Slice to Essentials (build the thin slice). [Internet]. [Accessed ]. Available from: https://www.scien.cx/2025/09/27/s-slice-to-essentials-build-the-thin-slice/
CHICAGO
" » S — Slice to Essentials (build the thin slice)." Manuel S. Martone | Sciencx - Accessed . https://www.scien.cx/2025/09/27/s-slice-to-essentials-build-the-thin-slice/
IEEE
" » S — Slice to Essentials (build the thin slice)." Manuel S. Martone | Sciencx [Online]. Available: https://www.scien.cx/2025/09/27/s-slice-to-essentials-build-the-thin-slice/. [Accessed: ]
rf:citation
» S — Slice to Essentials (build the thin slice) | Manuel S. Martone | Sciencx | https://www.scien.cx/2025/09/27/s-slice-to-essentials-build-the-thin-slice/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.