Database
+Todos Demo
+Todos
+ + {isPending && ( +Loading todos...
+ )} + + {isError && ( ++ Failed to load todos: {error.message}. Is the GraphQL backend + running on http://localhost:4000? +
+ )} + + {!isPending && !isError && ( +-
+ {todos.map((todo) => (
+
-
+ + {todo.title} + #{todo.id} ++
+ ))}
+ {todos.length === 0 && (
+
- + No todos yet. Create one below! + + )} +
+ Powered by GraphQL + Apollo Server +
++ The frontend queries the GraphQL backend on port 4000, which uses + Prisma to talk to PostgreSQL +
+Setup Instructions:
+-
+
-
+ Configure
DATABASE_URLin{' '} +packages/db/.envandapps/backend/.env+
+ -
+ Run:
pnpm install+
+ -
+ Run:
pnpm db:generate && pnpm db:push+
+ -
+ Optional:
pnpm db:seed+
+ -
+ Run:
pnpm dev(starts frontend and backend + together) +
+