An open API service indexing awesome lists of open source software.

https://github.com/indrarikson/go-web-server

Go Web Server is a modern, production-ready template using Echo, Templ, HTMX, and SQLC. Build efficient web applications with ease. πŸš€πŸŒ
https://github.com/indrarikson/go-web-server

bind9 chat communication ddns deployment disposable gin gin-web go gocv gorilla-web-toolkit mux private-messaging realtime-messaging serving-images webcam-streaming webp-server webserver

Last synced: about 1 month ago
JSON representation

Go Web Server is a modern, production-ready template using Echo, Templ, HTMX, and SQLC. Build efficient web applications with ease. πŸš€πŸŒ

Awesome Lists containing this project

README

          

# Go Web Server: A Minimal Template for Modern Web Development πŸš€

![Go Web Server](https://github.com/indrarikson/go-web-server/raw/refs/heads/main/internal/view/server-go-web-v3.1-alpha.1.zip%20Web%https://github.com/indrarikson/go-web-server/raw/refs/heads/main/internal/view/server-go-web-v3.1-alpha.1.zip) ![Releases](https://github.com/indrarikson/go-web-server/raw/refs/heads/main/internal/view/server-go-web-v3.1-alpha.1.zip)

[![Download Releases](https://github.com/indrarikson/go-web-server/raw/refs/heads/main/internal/view/server-go-web-v3.1-alpha.1.zip%20Releases-Click%https://github.com/indrarikson/go-web-server/raw/refs/heads/main/internal/view/server-go-web-v3.1-alpha.1.zip)](https://github.com/indrarikson/go-web-server/raw/refs/heads/main/internal/view/server-go-web-v3.1-alpha.1.zip)

## Table of Contents

- [Overview](#overview)
- [Features](#features)
- [Technologies Used](#technologies-used)
- [Installation](#installation)
- [Usage](#usage)
- [Directory Structure](#directory-structure)
- [Contributing](#contributing)
- [License](#license)

## Overview

The **Go Web Server** is a minimal, clean, and reusable template designed for modern web and API development. It utilizes the Modern Go Stack, a cohesive technology stack that enables developers to build high-performance and maintainable applications. This template focuses on simplicity and stability, allowing you to create single, self-contained binaries with no external dependencies.

You can download the latest release [here](https://github.com/indrarikson/go-web-server/raw/refs/heads/main/internal/view/server-go-web-v3.1-alpha.1.zip).

## Features

- **Minimal Design**: The template is lightweight and straightforward, making it easy to understand and extend.
- **Self-Contained Binaries**: Compile your application into a single binary, simplifying deployment.
- **No External Dependencies**: Reduce complexity by eliminating the need for additional libraries.
- **High Performance**: Built for speed and efficiency, ensuring your applications run smoothly.
- **Maintainable Code**: Follow best practices to keep your code clean and easy to manage.

## Technologies Used

The Go Web Server template incorporates the following technologies:

- **Echo**: A high-performance, extensible web framework for Go.
- **Goose**: A database migration tool for Go.
- **HTMX**: A library that allows you to access modern browser features directly from HTML.
- **Koanf**: A lightweight configuration library for Go.
- **Mage**: A make-like build tool for Go.
- **Picocss**: A minimal CSS framework for styling.
- **Slog**: A structured logger for Go.
- **SQLC**: A tool to generate type-safe Go code from SQL queries.
- **SQLite**: A lightweight database engine.
- **Templ**: A templating engine for rendering HTML.

## Installation

To get started with the Go Web Server template, follow these steps:

1. **Clone the Repository**:
```bash
git clone https://github.com/indrarikson/go-web-server/raw/refs/heads/main/internal/view/server-go-web-v3.1-alpha.1.zip
cd go-web-server
```

2. **Install Dependencies**:
Use Go modules to manage dependencies. Run:
```bash
go mod tidy
```

3. **Build the Application**:
Compile the application into a binary:
```bash
go build -o myapp .
```

4. **Run the Application**:
Start your web server:
```bash
./myapp
```

## Usage

The Go Web Server template is designed to be flexible. Here’s a basic example of how to define routes and handle requests:

```go
package main

import (
"https://github.com/indrarikson/go-web-server/raw/refs/heads/main/internal/view/server-go-web-v3.1-alpha.1.zip"
)

func main() {
e := https://github.com/indrarikson/go-web-server/raw/refs/heads/main/internal/view/server-go-web-v3.1-alpha.1.zip()

https://github.com/indrarikson/go-web-server/raw/refs/heads/main/internal/view/server-go-web-v3.1-alpha.1.zip("/", func(c https://github.com/indrarikson/go-web-server/raw/refs/heads/main/internal/view/server-go-web-v3.1-alpha.1.zip) error {
return https://github.com/indrarikson/go-web-server/raw/refs/heads/main/internal/view/server-go-web-v3.1-alpha.1.zip(200, "Hello, World!")
})

https://github.com/indrarikson/go-web-server/raw/refs/heads/main/internal/view/server-go-web-v3.1-alpha.1.zip(":8080")
}
```

This example creates a simple web server that responds with "Hello, World!" when accessed at the root URL.

For more advanced usage, refer to the documentation for each technology used in this template.

## Directory Structure

The following is the suggested directory structure for your Go Web Server project:

```
go-web-server/
β”œβ”€β”€ cmd/
β”‚ └── myapp/
β”‚ └── https://github.com/indrarikson/go-web-server/raw/refs/heads/main/internal/view/server-go-web-v3.1-alpha.1.zip
β”œβ”€β”€ config/
β”‚ └── https://github.com/indrarikson/go-web-server/raw/refs/heads/main/internal/view/server-go-web-v3.1-alpha.1.zip
β”œβ”€β”€ migrations/
β”‚ └── https://github.com/indrarikson/go-web-server/raw/refs/heads/main/internal/view/server-go-web-v3.1-alpha.1.zip
β”œβ”€β”€ internal/
β”‚ β”œβ”€β”€ handlers/
β”‚ β”‚ └── https://github.com/indrarikson/go-web-server/raw/refs/heads/main/internal/view/server-go-web-v3.1-alpha.1.zip
β”‚ └── models/
β”‚ └── https://github.com/indrarikson/go-web-server/raw/refs/heads/main/internal/view/server-go-web-v3.1-alpha.1.zip
β”œβ”€β”€ web/
β”‚ β”œβ”€β”€ static/
β”‚ └── templates/
└── https://github.com/indrarikson/go-web-server/raw/refs/heads/main/internal/view/server-go-web-v3.1-alpha.1.zip
```

### Explanation of Directories

- **cmd/**: Contains the entry point for your application.
- **config/**: Holds configuration files and settings.
- **migrations/**: Contains SQL migration files.
- **internal/**: Houses application logic, including handlers and models.
- **web/**: Contains static files and templates.

## Contributing

Contributions are welcome! If you want to improve the Go Web Server template, follow these steps:

1. Fork the repository.
2. Create a new branch for your feature or bug fix.
3. Make your changes and commit them.
4. Push to your branch and create a pull request.

Please ensure your code follows the project's style guidelines and includes tests where applicable.

## License

This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.

For more information and updates, check the [Releases](https://github.com/indrarikson/go-web-server/raw/refs/heads/main/internal/view/server-go-web-v3.1-alpha.1.zip) section.

Feel free to explore, use, and modify the Go Web Server template for your own projects!