This project demonstrates a modern e-commerce backend and frontend using Next.js, Prisma, Postgres, Tailwind CSS, and Radix UI, following OpenFGA coding standards.
- Next.js app with TypeScript, Tailwind CSS, and Radix UI.
- Prisma ORM for database interactions.
- Postgres as the primary database, managed via Docker Compose.
- OpenFGA server and Postgres infrastructure scripts in
infra/for local development. - Prisma data model for a simple e-commerce domain: Users, Orders, OrderItems.
- Seed script to populate the database with sample users, orders, and order items.
- RESTful API at
/api/ordersto fetch and create orders. - Frontend orders page at
/ordersto view all orders and their items, with dark mode support. - Environment variables managed via
.envanddotenv.
- Start infrastructure (Postgres & OpenFGA):
./infra/start.sh
- Install dependencies:
npm install
- Run database migrations and seed data:
npx prisma migrate reset --force npx ts-node prisma/seed.ts
- Start the Next.js development server:
npm run dev
- View the app:
- Open http://localhost:3000/orders to see the orders UI.
- API available at http://localhost:3000/api/orders.
infra/- Docker Compose and scripts for infrastructureprisma/- Prisma schema and seed scriptsrc/app/api/orders/- RESTful API for orderssrc/app/orders/- Orders UI page
- Next.js, TypeScript, Tailwind CSS, Radix UI
- Prisma ORM
- Postgres (via Docker)
- OpenFGA (via Docker)
- Clear, descriptive naming
- Consistent formatting and indentation
- All new code in TypeScript
For more details, see the code and comments in each directory.