- Add OpenSpec experimental workflow with commands (opsx-apply, opsx-archive, opsx-explore, opsx-propose) - Add Serena memory system for project context - Implement User API (UserController, UserModel, routes) - Add Specimen delete endpoint - Update Test definitions and Routes - Sync API documentation (OpenAPI) - Archive completed 2026-03-08-backend-specs change
56 lines
1.8 KiB
Markdown
56 lines
1.8 KiB
Markdown
# Backend API Requirements
|
|
|
|
This folder contains specifications for backend changes needed to support the frontend features.
|
|
|
|
## Quick Summary
|
|
|
|
| Feature | Status | Priority | Files to Create/Modify |
|
|
|---------|--------|----------|----------------------|
|
|
| Specimen Delete | Missing | High | Routes.php, SpecimenController.php |
|
|
| User CRUD | Not Implemented | High | UserController.php, UserModel.php, Routes.php |
|
|
|
|
## Directory Structure to Create
|
|
|
|
```
|
|
app/
|
|
├── Config/
|
|
│ └── Routes.php # MODIFY - Add new routes
|
|
├── Controllers/
|
|
│ └── Specimen/
|
|
│ └── SpecimenController.php # MODIFY - Add delete method
|
|
│ └── User/ # CREATE
|
|
│ └── UserController.php # CREATE - Full CRUD
|
|
├── Models/
|
|
│ └── User/ # CREATE
|
|
│ └── UserModel.php # CREATE - User database model
|
|
```
|
|
|
|
## Files
|
|
|
|
1. **specimen-delete.md** - Specimen delete endpoint specification
|
|
2. **user-api.md** - Complete User CRUD API specification
|
|
3. **code-templates/** - Ready-to-use code templates
|
|
- UserController.php
|
|
- UserModel.php
|
|
- Routes-additions.php
|
|
|
|
## Testing Checklist
|
|
|
|
After implementation, verify these endpoints work:
|
|
|
|
```bash
|
|
# Specimen Delete
|
|
curl -X DELETE http://localhost:8000/api/specimen/123
|
|
|
|
# User CRUD
|
|
curl http://localhost:8000/api/users
|
|
curl http://localhost:8000/api/users/1
|
|
curl -X POST http://localhost:8000/api/users -H "Content-Type: application/json" -d '{"username":"test","email":"test@test.com"}'
|
|
curl -X PATCH http://localhost:8000/api/users -H "Content-Type: application/json" -d '{"UserID":1,"username":"updated"}'
|
|
curl -X DELETE http://localhost:8000/api/users/1
|
|
```
|
|
|
|
## Questions?
|
|
|
|
Contact the frontend team if you need clarification on data structures or expected responses.
|