Skip to content

ocaml-templates/spin-dream-fullstack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

spin-dream

Spin generator for Dream applications.


Demo

opam spin new https://github.com/tmattio/spin-dream.git

You can see a generated project with the minimal setup and usage instructions in the example/ directory.

What's included

  • Live reloading on file system change with dream-livereload
  • A project structure with a clear separation of concerns
    • lib/<project> contains the business logic and storage access
    • lib/<project>_web contains the API definition
    • lib/<project>_app contains an (optional) JavaScript application sent to clients
  • Welcome page with a portal to Dream's ecosystem
  • Unit test suite with Alcotest
  • CLI to configure server settings at runtime with dream-cli
  • (optional) Docker configuration files ready for deployment.
  • (optional) TailwindCSS integrated with Dune
  • (optional) Inter fonts configured with TailwindCSS
  • (optional) Turbolink setup

Requirements

  • The optional TailwindCSS setup requires NodeJS 12.13 or higher. If your system uses a previous version of NodeJS, we recommend using nvm to install a newer version.
    # Install NVM
    curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash
    # Reload bash
    source ~/.bashrc
    # Install an NPM version, 14 is the latest LTS
    nvm install 14
    # Use the version in your current prompt
    nvm use 14

To Do

  • Add Caqti examples
  • Skip crunch in development

Acknowledgments

  • Welcome page design borrowed from TailwindCSS playground
  • Turbolink setup borrowed from Haskell's IHP
  • Directory structure heavily inspired by Elixir's Phoenix