Skip to content

Miconsul Scaffold App to test Go/HTMX/Templ/Tailwind apps

License

Notifications You must be signed in to change notification settings

edgarsilva/miconsul

Repository files navigation

Miconsul: patient appointment planner and notification center

Based on my GoScaffold project which allows you to quickly set-up Ready to deploy Web application projects using Go, SQLite with GORM, Templ with HTMX and DaisyUI/TailwindCSS:

The MVP App

vokoscreenNG-2024-07-23_17-00-32.webm

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development, scaffolding and testing purposes.

Other sections still pending in the README:

Note: working but pending readme section

  1. Automated production deployments with Coolify
  2. Sqlite Litestream backups
  3. Object storage with Minio (used by Litestream)
  4. Development feature brances.

MakeFile

Install dependencies and tooling (not Go itself)

Install dev environment tooling, you must have go correctly installed and in your path.

It will install:

  • bun: for TailwindCSS
  • TailwindCSS: plugins
  • goose: for migrations
  • templ: to build/compile templ files into go code
make install

Build the application

Generate TailwindCSS styles, templ files and go executable (go build)

make build

Start the app (for docker and prod deployments)

Apply migrations to the DB and start the application (used in prod docker deployment)

make start

Development

This is what you should be using for development, will auto generate css, templ files and translations and enable auto reloading of the server on file changes (not browser, just refresh the page, hit [f5] and done).

make dev

Run the app manually in dev mode (requires manual restart of the app)

If for whatever reason you don't want to use Air and have auto reloading enabled (use make dev above for that), this will generate the css and templ files and go run.

make run

DB - Create Database

Creates an Sqlite file at ./database/app.sqlite to use for the app

make db/create

DB - Delete Database

It deletes the database file

make db/delete

DB - Setup the database

It deletes, then re-creates the Database and runs all migrations to start with a clean slate.

make db/setup

DB - Dump schema

It dumps the DB schema into a file at ./database/schema.sql

make db/dump-schema

DB - Create migration

Creates a new migration file for the DB.

make db/migration name=add_column_price_to_payments

DB - Check migrations status

Lists Goose migration status

make db/status

DB - Run migrations

Runs pending migrations

make db/migrate

DB - Rollback last migrations

Rollbacks the last migration

make db/rollback

DB - Redo last migration

Rollbacks then re-runs last migration

make db/redo

Overall architecture guidelines for new features (WIP)

image

Overall Data Models and ERD (WIP needs updates)

image

About

Miconsul Scaffold App to test Go/HTMX/Templ/Tailwind apps

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages