PitchHut logo
demo1_fullstack_golang
This project has been added for preview purposes on behalf of the original creator and is available for a limited time. Ownership will be transferred to the creator upon claiming.
A complete fullstack application built purely with Golang.
Pitch

This project showcases a fullstack solution built entirely in Golang, featuring both backend and frontend components. It includes sample code and a structured framework for building scalable applications. Ideal for developers looking to explore fullstack development in Go, this demo offers a clear example of how to integrate backend APIs with a WebAssembly-based frontend.

Description

Overview

demo1_fullstack_golang is a comprehensive demo application showcasing a full-stack solution implemented entirely in Golang. This project serves as an excellent reference for developers seeking to leverage Golang for both backend and frontend development, utilizing modern practices and tools.

Project Structure

The repository is organized into distinct directories for the backend and frontend components:

/demo1_fullstack_golang
├── /backend                  # Backend service implementation
│   ├── /cmd                  # Command-line applications
│   │   ├── /api              # Entry point for the backend service
│   │   │   └── main.go        # Main Go file
│   ├── /internal              # Internal logic, including authentication and database interaction
│   │   ├── /auth             # Authentication logic
│   │   ├── /db               # Database packages
│   │   └── /services         # Business logic
│   ├── /pkg                  # Shared libraries
│   ├── /configs              # Configuration files
│   ├── /docs                 # API documentation
│   └── go.mod                # Go module definition
├── /frontend                 # Frontend service implementation
│   ├── /assets               # Static assets (CSS, images, etc.)
│   ├── /cmd                  # Command-line applications
│   │   └── /ui               # Entry point for WebAssembly-based frontend
│   ├── /templates            # HTML templates for server-side rendering
│   └── go.mod                # Go module definition
├── /scripts                  # Automation scripts for build and deployment
│   ├── build.sh              # Build script
├── /docker                   # Docker configurations
│   ├── /backend              # Dockerfile for backend
│   ├── /frontend             # Dockerfile for frontend
│   └── docker-compose.yml    # Docker Compose configuration
└── README.md                 # Project documentation

Backend Main Features

  • Health Check Endpoint: Verify that the service is operational with a simple GET request to /healthz, which returns a status message.
  • Swagger Documentation: Access API specifications via the /swagger/ endpoint.
  • Account Management: Interact with account data through endpoints like /accounts for account creation (via PUT) and /accounts/retrieve for pagination of account listings (via POST).

Frontend Overview

The frontend service, built using WebAssembly, aims to provide a responsive user interface for seamless interactions with the backend API. Users can access the application via http://localhost:3000 once the frontend service is up.

Development Workflow

To streamline the development process, the project includes a Taskfile to manage common tasks easily. Use the following command to see available tasks:

task

Additional Resources

The project is equipped with automation scripts, Docker configurations, and comprehensive documentation to ensure a smooth development experience. For manual testing of the API endpoints, tools such as IntelliJ IDEA or any REST client are recommended, with documentation available in the backend/docs/http-client directory.

This demo serves as an invaluable resource for learning how to implement a full-stack application in Golang, embracing best practices from both backend development and modern frontend frameworks.

0 comments

No comments yet.

Sign in to be the first to comment.