Skip to content

6sLOGAN78/protask

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Protask Monorepo

Welcome to Protask, a modern, high-performance task management boilerplate built as a monorepo. It features a robust Go backend (Echo) and a slick React SPA (Vite + Tailwind CSS v4) communicating over type-safe HTTP contracts.


🏗️ Repository Architecture

This codebase is managed with Turborepo and package-managed via Bun.

graph TD
    subgraph Apps
        FE["apps/frontend (React)"]
        BE["apps/backend (Go)"]
    end
    subgraph Packages
        OA["packages/openapi (Contracts)"]
        ZD["packages/zod (Schemas)"]
        EM["packages/emails (React Email)"]
    end
    FE -->|API client| OA
    OA -->|Depends on| ZD
    BE -->|Templates| EM
Loading

Main Directories

Directory Type Language/Framework Purpose
apps/backend Service Go (Echo v4) API server, Postgres migrations, Redis task queue, Clerk auth
apps/frontend Client TS (React, Vite, Tailwind v4) Single Page Application dashboard & todo manager
packages/emails Package TypeScript (React Email) Shared transactional email builder & preview tool
packages/openapi Package TypeScript (ts-rest) OpenAPI contract builder linking frontend & backend schemas
packages/zod Package TypeScript (Zod) Shared request/response validation schemas

🛠️ Prerequisites

Before you start, ensure you have the following installed on your machine:

  • Bun: Version ^1.2.13 (Package manager & task execution)
  • Go: Version 1.24+ (For backend)
  • PostgreSQL: Version 16+ (Backend DB)
  • Redis: Version 8+ (Queue storage for Asynq background tasks)
  • Task: For managing backend-specific commands (Taskfile.dev)

🚀 Getting Started

1. Install Dependencies

Run the following at the monorepo root to install node dependencies and build the TypeScript packages:

bun install

2. Set Up Environment Variables

Both applications require environment variables:

  • Backend: Copy the backend sample environment file and adjust configuration:
    cd apps/backend
    cp .env.sample .env
  • Frontend: Configure the local environment for Vite (e.g. Clerk public key):
    cd apps/frontend
    cp .env.local.sample .env.local # Or create one if sample doesn't exist

3. Initialize the Database

Ensure PostgreSQL is running, then run backend migrations using Go Task:

cd apps/backend
task migrations:up

4. Run Development Servers

To run frontend, backend, and all dependent packages simultaneously in development mode, run the following in the root folder:

bun dev

🐳 Running with Docker

You can spin up the entire monorepo stack (PostgreSQL, Redis, Go Backend, and React Frontend) fully containerized with a single command.

Prerequisites

  • Ensure you have the Docker daemon running locally.

Spin up the Containers

To build and launch all services, run the following command at the root of the repository:

VITE_CLERK_PUBLISHABLE_KEY=pk_test_... docker compose up --build

Important

The VITE_CLERK_PUBLISHABLE_KEY environment variable is required by the frontend build stage. Replace it with your actual Clerk Publishable credentials.

Once the services are active:

  • React Frontend: http://localhost:3000
  • Go Backend API: http://localhost:8080
  • Database (PostgreSQL): Port 5432
  • Cache (Redis): Port 6379

The database schema migrations run automatically on backend startup. This runs the Turborepo dev runner, starting both the backend service and the frontend Vite server.


⚙️ Monorepo Scripts

The following commands are available from the root of the repository:

  • bun dev: Runs all applications and package builders in watch mode.
  • bun build: Compiles all packages and builds frontend assets for production.
  • bun lint: Lints frontend and packages.
  • bun lint:fix: Runs ESLint with autorigging across frontend & packages.
  • bun format:check: Checks formatting rules using Prettier.
  • bun format:fix: Automatically formats all Javascript/Typescript files using Prettier.
  • bun typecheck: Runs TypeScript compiler checks on the frontend and packages.
  • bun clean: Clears .turbo caches, compiler build outputs, and node_modules folders.

🔒 Third-Party Integrations

  • Authentication: Clerk is used for secure user sessions.
  • APM & Logging: New Relic is integrated in the Go backend along with Zerolog for JSON structured output.
  • Transactional Email: Resend handles email dispatching.

For detailed instructions, refer to the respective project READMEs:

About

Production-ready task management boilerplate Go (Echo v4) REST API with PostgreSQL, Redis/Asynq queues, Clerk auth & New Relic APM, paired with a React SPA (Vite + Tailwind CSS v4). Type-safe contracts via ts-rest + Zod. Runs locally or fully containerized with Docker Compose.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages