← Back to list

nuxt-repositories
by leeovery
⭐ 1🍴 0📅 Jan 20, 2026
SKILL.md
name: nuxt-repositories description: Repository pattern for API access with automatic model hydration. Use when creating repositories for API resources, configuring model hydration, adding custom API methods, or registering repositories in app config.
Nuxt Repositories
Data access layer with CRUD operations and automatic model hydration.
Core Concepts
repositories.md - Complete repository patterns, registration, custom methods
Basic Repository
// app/repositories/PostRepository.ts
import { BaseRepository } from '#layers/base/app/repositories/base-repository'
import { ModelHydrator } from '#layers/base/app/repositories/hydrators/model-hydrator'
import Post from '~/models/Post'
export default class PostRepository extends BaseRepository<Post> {
protected resource = '/api/posts'
protected hydration = true
protected hydrator = new ModelHydrator(Post)
// Custom method
async listByAuthor(authorUlid: string) {
return this.jsonGet(`/api/authors/${authorUlid}/posts`)
}
}
Registration
// app/app.config.ts
export default defineAppConfig({
repositories: {
posts: PostRepository,
authors: AuthorRepository,
},
})
Usage
// Get typed repository instance
const postApi = useRepository('posts')
// CRUD operations (returns hydrated models)
const { data: posts } = await postApi.list()
const { data: post } = await postApi.get('ulid123')
const { data: newPost } = await postApi.create({ title: 'Hello' })
await postApi.update('ulid123', { title: 'Updated' })
await postApi.delete('ulid123')
// With query params
const { data: posts } = await postApi.list({
include: 'author,comments',
filter: { status: 'published' },
})
Score
Total Score
60/100
Based on repository quality metrics
✓SKILL.md
SKILL.mdファイルが含まれている
+20
✓LICENSE
ライセンスが設定されている
+10
○説明文
100文字以上の説明がある
0/10
○人気
GitHub Stars 100以上
0/15
○最近の活動
3ヶ月以内に更新がある
0/10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
✓言語
プログラミング言語が設定されている
+5
○タグ
1つ以上のタグが設定されている
0/5
Reviews
💬
Reviews coming soon