The MrAndreID/GoWeb is a skeleton uses the Go Programming Language (GoLang) with The Echo Framework for The Frontend that renders a Server-Side Rendered (SSR) Website.
- Requirements
- Installation
- Unit Test
- Usage
- Versioning
- Authors
- Contributing
- Official Documentation for Go Language
- License
To use The MrAndreID/GoWeb, you must ensure that you meet the following requirements:
- Go >= 1.27
To use The MrAndreID/GoWeb, you must follow the steps below:
- Clone a Repository
# git clone https://github.com/MrAndreID/goweb.git
- Get Dependancies
# go mod download
# go mod tidy- Create .env file from .env.example (Linux)
# cp .env.example .env- Configuring .env file
To Run Unit Test for The MrAndreID/GoWeb, you must ensure that you meet the following requirements:
- Prepare a stub or mock of the Backend for the repository layer
- Run Unit Test for The
MrAndreID/GoWeb
# go test -v -cover -coverpkg=./internal/feature/... ./internal/feature/... -count=1- Run Unit Test for The
MrAndreID/GoWebwith Coverage Profile
# go test -v -cover -coverpkg=./internal/feature/... -coverprofile=coverage.out ./internal/feature/... -count=1
# go tool cover -func=coverage.outTo use The MrAndreID/GoWeb, you must ensure that you meet the following requirements:
- Directory Structure The
MrAndreID/GoWeb
| Name | Description |
|---|---|
cmd/web |
Entry Point for The Application |
internal/application |
Initialization of Echo Framework, Middleware, Renderer, and Routes. |
internal/application/config |
Configuration from Env File |
internal/entity |
Shared Struct Data (incl. Backend Response Envelope) |
internal/feature/user |
User Feature (SSR Pages under /users) |
internal/feature/user/templates |
HTML Templates for The User Feature |
storage |
Folder for Add Maintenance Flag File |
storage/log |
Folder for Log File |
- Run The
MrAndreID/GoWeb
# go run ./cmd/web- Run The
MrAndreID/GoWebwith Docker
# docker build --no-cache -t goweb:1.0.0 .
# docker run --name goweb --restart=always -d -p 10101:10101 -v /path/to/.env:/app/.env:ro -v /path/to/folder:/app/storage goweb:1.0.0
- Set The
MrAndreID/GoWebto Maintenance Mode in Storage Folder
# touch storage/maintenance.flagI use Semanting Versioning. For the versions available, see the tags on this repository.
- Andrea Adam - MrAndreID
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. Please make sure to update tests as appropriate.
Documentation for Go Language can be found on the Go Package website.
The MrAndreID/GoWeb is released under the MIT License. See the LICENSE file for more information.