northstar

command module
v0.2.41 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 18, 2024 License: MIT Imports: 14 Imported by: 0

README

NORTHSTAR - A Hypermedia Application Starter Template

Stack

Setup

  1. Clone this repository
git clone https://github.com/zangster300/northstar.git
  1. Install Dependencies
pnpm install
go mod tidy
  1. Create 🚀

Development

Live Reload is setup out of the box - powered by Air and templ's proxy server

Use the live task from the Taskfile to start the server

task live

Navigate to http://localhost:7331 in your favorite web browser to begin

Debugging

The debug task will launch delve to begin a debugging session with your project's binary

task debug

IDE Support

Visual Studio Code Integration

Reference

a Debug Main configuration has been added to the launch.json file to set breakpoints

Starting the Server

task run

Navigate to http://localhost:8080 in your favorite web browser

Deployment

Building an Executable

The task build task will assemble and build a binary with static assets embedded

Docker

# build an image
docker build -t northstar:latest .

# run the image in a container
docker run --name northstar -p 8080:9001 northstar:latest

Dockerfile

Contributing

Completely open to PR's and feature requests

References

Server

Embedded NATS

An embedded NATS server that powers the TODO application is configured and booted up in the router.go file

To interface with it, you should install the nats-cli

Here are some commands to inspect and make changes to the bucket backing the TODO app:

# list key value buckets
nats kv ls

# list keys in the `todos` bucket
nats kv ls todos

# get the value for [key]
nats kv get --raw todos [key]

# put a value into [key]
nats kv put todos [key] '{"todos":[{"text":"Hello, NATS!","completed":true}],"editingIdx":-1,"mode":0}'

[!IMPORTANT]
To see these updates take place in realtime within the TODO example, make sure your browser is pointed to the real server and not the templ proxy server!

Client

Web Components x Datastar

🔗 Web Components Setup

Hypermedia Architecture

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
web
components
templ: version: v0.2.793
templ: version: v0.2.793
layouts
templ: version: v0.2.793
templ: version: v0.2.793
pages
templ: version: v0.2.793
templ: version: v0.2.793

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL