{"id":24472744,"url":"https://github.com/neofox/regotth","last_synced_at":"2026-04-02T18:52:50.879Z","repository":{"id":272219017,"uuid":"914262192","full_name":"Neofox/regotth","owner":"Neofox","description":"Web development full stack architecture with Go + HTMX + Templ + ReactJS + TailwindCSS.","archived":false,"fork":false,"pushed_at":"2025-01-16T08:29:09.000Z","size":173,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-04T05:05:04.464Z","etag":null,"topics":["golang","htmx","react","tailwindcss","templ"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Neofox.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-09T09:00:30.000Z","updated_at":"2025-01-16T08:29:10.000Z","dependencies_parsed_at":"2025-03-14T14:41:19.120Z","dependency_job_id":"6d6ca623-0f57-43b4-80c4-395d7b8e4558","html_url":"https://github.com/Neofox/regotth","commit_stats":null,"previous_names":["neofox/go-todo","neofox/regotth"],"tags_count":0,"template":true,"template_full_name":null,"purl":"pkg:github/Neofox/regotth","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Neofox%2Fregotth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Neofox%2Fregotth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Neofox%2Fregotth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Neofox%2Fregotth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Neofox","download_url":"https://codeload.github.com/Neofox/regotth/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Neofox%2Fregotth/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262891400,"owners_count":23380616,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["golang","htmx","react","tailwindcss","templ"],"created_at":"2025-01-21T08:13:23.054Z","updated_at":"2025-12-30T22:20:17.497Z","avatar_url":"https://github.com/Neofox.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# The REGoTTH Stack\n\nA modern web application stack for the fullstack dev that wants something different from the usual stack.\nREGoTTH stands for **Re**act, **Go**, **T**ailwind, **T**empl, and **H**TMX.\n\nThis project serves as a reference implementation demonstrating how to effectively integrate these technologies in a clean and opinionated way.\n\n## 📑 Table of Contents\n\n- [🛠 Tech Stack](#-tech-stack)\n- [📁 Project Structure](#-project-structure)\n- [🏗 Architecture](#-architecture)\n- [🚀 Getting Started](#-getting-started)\n  - [Prerequisites](#prerequisites)\n  - [Installation](#installation)\n  - [Development](#development)\n- [🎯 React Components Integration](#-react-components-integration)\n  - [Adding New React Components](#adding-new-react-components)\n- [🧪 Testing](#-testing)\n- [🔧 Available Make Commands](#-available-make-commands)\n  - [Development Commands](#development-commands)\n  - [Setup Commands](#setup-commands)\n- [🔍 Troubleshooting](#-troubleshooting)\n  - [Common Issues](#common-issues)\n  - [Still Having Issues?](#still-having-issues)\n- [📝 License](#-license)\n\n## 🛠 Tech Stack\n\n- **Go** - Backend server and business logic\n- **HTMX** - Frontend interactivity without JavaScript\n- **Templ** - Type-safe HTML templating\n- **TailwindCSS** - Utility-first CSS framework\n- **React** - Component-based UI library\n- **Bun** - JavaScript runtime and package manager\n\n## 📁 Project Structure\n\n```bash\n.\n├── internal/\n│ ├── entity/ # Business entities/models\n│ ├── repository/ # Data access layer\n│ ├── service/ # Business logic layer\n│ ├── server/ # HTTP server configuration\n│ └── middleware/ # HTTP middleware\n├── web/\n│ ├── component/ # Reusable UI components\n│ ├── view/ # Page templates\n│ └── controller/ # HTTP request handlers\n├── static/\n│ ├── css/ # TailwindCSS files\n│ ├── js/ # TypeScript \u0026 React components\n│ └── build/ # Compiled assets\n└── main.go # Application entry point\n```\n\n## 🏗 Architecture\n\nThe project follows a clean architecture pattern:\n\n1. **Entity Layer** (`internal/entity/`) - Contains business models\n2. **Repository Layer** (`internal/repository/`) - Handles data persistence\n3. **Service Layer** (`internal/service/`) - Implements business logic\n4. **Controller Layer** (`web/controller/`) - Handles HTTP requests\n5. **View Layer** (`web/views/` \u0026 `web/components/`) - Manages UI templates\n6. **React Components** (`static/js/components/`) - Client-side interactive components\n\n## 🚀 Getting Started\n\n### Prerequisites\n\n- Go 1.23.4 or higher\n- Make (for running commands)\n- Air (for live reload) - `go install github.com/air-verse/air@latest`\n- Templ (for generating templates) - `go install github.com/a-h/templ/cmd/templ@latest`\n- Bun (for running the JavaScript/React components) - `brew install bun`\n- jq (optional: used for renaming the module) - `brew install jq`\n\n### Installation\n\n1. Clone the repository\n\n    ```bash\n    git clone https://github.com/Neofox/regotth.git my-project\n    cd my-project\n    make rename-module NEW_NAME=github.com/username/my-project\n    rm -rf .git\n    git init\n    ```\n\n2. Install dependencies\n\n```bash\ngo mod download\nbun install\n```\n\nTo see all available commands:\n\n```bash\nmake help\n```\n\n### Development\n\nFor development with live reload:\n\n```bash\nmake live\n```\n\nThis will start:\n\n- Go server with hot reload\n- Templ template generation with hot reload\n- TailwindCSS compilation\n- React components compilation with hot reload\n\n\u003e 💡 **Note:** Always use the proxy URL (http://localhost:7331) during development to ensure all live-reload features work correctly.\n\n### Building for Production\n\n```bash\nmake build\n```\n\nThis will build the project for production and output the binary to the `tmp` directory.\n\n## 🎯 React Components Integration\n\n### Adding New React Components\n\n1. Create your component in `static/js/components/`:\n\n    ```tsx\n    // As we also use preact/compat we can use the normal react syntax\n    // /!\\ React has to be imported even if we don't use it!\n    import React, { useState, type ReactNode } from \"react\";\n\n    export function MyComponent(): ReactNode {\n        const [count, setCount] = useState(0);\n        return \u003cdiv\u003eMy Component {count}\u003c/div\u003e;\n    }\n    ```\n\n2. Use it in your Templ templates:\n\n    ```html\n    \u003cdiv data-react-component=\"MyComponent\" /\u003e\n    ```\n\nThe component will be automatically loaded when it appears in the DOM.\n\n### Type Generation\n\nThe project automatically generates Go types from React component props, ensuring type safety between React components and Templ templates. When you create or modify a React component with props:\n\n1. Define your props interface in your React component:\n\n    ```tsx\n    export interface MyComponentProps {\n        prop1: string;\n        prop2?: number;\n    }\n    ```\n\n2. The types will be automatically generated when:\n\n    - Running `make build`\n    - During development with `make live`\n    - Manually with `bun run generate-props`\n  The generated types will be available in `web/generated/react_component_props.go`\n\n3. Use the generated types in your Templ templates:\n\n    ```html\n    \u003cdiv \n      data-react-component=\"Button\" \n      data-react-props={ props.ButtonProps{\n          Id: \"123\",\n          Label: \"Click me\",\n      }.String() }\n    /\u003e\n    ```\n\n## 🧪 Testing\n\n### Running Tests\n\n```bash\ngo test ./...\n```\n\n## 🔧 Available Make Commands\n\nRun `make help` to see all available commands. Here are the main ones:\n\n### Development Commands\n\n- `make live` - Start development server with live reload\n- `make build` - Build the project for production\n\n### Setup Commands\n\n- `make rename-module NEW_NAME=your-module-name` - Rename the Go module and package name\n\n## 🔍 Troubleshooting\n\n### Common Issues\n\n#### Module rename issues\n\n1. If `make rename-module` fails:\n\n   ```bash\n   # Clean up any partial changes\n   git checkout go.mod\n   git checkout package.json\n   # Ensure jq is installed\n   brew install jq\n   # Try again with the full path\n   make rename-module NEW_NAME=github.com/username/project-name\n   ```\n\n#### Build errors\n\n1. \"templ command not found\":\n\n   ```bash\n   go install github.com/a-h/templ/cmd/templ@latest\n   export PATH=$PATH:$(go env GOPATH)/bin\n   ```\n\n2. \"bun command not found\":\n\n   ```bash\n   curl -fsSL https://bun.sh/install | bash\n   source ~/.bashrc  # or source ~/.zshrc\n   ```\n\n3. Missing dependencies:\n\n   ```bash\n   # Reset Go modules\n   rm -rf go.sum\n   go mod tidy\n   \n   # Reset npm modules\n   rm -rf node_modules\n   bun install\n   ```\n\n### Still Having Issues?\n\n1. Verify all prerequisites are installed:\n\n   ```bash\n   go version      # Should be 1.23.4 or higher\n   templ version\n   bun --version\n   ```\n\n2. Clean and rebuild:\n\n   ```bash\n   # Full cleanup\n   rm -rf tmp/ node_modules/ static/build/*\n   \n   # Fresh install\n   go mod download\n   bun install\n   make build\n   ```\n\n## 📝 License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneofox%2Fregotth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fneofox%2Fregotth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneofox%2Fregotth/lists"}