Home

Awesome

cookiecutter-purescript-frontend

Cookiecutter for scaffolding a fresh purecsript frontend. The structure of the project generated is borrowed directly from tomashoneyman Real World Halogen which is a really good reference for how to structure a Halogen project.

Version

This is a cookiecutter for projects using Halogen version 6 with Purescript >= 0.15.4

Older branches

Do note that these branches are stale and not being maintained anymore.

Includes

Other useful packages included

Requirements

Usage

cookiecutter https://github.com/naglalakk/cookiecutter-purescript-frontend

This will ask you about the name of your project and version number.

Once you have generated your project with cookiecutter you can start by running install for all dependencies with

spago install && npm i

This will install dependencies for Purescript with Spago and then install the js dependencies needed for the server ( express and pug )

This project includes scripts with a few common tasks:

Once you have installed everything you can run

npm run dev

This will run a development server on port :8080

Environment variables

Environment variables can be included in a .env file, located at the root of the project.

Environment variables included

PORTNR

The port number the server will be running on. Default: 8080

ENVIRONMENT

Environment to run in. Default: Development

API_URL

Your custom API URL for backend requests

API_TOKEN

Custom authentication API_TOKEN. Only applies if you're using a backend API with a Bearer Authorization scheme.

API_USERNAME

Custom username for Basic authentication. Only applies if you're using a backend API with a Basic Authorization scheme.

API_USERPASS

Custom password for Basic authentication. Only applies if you're using a backend API with a Basic Authorization scheme.

Structure