How janakshukla/authentication_from_scratch works
Project type and purpose
• This is a full-stack Next.js 13 application using the App Router.
• It serves a React-based frontend, exposes serverless API routes for authentication and user management, and uses Prisma as its ORM to persist data.
File structure
• Top-level “app” directory: houses pages (app/page.tsx), layouts (app/layout.tsx), global styles, and the API functions under app/api.
• app/api/auth/login/route.ts & signup/route.ts: handle user sign-in/up.
• app/api/user/[id]/route.ts: user-specific data endpoints.
• “components/ui”: reusable UI primitives (button, card, input, label).
• “lib”: shared utilities:
• prisma.ts: Prisma client initialization.
• getsetuser.ts, utils.ts: business logic around session/user retrieval.
• “store/userstore.ts”: client-side state management (e.g., Zustand/MobX/Pinia style).
• “prisma/schema.prisma”: database schema definitions.
• Config and build files: next.config.ts, tsconfig.json, tailwind.config.ts, postcss.config.mjs, eslint.config.mjs.
README insights
• Standard Create-Next-App boilerplate with links to Next.js docs.