Skip to content

About

One place for developers to learn, build, and grow together. A community-driven platform built with modern technologies to help developers become 10x better.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

10xcoder.club

Bun Turborepo Next.js Hono TypeScript

One place for developers to learn, build, and grow together.

A community-driven platform built with modern technologies to help developers become 10x better.

Getting Started β€’ Project Structure β€’ Contributing β€’ Development


✨ Features

  • πŸš€ Turborepo - High-performance monorepo build system with intelligent caching
  • ⚑ Bun - Fast JavaScript runtime and package manager
  • 🌐 Next.js 16 - React framework for the web frontend
  • πŸ”₯ Hono - High-performance TypeScript backend framework
  • πŸ“¦ Shared Packages - Reusable schemas, UI components, and configurations
  • 🎨 Shadcn/UI - Beautiful, accessible component library
  • πŸ”’ Type-Safe - End-to-end TypeScript with shared Zod schemas
  • πŸ“ Code Quality - ESLint, Prettier, Husky, and Commitlint

πŸ“ Project Structure

10xcoder.club/
β”œβ”€β”€ apps/
β”‚   β”œβ”€β”€ web/                 # Next.js frontend application
β”‚   β”‚   β”œβ”€β”€ app/             # App router pages
β”‚   β”‚   β”œβ”€β”€ components/      # App-specific components
β”‚   β”‚   β”œβ”€β”€ env/             # Environment configuration
β”‚   β”‚   └── lib/             # Utility functions
β”‚   β”‚
β”‚   β”œβ”€β”€ server/              # Hono backend API (main)
β”‚   β”‚   └── src/
β”‚   β”‚       β”œβ”€β”€ config/      # Environment & app configuration
β”‚   β”‚       β”œβ”€β”€ db/          # Database utilities (Drizzle ORM)
β”‚   β”‚       └── routes/      # API routes
β”‚
β”œβ”€β”€ packages/
β”‚   β”œβ”€β”€ schemas/             # Shared Zod schemas & TypeScript types
β”‚   β”œβ”€β”€ ui/                  # Shared UI components (Shadcn/UI)
β”‚   β”œβ”€β”€ eslint-config/       # Shared ESLint configuration
β”‚   └── typescript-config/   # Shared TypeScript configuration
β”‚
β”œβ”€β”€ scripts/                 # Utility scripts
β”‚   β”œβ”€β”€ ui-add.sh            # Add shadcn/ui components
β”‚   └── ui-diff.sh           # Diff shadcn/ui components
β”‚
β”œβ”€β”€ turbo.json               # Turborepo configuration
└── package.json             # Root package configuration

πŸš€ Getting Started

Prerequisites

  • Bun v1.2+ - Install with:
    curl -fsSL https://bun.sh/install | bash
  • PostgreSQL - For the API database
  • Git - Version control

Installation

  1. Clone the repository

    git clone https://github.com/techysiddhant/10xcoder.club.git
    cd 10xcoder.club
  2. Install dependencies

    bun install
  3. Set up environment variables

    Copy the example environment files and configure them:

    # Server API environment (Hono)
    cp apps/server/.env.example apps/server/.env
    
    # Web environment
    cp apps/web/.env.example apps/web/.env.local

    Edit the files with your configuration (see Environment Variables section).

  4. Set up the database

    The server requires Postgres + Redis. The easiest way to run them locally is:

    bun --cwd apps/server run dev:services

    This starts Postgres (on localhost:5433) and Redis (on localhost:6379) using apps/server/docker-compose.dev.yml.

  5. Start development servers

    bun run dev
  6. Open in browser


πŸ” Environment Variables

Server API (apps/server/.env)

Variable Required Default Description
NODE_ENV No development Environment mode: development, test, production
PORT No 8000 API server port
LOG_LEVEL No info Logging level: debug, info, warn, error
CORS_ORIGIN No - Comma-separated allowed origins (permissive in dev if unset)
POSTGRES_USER Yes - PostgreSQL username
POSTGRES_PASSWORD Yes - PostgreSQL password
POSTGRES_DB Yes - PostgreSQL database name
POSTGRES_HOST Yes - PostgreSQL host
POSTGRES_PORT No 5432 PostgreSQL port

Web (apps/web/.env.local)

Variable Required Default Description
NEXT_PUBLIC_API_URL No http://localhost:8000 Backend API URL

Notes:

  • The web app uses cookie-based auth and sends credentials (withCredentials: true), so CORS_ORIGIN on the server must include the web origin (e.g. http://localhost:3000).

πŸ’» Development

Available Scripts

Run from the repository root:

Command Description
bun run dev Start web + server in development mode
bun run build Build all apps and packages
bun run lint Lint all apps and packages
bun run typecheck Run TypeScript type checking
bun run format Format code with Prettier
bun run format:check Check code formatting
bun run clean Clean all build outputs
bun run ui:add <component> Add shadcn/ui component to packages/ui
bun run ui:diff Check for shadcn/ui updates

Adding UI Components

Use the helper script to add shadcn/ui components to the shared UI package:

# Add a single component
bun run ui:add button

# Add multiple components
bun run ui:add button dialog sheet avatar

Shared Schemas

Edit schemas in packages/schemas/src/index.ts. These Zod schemas are used by both the frontend and backend for:

  • API request/response validation
  • Form validation
  • TypeScript type inference
// Example usage in apps
import { z, UserSchema } from "@workspace/schemas";

// Get inferred type
type User = z.infer<typeof UserSchema>;

🀝 Contributing

We welcome contributions from the community! Here's how you can help:

Development Workflow

  1. Fork the repository

    Click the "Fork" button on GitHub to create your own copy.

  2. Clone your fork

    git clone https://github.com/YOUR_USERNAME/10xcoder.club.git
    cd 10xcoder.club
  3. Add upstream remote

    git remote add upstream https://github.com/techysiddhant/10xcoder.club.git
  4. Create a feature branch

    git checkout -b feature/your-feature-name
    # or
    git checkout -b fix/your-bug-fix
  5. Make your changes

    • Write clean, documented code
    • Follow the existing code style
    • Add tests if applicable
  6. Commit your changes

    We use Conventional Commits. Your commit messages should follow this format:

    <type>(<scope>): <description>
    
    [optional body]
    
    [optional footer(s)]
    

    Types:

    • feat: New feature
    • fix: Bug fix
    • docs: Documentation changes
    • style: Code style changes (formatting, etc.)
    • refactor: Code refactoring
    • perf: Performance improvements
    • test: Adding or updating tests
    • chore: Maintenance tasks
    • ci: CI/CD changes

    Examples:

    git commit -m "feat(api): add user authentication endpoint"
    git commit -m "fix(web): resolve hydration mismatch in header"
    git commit -m "docs: update README with contribution guidelines"
  7. Keep your branch updated

    git fetch upstream
    git rebase upstream/main
  8. Push your changes

    git push origin feature/your-feature-name
  9. Open a Pull Request

    • Go to the original repository on GitHub
    • Click "New Pull Request"
    • Select your fork and branch
    • Fill in the PR template with details about your changes

Code Quality Guidelines

  • TypeScript: All code must be written in TypeScript with proper types
  • Linting: Run bun run lint before committing
  • Formatting: Run bun run format to format code with Prettier
  • Type Checking: Run bun run typecheck to ensure no type errors
  • Commit Hooks: Husky will automatically run lint-staged and commitlint on commits

Pull Request Guidelines

  • βœ… Title should follow conventional commit format
  • βœ… Include a clear description of changes
  • βœ… Reference any related issues (e.g., "Fixes #123")
  • βœ… Ensure all CI checks pass
  • βœ… Request review from maintainers
  • βœ… Respond to feedback promptly

Reporting Issues

Found a bug or have a feature request?

  1. Check existing issues first
  2. Open a new issue with:
    • Clear, descriptive title
    • Steps to reproduce (for bugs)
    • Expected vs actual behavior (for bugs)
    • Use case and benefits (for features)
    • Screenshots if applicable

🐳 Docker

Building the API

Build the Docker image from the repository root:

docker build -f apps/server/Dockerfile -t 10xcoder-server:latest .

Running the Container

docker run --rm -p 8000:8000 \
  -e PORT=8000 \
  -e CORS_ORIGIN=http://localhost:3000 \
  -e POSTGRES_USER=your_user \
  -e POSTGRES_PASSWORD=your_password \
  -e POSTGRES_DB=your_database \
  -e POSTGRES_HOST=host.docker.internal \
  -e POSTGRES_PORT=5432 \
  10xcoder-server:latest

Production Build (Non-Docker)

For non-Docker production deployments:

bun --cwd apps/server run build
bun --cwd apps/server run start

🌐 Deployment

Frontend (Vercel)

In your Vercel project settings:

Setting Value
Root Directory apps/web
Install Command bun install
Build Command bun run build
Output Directory .next

Environment Variables:

  • NEXT_PUBLIC_API_URL β†’ Your deployed API URL

Backend (Docker/EC2)

  1. Build the Docker image
  2. Push to a container registry (ECR, Docker Hub, etc.)
  3. Deploy to your server (EC2, DigitalOcean, etc.)
  4. Configure reverse proxy (Nginx) for SSL

πŸ“„ License

This project is open source. See the LICENSE file for details.


πŸ™ Acknowledgments


Built with ❀️ by the 10xcoder.club community

About

One place for developers to learn, build, and grow together. A community-driven platform built with modern technologies to help developers become 10x better.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages