Demo application containing fullstack solution in pure Golang.
/demo1_fullstack_golang
├── /backend
│ ├── /cmd
│ │ ├── /api
│ │ │ └── main.go # Main entry point for the backend service
│ ├── /internal # Internal packages (business logic, database, etc.)
│ │ ├── /auth
│ │ ├── /db
│ │ └── /services
│ ├── /pkg # Shared reusable libraries
│ ├── /configs # Configuration files
│ ├── /docs # API documentation
│ └── go.mod
│
├── /frontend
│ ├── /assets # Static assets (CSS, images, etc.)
│ ├── /cmd
│ │ └── /ui
│ │ └── main.go # Entry point for WebAssembly-based frontend
│ ├── /templates # HTML templates if using SSR
│ └── go.mod
│
├── /scripts # Automation scripts (e.g., build, deploy)
│ ├── build.sh
├── /docker # Docker configuration for backend and frontend
│ ├── /backend
│ │ └── Dockerfile
│ ├── /frontend
│ │ └── Dockerfile
│ └── docker-compose.yml
└── README.md
- Go SDK 1.23 or higher from https://golang.org/dl/
- Docker from https://docs.docker.com/get-docker/
- Taskfile from https://taskfile.dev
- docker-compose from https://docs.docker.com/compose/install/
-
Clone the repository:
git clone
-
Install dependencies:
go mod download
-
Start the backend service:
go run ./backend/cmd/apiThe backend service will start on
http://localhost:8080.Variable Description Default Value BASE_URL Base URL for downstream services https://vault.immudb.io/ics/api/v1/ledger/default/collection/defaultAPI_KEY API key for authentication your-api-keySKIP_TLS Skip TLS verification (true/false) falseexport BASE_URL="https://vault.immudb.io/ics/api/v1/ledger/default/collection/default" export API_KEY="<replace>" export SKIP_TLS="false"Endpoint Method Description Request Body Response /healthzGET Health check to verify the service is running None 200 OK:"Backend is healthy!"/swagger/GET Access Swagger documentation None Swagger UI /accountsPUT Create a new account json { "id": "string", "name": "string", "email": "string" }200 OK: Account created/accounts/retrievePOST Retrieve accounts with pagination json { "page": 1, "perPage": 100 }200 OK: List of accounts -
Start the frontend service:
go run ./frontend/cmd/uiThe frontend service will start on
http://localhost:3000.
Please use IntelliJ IDEA or any other REST client to test the API endpoints manually.
Code is available in the http-client directory.
-
Use the following developer workflows in
TaskfiletaskExample output:
task: [default] task --list task: Available tasks for this project: * clean: Clean up unused Docker resources * clean-all: Delete all Docker objects including images, containers, volumes, and networks * default: Show available Docker tasks * down: Stop all services with Docker Compose * logs: View logs from Docker Compose services * rebuild: Rebuild and restart services with Docker Compose * up: Start all services with Docker Compose