GithubHelp home page GithubHelp logo

htmx-nakai-template's Introduction

Gleam Nakai HTMX Template

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 structure

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

priv

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.

src

Contains all the Gleam source code for the project, with app.gleam being our entrypoint. It's further structured as follows:

app

Files at the root work as the main entrypoints for each module. The filenames should be pretty self explanatory

components

Files in the components module are intended to be pure functions that return html code, they are using nakai as the templating engine.

pages

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.

web

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.

Development

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

Deployment

The project comes with a standard Dockerfile that can be used for deployment purposes

TODO

  • Remove node dependencies
  • Expand on deployment section

Initial structure inspired by the work done for jsorm, check it out for your JSON explorer needs!

htmx-nakai-template's People

Contributors

sandsower avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.