A mini social webboard inspired by GitHub + Pantip. Share ideas, ask questions, and engage with the community through posts, comments, and real-time messaging.
Live demo: https://mypost-but-github.vercel.app
- Rich text editor powered by BlockNote for creating formatted posts
- Optional tags to categorize content
- Feed tabs β "For You" (all posts) and "Following" (posts from followed users)
- Like & Star posts to bookmark and show appreciation
- Comments on posts with inline reply support
- Full post view at
/post/[postId]
- Follow / unfollow users to curate your feed
- User profiles with overview and starred posts tabs
- Who to Follow suggestions on the home page
- Real-time direct messaging with conversation list and message threads
- Search users and posts with debounced real-time results
- MongoDB Atlas Search for autocomplete with highlighted matches (falls back to Prisma
containsquery when Atlas is not available)
- Email/password + OAuth (Google, GitHub) via Better Auth
- Dark theme optimized for readability
- Responsive design β works on mobile and desktop
- Keyboard navigation and accessible UI components
| Category | Technologies |
|---|---|
| Framework | Next.js 16 (App Router), React 19 |
| Styling | Tailwind CSS 4, shadcn/ui, Radix UI |
| Auth | Better Auth |
| Database | MongoDB + Prisma 6 |
| State | TanStack Query (server), Zustand (client) |
| Forms | React Hook Form + Zod |
| Editor | BlockNote |
| Testing | Vitest + React Testing Library |
npm installCopy .env.example to .env and fill in your values:
DATABASE_URL="mongodb+srv://..."
BETTER_AUTH_SECRET="..."
BETTER_AUTH_URL="http://localhost:3000"
GOOGLE_CLIENT_ID="..."
GOOGLE_CLIENT_SECRET="..."
GITHUB_CLIENT_ID="..."
GITHUB_CLIENT_SECRET="..."npx prisma db pushnpm run dev| Command | Description |
|---|---|
npm run dev |
Start dev server |
npm run build |
Production build |
npm run start |
Start production server |
npm run lint |
Run Next.js ESLint |
npm run test |
Run Vitest tests |
npx prisma studio |
Open database GUI |
βββ actions/ # Server Actions
βββ app/ # Next.js App Router pages
β βββ (home)/ # Home feed
β βββ (userProfile)/ # User profiles
β βββ post/ # Individual post view
β βββ api/ # API routes (posts, auth, user)
βββ components/ # React components
β βββ ui/ # shadcn/ui primitives
β βββ posts/ # Post rendering
β βββ comments/ # Comment system
β βββ chat/ # Direct messaging
β βββ nav/ # Navigation & search
βββ hooks/ # Custom React hooks
βββ lib/ # Utilities (Prisma, auth, utils)
βββ providers/ # React context providers
βββ store/ # Zustand stores
βββ types/ # TypeScript types + Zod validators
βββ prisma/ # Database schema
Post search uses MongoDB Atlas $search autocomplete when available (index name: default on the Post collection). If not configured, the app falls back to Prisma contains search.
- Go to MongoDB Atlas β your cluster β Search
- Click Create Search Index
- Select database and collection (
Post) - Use JSON editor:
{
"mappings": {
"dynamic": false,
"fields": {
"title": { "type": "autocomplete" },
"body": { "type": "string" }
}
}
}$search: {
text: {
query: "next",
path: ["title", "body"]
},
highlight: {
path: ["title", "body"]
}
}Note: Prisma doesn't natively support
$search, but you can run raw MongoDB commands viaprisma.$runCommandRaw(). See Atlas Search docs for more.
