Loading...
Loading...
Modern web development expertise covering React, Node.js, databases, and full-stack architecture. Use when: building web applications, developing APIs, creating frontends, setting up databases, deploying web apps, or when user mentions React, Next.js, Express, REST API, GraphQL, MongoDB, PostgreSQL, or full-stack development.
npx skill4agent add shubhamsaboo/awesome-llm-apps fullstack-developersrc/
├── app/ # Next.js app router pages
├── components/ # Reusable UI components
│ ├── ui/ # Base components (Button, Input)
│ └── features/ # Feature-specific components
├── lib/ # Utilities and configurations
├── hooks/ # Custom React hooks
├── types/ # TypeScript types
└── styles/ # Global stylessrc/
├── routes/ # API route handlers
├── controllers/ # Business logic
├── models/ # Database models
├── middleware/ # Express middleware
├── services/ # External services
├── utils/ # Helper functions
└── config/ # Configuration files// app/api/users/route.ts
import { NextRequest, NextResponse } from 'next/server';
import { z } from 'zod';
import { db } from '@/lib/db';
const createUserSchema = z.object({
email: z.string().email(),
name: z.string().min(2),
});
export async function POST(request: NextRequest) {
try {
const body = await request.json();
const data = createUserSchema.parse(body);
const user = await db.user.create({
data: {
email: data.email,
name: data.name,
},
});
return NextResponse.json(user, { status: 201 });
} catch (error) {
if (error instanceof z.ZodError) {
return NextResponse.json(
{ error: 'Invalid input', details: error.errors },
{ status: 400 }
);
}
return NextResponse.json(
{ error: 'Internal server error' },
{ status: 500 }
);
}
}// components/UserProfile.tsx
'use client';
import { useQuery } from '@tanstack/react-query';
import { useState } from 'react';
interface User {
id: string;
name: string;
email: string;
}
export function UserProfile({ userId }: { userId: string }) {
const { data: user, isLoading, error } = useQuery({
queryKey: ['user', userId],
queryFn: () => fetch(`/api/users/${userId}`).then(r => r.json()),
});
if (isLoading) return <div>Loading...</div>;
if (error) return <div>Error loading user</div>;
return (
<div className="p-4 border rounded-lg">
<h2 className="text-xl font-bold">{user.name}</h2>
<p className="text-gray-600">{user.email}</p>
</div>
);
}// lib/db.ts
import { PrismaClient } from '@prisma/client';
export const db = new PrismaClient();// app/api/posts/route.ts
import { NextRequest, NextResponse } from 'next/server';
import { z } from 'zod';
import { db } from '@/lib/db';
const createPostSchema = z.object({
title: z.string().min(1).max(200),
content: z.string().min(1),
authorId: z.string(),
});
export async function GET() {
const posts = await db.post.findMany({
include: { author: true },
orderBy: { createdAt: 'desc' },
});
return NextResponse.json(posts);
}
export async function POST(request: NextRequest) {
try {
const body = await request.json();
const data = createPostSchema.parse(body);
const post = await db.post.create({
data,
include: { author: true },
});
return NextResponse.json(post, { status: 201 });
} catch (error) {
if (error instanceof z.ZodError) {
return NextResponse.json(
{ error: 'Invalid input', details: error.errors },
{ status: 400 }
);
}
return NextResponse.json(
{ error: 'Failed to create post' },
{ status: 500 }
);
}
}npm install @prisma/client zod
npm install -D prismamodel Post {
id String @id @default(cuid())
title String
content String
authorId String
author User @relation(fields: [authorId], references: [id])
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}# Initialize Prisma
npx prisma init
# Run migrations
npx prisma migrate dev --name init
# Generate Prisma client
npx prisma generate