This is the starting point for a nakai + htmx template with Wisp for the backend, it's setup in a minimal way to get started.
Project is structured in the following way
├── priv
│ └── static
│ ├── dist
│ └── sources
├── src
│ ├── app
│ │ ├── components
│ │ ├── pages
│ │ ├── web
│ │ ├── models.gleam
│ │ ├── pages.gleam
│ │ ├── router.gleam
│ │ ├── service.gleam
│ │ └── web.gleam
│ └── app.gleam
├── Dockerfile
├── gleam.toml
├── manifest.toml
├── package.json
├── pnpm-lock.yaml
├── README.md
└── tailwind.config.js
Contains the private files to be served by the server. Most files here are autogenerated but you can add custom scripts and assets if required to the dist
folder.
Contains all the Gleam source code for the project, with app.gleam
being our entrypoint. It's further structured as follows:
Files at the root work as the main entrypoints for each module. The filenames should be pretty self explanatory
Files in the components
module are intended to be pure functions that return html code, they are using nakai as the templating engine.
Code in the pages
module defines the views to be rendered in the browser using a mix of nakai elements and componets as defined in the components
folder.
The web
module takes care of handling request and determining which views to render according to those requests. It's essentially an extension of the router code.
Requirements: This project needs node installed to work as it depends on tailwindcss.
pnpm install # Install the dependencies
pnpm run dev # Run the project
gleam test # Run the tests
Looking for a more robust Gleam solution? Check out the Gleam Monorepo Template! It's setup to use Wisp for the backend and Lustre for the frontend
The project comes with a standard Dockerfile that can be used for deployment purposes
- Remove node dependencies
- Expand on deployment section
Initial structure inspired by the work done for jsorm, check it out for your JSON explorer needs!