A modern web platform for developers to share, discover, and analyze code snippets with automatic time complexity detection, language-based tagging, and user profiles — built with Next.js 15 and Tailwindcss.
- 🧠 Time Complexity Analysis for algorithms
- 🏷️ Smart Tagging & Language Categorization
- 👤 User Authentication & Profiles (NextAuth)
- 💾 PostgreSQL Database (via Prisma ORM)
- 🌐 Multilingual Support (English & Vietnamese)
Layer | Technology |
---|---|
Framework | Next.js 15 (App Router) |
Database | PostgreSQL |
ORM | Prisma |
Auth | NextAuth.js + Appwrite |
UI | Tailwind CSS 4 + Shacdn |
Icons | Lucide React |
Forms | React Hook Form + Zod |
Notifications | Sonner |
Internationalization (i18n) | Custom dictionary system (EN/VI) |
git clone https://github.com/Elvin-dang/code-snippet.git
cd code-snippet
npm install
Copy the example environment file and update it:
cp .env.example .env
Edit .env
and replace placeholder values with your own credentials:
# 🌐 Site Configuration
NEXT_PUBLIC_SITE_URL="http://localhost:3000"
# 🔐 NextAuth Configuration
NEXTAUTH_SECRET="your-secret-key"
# 🗄️ Database (PostgreSQL / Neon)
DATABASE_URL="postgresql://user:password@host:port/dbname?sslmode=require"
# 🧩 Appwrite Configuration
NEXT_PUBLIC_APPWRITE_PROJECT_ID="your-appwrite-project-id"
NEXT_PUBLIC_APPWRITE_PROJECT_NAME="code snippet"
NEXT_PUBLIC_APPWRITE_ENDPOINT="https://your-appwrite-endpoint.io/v1"
Generate Prisma client and apply migrations:
npx prisma migrate dev --name init
If you’re setting up the database for the first time, seed initial data:
npx prisma db seed
npm run dev
Then open your app in the browser:
http://localhost:3000
next
,react
,react-dom
prisma
,@prisma/client
next-auth
,appwrite
tailwindcss
,radix-ui
,lucide-react
react-hook-form
,zod
sonner
,clsx
,nanoid
typescript
,tsx
eslint
,eslint-config-next
@tailwindcss/postcss
@types/react
,@types/node
Built with 💻 by Vinh