initial attempt at building Masonry

This commit is contained in:
2025-02-12 22:14:44 -07:00
commit e34da045bc
12 changed files with 187 additions and 0 deletions

8
.idea/.gitignore generated vendored Normal file
View File

@ -0,0 +1,8 @@
# Default ignored files
/shelf/
/workspace.xml
# Editor-based HTTP Client requests
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml

4
.idea/masonry.iml generated Normal file
View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<module version="4">
<component name="Go" enabled="true" />
</module>

34
cmd/cli/cli.go Normal file
View File

@ -0,0 +1,34 @@
package main
import (
"fmt"
"github.com/urfave/cli/v2"
"os"
)
func main() {
commands := []*cli.Command{}
app := &cli.App{
Name: "Masonry",
Usage: "A CLI tool from building SAAS applications",
Version: "v1.0.0",
Description: "Masonry is a CLI tool for building SAAS applications",
Commands: commands,
Flags: nil,
Authors: []*cli.Author{
{
Name: "Mason Payne",
Email: "mason@masonitestudios.com",
},
},
Copyright: "2025 Masonite Studios LLC",
UseShortOptionHandling: true,
}
err := app.Run(os.Args)
if err != nil {
fmt.Println(fmt.Errorf("error running app | %w", err))
return
}
}

1
cmd/cli/commands.go Normal file
View File

@ -0,0 +1 @@
package main

11
go.mod Normal file
View File

@ -0,0 +1,11 @@
module masonry
go 1.23
require github.com/urfave/cli/v2 v2.27.5
require (
github.com/cpuguy83/go-md2man/v2 v2.0.5 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 // indirect
)

8
go.sum Normal file
View File

@ -0,0 +1,8 @@
github.com/cpuguy83/go-md2man/v2 v2.0.5 h1:ZtcqGrnekaHpVLArFSe4HK5DoKx1T0rq2DwVB0alcyc=
github.com/cpuguy83/go-md2man/v2 v2.0.5/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/urfave/cli/v2 v2.27.5 h1:WoHEJLdsXr6dDWoJgMq/CboDmyY/8HMMH1fTECbih+w=
github.com/urfave/cli/v2 v2.27.5/go.mod h1:3Sevf16NykTbInEnD0yKkjDAeZDS0A6bzhBH5hrMvTQ=
github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 h1:gEOO8jv9F4OT7lGCjxCBTO/36wtF6j2nSip77qHd4x4=
github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1/go.mod h1:Ohn+xnUBiLI6FVj/9LpzZWtj1/D6lUovWYBkxHVV3aM=

29
readme.md Normal file
View File

@ -0,0 +1,29 @@
# Masonry
Masonry is intended to be a library that provides and implements all the basics necessary to build robust, production ready web applications.
## Features
[ ] Authentication via SpartanAuth
[ ] Authorization via SpiceDB
[ ] Database - your pick of Turso, LibSQL, SQLite, MySQL, Postgres
[ ] Payments via Stripe with flexible product configurations and pricing
[ ] Semantic Search for RAG or application navigation
[ ] System Email templates and SMTP integration
[ ] Cross-platform, installable apps for mobile, desktop and web
[ ] Predetermined frontend frameworks and adjustable styles
[ ] Built in notification framework
[ ] Customizable calls to webhooks for any event
[ ]
[ ]
[ ]
## Design Philosophy (changeable...)
The goal of this project is to make building software for web and mobile applications as fast as possible while maintaining
the highest level of quality and maintainability as possible.
* The more than can be derived from configuration the better.
* Pre-built functionality should be isolated into libraries and modules with *simple* interfaces to minimize manual coding.
* Composable applications minimizes dependencies and maximizes extensibility.
*

View File

@ -0,0 +1,26 @@
package daemon
type DaemonService interface {
Start()
Stop()
}
type Daemon struct {
services []DaemonService
}
func (d *Daemon) RegisterDaemonServer(service DaemonService) {
d.services = append(d.services, service)
}
func (d *Daemon) Start() {
for _, service := range d.services {
go service.Start()
}
}
func (d *Daemon) Stop() {
for _, service := range d.services {
service.Stop()
}
}

View File

@ -0,0 +1,3 @@
# Daemon
A library that provides a way to register and start multiple long-running services with safe tear-down when they are done.

View File

@ -0,0 +1,5 @@
package main
func main() {
}

38
templates/cli/cli.go Normal file
View File

@ -0,0 +1,38 @@
package main
import (
"fmt"
"github.com/urfave/cli/v2"
"os"
"time"
)
func main() {
commands := []*cli.Command{
exampleCmd(),
// call your command functions from the commands.go file
}
app := &cli.App{
Name: "ExampleApp",
Usage: "An example CLI tool",
Version: "v1.0.0",
Description: "This is an example CLI tool",
Commands: commands,
Flags: nil,
Authors: []*cli.Author{
{
Name: "Mason Payne", // Update this to your name
Email: "mason@masonitestudios.com", // Update this to your email
},
},
Copyright: fmt.Sprintf("%d Example Corp", time.Now().Year()),
UseShortOptionHandling: true,
}
err := app.Run(os.Args)
if err != nil {
fmt.Println(fmt.Errorf("error running app | %w", err))
return
}
}

20
templates/cli/commands.go Normal file
View File

@ -0,0 +1,20 @@
package main
import (
"fmt"
"github.com/urfave/cli/v2"
)
func exampleCmd() *cli.Command {
return &cli.Command{
Name: "example",
Aliases: []string{"e"},
Usage: "Run an example command",
Action: func(c *cli.Context) error {
fmt.Println("This is an example command")
return nil
},
}
}
// add commands here