The open-source code snippet platform built for modern developers.
Website • Getting Started • Discussions • Discord • Contributing
OPENHAVEN is a free, open-source platform for developers to share, discover, and collaborate on code snippets. Think of it as GitHub Gist meets a social network — built with modern technologies and designed for the way developers work today.
- Share code instantly with syntax highlighting for 50+ languages
- Discover trending snippets from developers around the world
- Build your reputation through upvotes, followers, and contributions
- Real-time collaboration with live notifications and comments
OPENHAVEN is an initiative of Open Dev Society — a community dedicated to building open-source tools for developers.
| Feature | Description | |
|---|---|---|
| 🎨 | Beautiful UI | Glassmorphic design with dark/light themes, smooth animations, and responsive layouts |
| ⚡ | Lightning Fast | Built on Next.js 15 with React 19 and optimized for performance |
| 🔐 | Secure Auth | GitHub OAuth integration with JWT tokens and role-based access control |
| 🔍 | Smart Search | Full-text search with filters for language, tags, author, and date |
| 💬 | Discussions | Threaded comments with nested replies and voting |
| 📊 | Profiles | User profiles with followers, following, reputation, and activity history |
| � | Real-time | Socket.io powered notifications and live feed updates |
| �️ | Moderation | Admin dashboard with content reports and user management |
- Node.js 20+
- PostgreSQL database
- GitHub OAuth app (for authentication)
# Clone the repository
git clone https://github.com/Open-Dev-Society/openhaven.git
cd openhaven
# Install dependencies
npm install
# Set up environment variables
cp apps/web/.env.example apps/web/.env
cp packages/api/.env.example packages/api/.env
# Initialize the database
cd packages/api && npx prisma db push && cd ..
# Start development servers
npm run devThe frontend will be available at http://localhost:3000 and the API at http://localhost:3002.
Frontend (apps/web/.env)
NEXT_PUBLIC_API_URL=http://localhost:3002/api/v1
NEXT_PUBLIC_SOCKET_URL=http://localhost:3002
SERVER_API_URL=http://localhost:3002/api/v1
NEXT_PUBLIC_GITHUB_CLIENT_ID=your_github_client_idBackend (packages/api/.env)
DATABASE_URL=postgresql://user:password@localhost:5432/openhaven
REDIS_URL=redis://localhost:6379
JWT_SECRET=your-secret-key
GITHUB_CLIENT_ID=your_github_client_id
GITHUB_CLIENT_SECRET=your_github_client_secret
FRONTEND_URL=http://localhost:3000OPENHAVEN is structured as a Turborepo monorepo for optimal developer experience and build performance.
openhaven/
├── apps/
│ └── web/ # Next.js 15 frontend
│ ├── app/ # App Router pages
│ ├── components/ # React components
│ └── lib/ # Utilities
│
├── packages/
│ └── api/ # Hono.js backend
│ ├── src/
│ │ ├── routes/ # API endpoints
│ │ ├── services/ # Business logic
│ │ └── middleware/ # Auth, rate limiting
│ └── prisma/ # Database schema
│
└── turbo.json # Turborepo config
| Layer | Technology |
|---|---|
| Frontend | Next.js 15, React 19, TypeScript, TailwindCSS 4 |
| Backend | Hono.js, Socket.io, Prisma ORM |
| Database | PostgreSQL, Redis (caching) |
| Auth | GitHub OAuth, JWT |
| Deployment | Vercel (frontend), Railway (backend) |
| Build | Turborepo, Bun |
- Import the repository to Vercel
- Set the root directory to
apps/web - Configure environment variables
- Deploy
- Create a new project on Railway
- Add PostgreSQL and Redis services
- Deploy from the
packages/apidirectory - Configure environment variables
Authentication
| Method | Endpoint | Description |
|---|---|---|
POST |
/auth/signup |
Create account |
POST |
/auth/login |
Sign in |
GET |
/auth/github |
GitHub OAuth |
GET |
/auth/me |
Current user |
Snippets
| Method | Endpoint | Description |
|---|---|---|
GET |
/snippets |
List snippets |
POST |
/snippets |
Create snippet |
GET |
/snippets/:id |
Get snippet |
PUT |
/snippets/:id |
Update snippet |
DELETE |
/snippets/:id |
Delete snippet |
POST |
/snippets/:id/upvote |
Upvote |
POST |
/snippets/:id/downvote |
Downvote |
Users
| Method | Endpoint | Description |
|---|---|---|
GET |
/users/:username |
Get profile |
PUT |
/users/:username |
Update profile |
POST |
/users/:username/follow |
Follow user |
DELETE |
/users/:username/follow |
Unfollow |
We welcome contributions of all kinds! Whether you're fixing bugs, adding features, or improving documentation — your help is appreciated.
- Fork the repository
- Create a branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Please read our Contributing Guidelines before submitting a PR.
# Run tests
npm run test
# Lint code
npm run lint
# Type check
npm run type-check
# Build all packages
npm run build- Discord: Join our community
- Twitter/X: @opendevsociety
- GitHub Discussions: Ask questions & share ideas
OPENHAVEN is open-source software licensed under the GNU Affero General Public License v3.0 (AGPL-3.0).