This next.js app fetches data using URQL (GraphQL client and front end data layer) and performs CRUD operation on Turso DB using GraphQL API and Drizzle ORM (back-end data layer)
Client (Browser) <-> Next.js App <-> URQL Client <-> GraphQL API <-> Drizzle ORM <-> TursoDB/SQLite
- Frontend: Next.js
- API Layer: GraphQL
- Data Fetching: URQL Client
- Database: TursoDB/SQLite
- ORM: Drizzle
- Language: TypeScript
Key components and their roles:
src/app/page.tsx
: Main page component for UI renderingsrc/lib/urqlClient.ts
: URQL client configuration for GraphQL operations
src/app/api/graphql/route.ts
: GraphQL API endpoint handler
src/lib/schema.ts
: GraphQL schema definitions and resolvers
src/lib/db.ts
: Database configuration and Drizzle ORM setup
- User interaction in UI (page.tsx)
- URQL client sends GraphQL request
- GraphQL route processes request
- Schema handles operation
- Drizzle ORM executes database queries
- Data returns through the same path
- Type-safe end-to-end development with TypeScript
- Modern data fetching with GraphQL
- Efficient database access via Drizzle ORM
- Server-side rendering with Next.js
- Built-in API routing
- Efficient caching with URQL
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev
Open http://localhost:3000 with your browser to see the result.
[Add development guidelines here]
[Add deployment instructions here]
[Add contribution guidelines here]
[Add license information here]