CodeTurtle
A Next.js application with GitHub OAuth authentication, built with Better Auth and Prisma.
Warning
๐ง Project Under Construction ๐ง
The site is under construction, so OAuth of GitHub might not work because it is set temperaroly for the local URL for development.
Features
- ๐ GitHub OAuth authentication (GitHub-only)
- ๐ PostgreSQL database with Prisma ORM
- ๐จ Modern UI with Tailwind CSS and Shadcn UI
- โก Built with Next.js 15 and React 19
- ๐ State management with React Query and Zustand
Prerequisites
- Node.js 18+ or Bun
- PostgreSQL database
- GitHub OAuth App credentials
Environment Setup
- Create a
.envfile in the root directory:
DATABASE_URL="postgresql://user:password@host:port/database"
BETTER_AUTH_SECRET="your-secret-key"
BETTER_AUTH_URL="http://localhost:3000"
GITHUB_CLIENT_ID="your-github-client-id"
GITHUB_CLIENT_SECRET="your-github-client-secret"- Create a GitHub OAuth App:
- Go to GitHub Settings โ Developer settings โ OAuth Apps
- Create a new OAuth App
- Set Authorization callback URL to:
http://localhost:3000/api/auth/callback/github - Copy Client ID and Client Secret to your
.envfile
Getting Started
- Install dependencies:
bun install- Generate Prisma client and run migrations:
npx prisma generate
npx prisma migrate dev- Seed the database with test data (optional):
bun run db:seed- Run the development server:
bun devOpen http://localhost:3000 with your browser to see the result.
Database Scripts
bun run db:clear- Clear all data from databasebun run db:seed- Clear all data (users are created automatically via GitHub OAuth on first login)bun run db:reset- Clear database (runs db:clear and db:seed)
Tech Stack
- Framework: Next.js 15 with App Router
- Language: TypeScript
- Authentication: Better Auth with GitHub OAuth
- Database: PostgreSQL with Prisma ORM
- Styling: Tailwind CSS
- UI Components: Shadcn UI
- State Management: React Query + Zustand
- Runtime: Bun
Learn More
To learn more about Next.js, take a look at the following resources:
- Next.js Documentation - learn about Next.js features and API.
- Learn Next.js - an interactive Next.js tutorial.
You can check out the Next.js GitHub repository - your feedback and contributions are welcome!
Deploy on Vercel
The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.
Check out our Next.js deployment documentation for more details.