{"id":20763994,"url":"https://github.com/umutsevdi/go-ssr-template","last_synced_at":"2025-03-11T18:05:53.406Z","repository":{"id":183312562,"uuid":"669921553","full_name":"umutsevdi/go-ssr-template","owner":"umutsevdi","description":"A template for a web server that features server side rendering and API capabilities using go's built-in html template engine.","archived":false,"fork":false,"pushed_at":"2023-07-24T00:07:27.000Z","size":23,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-18T05:48:09.501Z","etag":null,"topics":["go","go-html-template","go-template","golang","html","server","template","webserver"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/umutsevdi.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}},"created_at":"2023-07-23T21:31:32.000Z","updated_at":"2024-06-30T17:49:55.000Z","dependencies_parsed_at":"2023-07-23T22:41:50.404Z","dependency_job_id":null,"html_url":"https://github.com/umutsevdi/go-ssr-template","commit_stats":null,"previous_names":["umutsevdi/go-fullstack-ssr"],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umutsevdi%2Fgo-ssr-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umutsevdi%2Fgo-ssr-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umutsevdi%2Fgo-ssr-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umutsevdi%2Fgo-ssr-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/umutsevdi","download_url":"https://codeload.github.com/umutsevdi/go-ssr-template/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243086236,"owners_count":20234004,"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":["go","go-html-template","go-template","golang","html","server","template","webserver"],"created_at":"2024-11-17T10:48:16.692Z","updated_at":"2025-03-11T18:05:53.376Z","avatar_url":"https://github.com/umutsevdi.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Go Fullstack SSR Template\nA template for a web server that features server side rendering and API capabilities\nusing go's built-in html template engine.\n\n## Features\n- [x] Compile time page generation\n- [x] Page indexing\n- [x] Caching\n- [x] Optional periodic cache updating\n- [x] Runtime sitemap.xml generation\n- [ ] Easier API routing.\n- [ ] A cache mechanism to store pages with special variables. Currently\ncaching only stores pages that are compiled from components.\n\n## Project Structure\nProject structure is displayed below. After compiling you can deploy your\napplication binary with `content` directory and `config.json`.\n\n```sh\n.\n├── app\n│   ├── api\n│   │   ├── router.go\n│   │   └── /* Your API code goes here */\n│   ├── go.mod\n│   ├── go.sum\n│   ├── main.go\n│   ├── pages\n│   │   ├── router.go\n│   │   └── /* Your page rendering code goes here */\n│   └── util\n│       ├── config.go\n│       └── index.go\n├── config.json\n├── content\n│   ├── components\n│   ├── pages\n│   └── static\n│       ├── css\n│       ├── img\n│       ├── js\n│       ├── other\n│       └── robots.txt /* Should be here */\n└── Makefile\n```\n- **api**: Files in this directory are for responding requests from clients\nafter the page is loaded.\n- **pages**: This directory is for inserting custom variables to the pages\nsuch as personal data to render the final form of pages.\nIf a page is static or ready after initial compilation from the template engine\nadditional code is not required.\n- **util**: This directory is for the library. Includes configuration files\nparsing and caching.\n- **config.json**: Configuration file for the server.\n\n## Configuration\nConfiguration is handled using `config.json` file that is under the same directory\nwith the binary.\n```json\n{\n    \"url\": \"string\", /* default: localhost */\n    \"port\": 80,      /* default: 8080 */\n    \"page\": {\n        \"enabled\": true,\n        \"ttl\": -1\n    },\n    \"memory\": {\n        \"enabled\": true,\n        \"ttl\": -1\n    },\n    \"content\": \"string\" /* default: content */\n}\n```\n- **url**: The URL of the page, will be used to generate `sitemap.xml`.\n- **port**: Port(default:8080)\n- **page**: How often pages generated from components should be refreshed.\nSetting it to false will stop periodic indexing, and only generate once.\n(default: {false, 0})\n- **memory**: Whether specific final pages should be cached, if so how often\nthey should be cached. (default: {false, 0})\n\n`WARNING:` *This feature is not implemented yet.*\n- **content**: Path to the content. If it's null, the program expects `content`\nin the same directory.\n\nContent directory must be laid out like this:\n```\n└── content\n    ├── components\n    ├── pages\n    └── static\n```\n\n# Building\n```sh\nmake\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fumutsevdi%2Fgo-ssr-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fumutsevdi%2Fgo-ssr-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fumutsevdi%2Fgo-ssr-template/lists"}