Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nwrenger/htmx-gorm-gin
RESTful API, HTMX and a SQLite database infrastructure
https://github.com/nwrenger/htmx-gorm-gin
golang htmx restful-api sqlite tmpl
Last synced: about 1 month ago
JSON representation
RESTful API, HTMX and a SQLite database infrastructure
- Host: GitHub
- URL: https://github.com/nwrenger/htmx-gorm-gin
- Owner: nwrenger
- License: mit
- Created: 2023-08-21T19:49:19.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-07-01T19:31:27.000Z (6 months ago)
- Last Synced: 2024-11-24T20:39:45.878Z (about 2 months ago)
- Topics: golang, htmx, restful-api, sqlite, tmpl
- Language: Go
- Homepage:
- Size: 10.5 MB
- Stars: 6
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# htmx-gorm-gin
htmx-gorm-gin is a lightweight example of a RESTful API utilizing SQLite as its database and powered by the HTMX library for seamless server-client interactions.
## Features
- **RESTful API:** Built on the principles of Representational State Transfer (REST) for efficient and standardized communication.
- **SQLite Database:** Utilizes a SQLite database for data storage, providing a simple and self-contained solution.
- **HTMX Integration:** Enhances server-client interactions through HTMX, allowing for dynamic updates and a smoother user experience.## Usage
- **Install Perquisites:** You have to have [go](https://go.dev/), [air](https://github.com/cosmtrek/air) and [bun](https://bun.sh/) installed.
- **Install Dependencies:** Install dependencies of go (in [root](/)) and bun (in [content](static/content/)).
- **Run Dev:** Finally, You have to use the `air` command, it's pre-configured in the [air-toml](.air.toml).
- **Build:** To build the project you have to run the following command, **make sure to include in your export the static files**:
```sh
cd ./static/content && bunx tailwindcss -i ./../../web/input.css -o ./dist/output.css && cd ./../../ && templ generate && go build .
```