Skip to content

egreb/go-todos-with-oto

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Todos with go, oto, sqlite and svelte

Oto is a go driven rpc code generation tool, we are using this to generate the go endpoints and the javascript to use those endpoints.

Install && Run

  1. Create a database:
    touch todos.db
    
  2. Install the frontend (svelte):
    cd frontend
    npm install && npm run build
    
  3. Run it:
    go run main.go
    
  4. Navigate in your browser to localhost:8080

Generating code

# backend
oto -template ./templates/server.go.plush \
    -out ./generated/oto.gen.go \
    -ignore Ignorer \
    -pkg generated \
    ./definitions/definitions.go &&
gofmt -w ./generated/oto.gen.go ./generated/oto.gen.go

# frontend
oto -template ./templates/client.js.plush \
    -out ./frontend/src/oto.gen.js \
    -ignore Ignorer \
    ./definitions/definitions.go

Dependencies

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published