go-choo-starter
Starter for choo projects with Go backend. No configuration needed.
How It Works?
- Renders choo views on server-side with go-duktape.
- Provides a simple Makefile to manage your project;
make start
starts everythingmake stop
stops allmake develop
starts the server and watches everything (Go, JS, CSS) for changes.make setup
installs all dependencies (Go and JS)
Install
Clone the repo and install the dependencies:
git clone [email protected]:azer/go-choo-starter.git hello-world
cd hello-world
make setup # Runs `go get` and `npm install` for you.
First Steps
Here is how you start the server:
make develop
develop
watches your code (Go, JS and CSS) and applies changes immediately. If you don't need that, you can run make start
and make stop
commands. You should use these two commands when you're not actively changing your code.
Coding
- Create UI components under
ui/components/
folder and route them atui/app.js
- Create API endpoints at
server/api.go
like the example there. - Use
make go-get
to fetch dependencies when you have new dependencies in the backend. - Any file under
./public
directory will be online at same path. - Run
make build
to build everything. Runmake go-build
andmake ui-build
to build each separately. - Run
make clean
to clean everything. Runmake go-clean
andmake ui-clean
to clean each separately.