Standardize all frontend API calls using the existing useApiService as the single base layer, and introduce a scalable feature-based API structure.
This issue establishes the foundation pattern for all future API integrations, starting with /api/v1/boards.
Current State
- A base API layer already exists:
useApiService
- Some API calls are still directly using
$fetch or inline logic in components
- No consistent feature-based API module structure yet
Scope of this Issue
1. Standardize API Usage
All API calls must go through:
useApiService
No direct $fetch usage in components or pages.
2. Introduce Feature-Based API Modules
Create modular API files per domain (feature-based structure):
/composables/api/
boards.ts
users.ts
posts.ts
Each module should wrap useApiService calls.
3. First Migration: Boards API
Migrate and standardize:
/api/v1/boards
Requirements:
- Create
useBoardsApi
- All board requests must use
useApiService
- No direct API calls in components
Example API methods:
getBoards()
getBoard(id)
createBoard(payload)
updateBoard(id, payload)
deleteBoard(id)
Important Notes
- This endpoint is public (no authentication required)
- Do not attach auth headers for this module
- Must remain compatible with future authenticated APIs
- Must fully rely on
useApiService
Expected Outcome
After implementation:
- All board-related API calls are centralized
- Components only interact with
useBoardsApi
useApiService becomes the single HTTP abstraction layer
- Clear structure for scaling to all other endpoints
Future Scope (Not part of this issue)
- Migrate all remaining APIs to feature modules
- Add TypeScript strict typing for API responses
- Add caching strategy (Nuxt / Cloudflare)
- Introduce advanced repository/service pattern if needed
Acceptance Criteria
Standardize all frontend API calls using the existing
useApiServiceas the single base layer, and introduce a scalable feature-based API structure.This issue establishes the foundation pattern for all future API integrations, starting with
/api/v1/boards.Current State
useApiService$fetchor inline logic in componentsScope of this Issue
1. Standardize API Usage
All API calls must go through:
useApiServiceNo direct
$fetchusage in components or pages.2. Introduce Feature-Based API Modules
Create modular API files per domain (feature-based structure):
Each module should wrap
useApiServicecalls.3. First Migration: Boards API
Migrate and standardize:
/api/v1/boards
Requirements:
useBoardsApiuseApiServiceExample API methods:
getBoards()getBoard(id)createBoard(payload)updateBoard(id, payload)deleteBoard(id)Important Notes
useApiServiceExpected Outcome
After implementation:
useBoardsApiuseApiServicebecomes the single HTTP abstraction layerFuture Scope (Not part of this issue)
Acceptance Criteria
useApiServiceuseBoardsApiis created and used/api/v1/boardsmigrated successfully$fetchusage remains for boards