Nextjs Data Access Layer
ASecurityA Client Component must not import the DAL or database client. Keep the query in a server-only DAL function, authenticate and authorize there, and return a minimal serializable DTO through one of these bridges: - Fetch it in a parent Server Component and pass the DTO as props. - Use a Server Action for a mutation or user-triggered read. - Use a Route Handler when the client needs an HTTP boundary. Do not fetch your own internal API from a Server Component; call the DAL directly on the server.
- 584 stars
- 0 votes
- 0 copies
- 5 views
- Added September 5, 2026
Works with
Security analysis
100/100Pro scans all 11 files and shows the line behind each finding
npx -y skills add HoangNguyen0403/agent-skills-standard --skill nextjs-data-access-layer --agent claude-codeAre you the author of Nextjs Data Access Layer?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/hoangnguyen0403-nextjs-data-access-layer-382278f6)# Client access to database data
A Client Component must not import the DAL or database client. Keep the query in a server-only DAL function, authenticate and authorize there, and return a minimal serializable DTO through one of these bridges:
- Fetch it in a parent Server Component and pass the DTO as props.
- Use a Server Action for a mutation or user-triggered read.
- Use a Route Handler when the client needs an HTTP boundary.
Do not fetch your own internal API from a Server Component; call the DAL directly on the server.
Files in this skill
- eval-1.baseline.md
- eval-1.with-skill.md
- eval-2.baseline.md
- eval-2.with-skill.md
- eval-3.baseline.md
- eval-3.with-skill.md
- trigger-1.md
- trigger-2.md
- trigger-3.md
- trigger-4.md
Attribution
Related skills
View all in development →Comments
Loading comments…
Newsletter
Get the weekly list of safe new skills, and the ones we pulled.