Use this document as a reference when implementing or finalizing any service (S3, SQS, SNS, DynamoDB, etc.) in the LocalStack UI. This ensures consistency in architecture, UI, and UX.
For every service, implement the following in the Go client:
- Data Structures:
[Service]Info: Lightweight struct for listing (e.g.,BucketInfo,QueueInfo).[Service]DetailorValue: Detailed struct for individual item view (e.g.,SecretValue,S3Object).
- Client Implementation:
New[Service]Client: Factory function usingGetConfig.List[Service]s: Returns a slice ofInfostructs.Get[Service]: Returns details for a specific resource ID.Create[Service]: Handles resource creation.Update[Service]: (If applicable) Handles resource updates.Delete[Service]: Handles resource deletion.
Register the REST endpoints using the standard library's ServeMux.
- Endpoints:
GET /api/[service]: List resources.POST /api/[service]: Create resource.GET /api/[service]/{id}: Get resource details.PUT /api/[service]/{id}: Update resource.DELETE /api/[service]/{id}: Delete resource.
- Handler Pattern:
- Initialize specific AWS client.
- Parse path variables or JSON body.
- Call client method.
- Return JSON response with correct headers/status codes.
In the Alpine.js app() function:
- State Variables:
[resources]: Array for the list view.[resource]Search: String for filtering.show[Resource]Modal: Boolean for UI control.is[Action]ing: Boolean for loading states.
- Methods:
fetch[Resources]: Calls the list API.selectService(name): Triggers the initial fetch.openCreate[Resource]: Resets form and opens modal.view[Resource](id): Fetches details and opens view/edit modal.save/update[Resource]: Logic for PUT/POST.delete[Resource](id): Logic for DELETE withconfirm().
Follow the Shadcn UI aesthetic:
- List View:
- Header with title, description, Refresh button, and "Create" button.
- Search input for real-time filtering.
- Data table with neutral borders and hover effects.
- Modals:
- Consistent layout: Header (Title + Close), Body (Scrollable content), Footer (Actions).
- Backdrop blur (
backdrop-blur-sm).
- UX Patterns:
- KV Editor: If the resource is an object/JSON (like Secrets or DynamoDB items), provide a Key-Value grid.
- Raw Mode: Always provide a Raw/JSON editor fallback.
- Toasts: Use
this.addToast(msg, type)for all async actions. - Clipboard: Provide "Copy" buttons for IDs, ARNs, and values.
- List API returns Names + Descriptions.
- Detail API returns the Secret String.
- UI detects if the string is JSON.
- If JSON: Render
secretKVarray (key-value rows). - On Save: Serialize KV back to JSON string and send to Go API.