Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
9bd8a14
feat: add cmd package initialization
manicar2093 Jun 7, 2025
b9165f0
feat: remove templ go generated files and change toast.Variant to string
manicar2093 Jun 7, 2025
cc02485
feat: add new init rest controller
manicar2093 Jun 7, 2025
5ec9ba0
feat: add new main func
manicar2093 Jun 7, 2025
ca8036e
feat: add taskfile.yml changes and makefile generation
manicar2093 Jun 7, 2025
d0d5da4
feat: change taskfile build and run commands generation
manicar2093 Jun 7, 2025
a057893
feat: add \t to makefile generation
manicar2093 Jun 7, 2025
6916ce8
feat: add tools to go.mod
manicar2093 Jun 7, 2025
a538117
feat: add sessionSecretKeyConfi to pkg/config package
manicar2093 Jun 7, 2025
8448f96
feat: add variable transforme to flash_messages.templ
manicar2093 Jun 7, 2025
fbe601a
feat: add env var for session secret key
manicar2093 Jun 7, 2025
1f96744
feat: add init web controller generation
manicar2093 Jun 7, 2025
f79d35b
feat: add generation code for gomancer for templates by the moment
manicar2093 Jun 7, 2025
62f1e8e
feat: add page render on init_web controller
manicar2093 Jun 7, 2025
96e08db
feat: add home template to be rendered on initial web controller
manicar2093 Jun 7, 2025
9c2572f
feat: change naming for current controller generator to indicates gen…
manicar2093 Jun 7, 2025
8ae2721
test(WIP): add web controller test and go file
manicar2093 Jun 7, 2025
44b2866
test(WIP): add web controller pages fixtures
manicar2093 Jun 9, 2025
5d4b076
test(WIP): add form and edit fixture for pages
manicar2093 Jun 10, 2025
c7ffa17
test(WIP): add register fixture for pages
manicar2093 Jun 10, 2025
68a91c9
test(WIP): add show fixture for pages
manicar2093 Jun 10, 2025
ebc4d27
feat: add web controller creation
manicar2093 Jun 12, 2025
388a845
test(WIP): add form templ creation assert
manicar2093 Jun 19, 2025
04ae87a
feat: add input number generations
manicar2093 Jul 3, 2025
e116771
feat: add InputNumberFLoat generator
manicar2093 Jul 3, 2025
69720bc
feat: add InputText generator
manicar2093 Jul 3, 2025
76916d2
feat: add InputToggle generator
manicar2093 Jul 3, 2025
6f593e3
feat: add model transformed text to inputs generators
manicar2093 Jul 3, 2025
5a084e0
feat: add datetime component generation
manicar2093 Jul 4, 2025
b1cda0e
feat: add decimal input generation on InputNumberFloat
manicar2093 Jul 4, 2025
82e97e9
feat: add select box component generation
manicar2093 Jul 4, 2025
4599ecb
test: change templates to use ModelTransformedText to create disables…
manicar2093 Jul 4, 2025
ee0a576
feat: add uuid input text generator
manicar2093 Jul 4, 2025
712a80c
feat: add new way to execute embed templates for components
manicar2093 Jul 4, 2025
270974b
feat: add function to get component via attribute type
manicar2093 Jul 4, 2025
320e4b7
feat: add web_form generation
manicar2093 Jul 5, 2025
dea37b4
feat: add web_table generation
manicar2093 Jul 7, 2025
5362418
feat: add web_show generation
manicar2093 Jul 7, 2025
3544a57
feat: add web_register generation
manicar2093 Jul 7, 2025
ace763b
feat: add web_index generation
manicar2093 Jul 8, 2025
7b7147f
feat: add web_edit generation
manicar2093 Jul 8, 2025
fdcb6db
fix: add GetByType into web_controller.tmpl
manicar2093 Jul 8, 2025
ca2127c
fix: add optional handling to web pages generators
manicar2093 Jul 8, 2025
2776252
feat: add goptional handling to get values in templs
manicar2093 Jul 8, 2025
744b08c
fix: add correct name generator on datetime.templ
manicar2093 Jul 10, 2025
55bac50
fix: add correct way to create ParialUpdateByIdInput in repository.txt
manicar2093 Jul 10, 2025
e3825c1
feat: change strcase dep to handle snake case correctly
manicar2093 Jul 10, 2025
04755f0
feat: remove space for form item component
manicar2093 Jul 10, 2025
937be46
feat: change %s holder to %v holder
manicar2093 Jul 10, 2025
d936c5c
fix: change script to format string to utc in datetime.templ input is…
manicar2093 Jul 10, 2025
d168dfa
test: change integration_test.sh
manicar2093 Jul 10, 2025
7a156ad
docs: add new readme docs
manicar2093 Jul 10, 2025
5b6a2c9
feat: add decimal string fixed to input component
manicar2093 Jul 10, 2025
6af5f51
fix: add endpoint to call when delete dinamically
manicar2093 Jul 10, 2025
08ea88a
feat: add way to get string shell cmd
manicar2093 Jul 11, 2025
0045dc7
docs: add resources generation details
manicar2093 Jul 11, 2025
c45fce3
chore: rename initial layout file
manicar2093 Jul 11, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/workflows/bump_version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ jobs:
with:
token: "${{ secrets.PERSONAL_ACCESS_TOKEN }}"
fetch-depth: 0
- name: Install Task
uses: arduino/setup-task@v2
with:
version: 3.x
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Generate project code
run: task generate
- name: Create bump and changelog
uses: commitizen-tools/commitizen-action@master
with:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ tmp
*.log
# Added by goreleaser init:
dist/
.fleet/
134 changes: 103 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

<div align="center">
<img src="https://img.shields.io/github/go-mod/go-version/manicar2093/gomancer" alt="Go Version">
<img src="https://img.shields.io/github/v/release/manicar2093/gomancer" alt="Latest Release">
<img src="https://img.shields.io/github/license/manicar2093/gomancer" alt="License">
</div>

Expand Down Expand Up @@ -44,6 +43,8 @@ Gomancer creates a well-structured project with:
- Echo web framework configuration
- Prisma for database migrations
- GORM for database access
- Templ for SSR (Server Side Rendering)
- TemplUI for html components
- Environment configuration
- GitHub workflow (bump_version) for automatic semantic versioning and changelog generation
- Air for hot reloading
Expand Down Expand Up @@ -76,6 +77,8 @@ gomancer new github.com/username/awesome-api

### Generating Resources

All resources will generate Web and Rest controllers

Basic resource with auto-increment ID:
```bash
gomancer gen Client name:string email:string age:int
Expand All @@ -102,35 +105,99 @@ When you create a new project with Gomancer, it generates the following structur

```
<project_name>/
├── .air.toml # Configuration for hot reloading
├── .cz.toml # Commitizen configuration
├── .env # Environment variables
├── README.md # Project documentation
├── Taskfile.yml # Task runner configuration
├── go.mod # Go module definition
├── package.json # Node.js dependencies (for Prisma)
├── .github/
│ └── workflows/
│ └── bump_version.yml # GitHub Actions workflow for automatic version bumping
├── cmd/
│ └── api/
│ ├── main.go # Application entry point
│ └── controllers/
│ └── init.go # Controllers initialization
├── internal/
│ └── domain/
│ └── models/
│ └── init.go # Domain models initialization
├── pkg/
│ ├── config/
│ │ └── config.go # Configuration settings
│ ├── generators/
│ │ └── generators.go # Code generation utilities
│ └── versioning/
│ └── version.go # Version management
└── prisma/
└── schema/
└── schema.prisma # Database schema definitions
├── .air.toml # Configuration for hot reloading
├── .cz.toml # Commitizen configuration
├── .env # Environment variables
├── .gitignore
├── go.mod # Go module definition
├── Makefile # Templ and Tailwind used commands
├── package.json # Node.js dependencies (for Prisma)
├── README.md # Project documentation
├── Taskfile.yml # Task runner configuration
├── .github
│   └── workflows
│   └── bump_version.yml # GitHub Actions workflow for automatic version bumping
├── cmd
│   └── service
│   ├── main.go # Application entry point
│   ├── assets
│   │   ├── css
│   │   │   └── styles.css
│   │   ├── img
│   │   │   ├── favicon.ico
│   │   │   └── gomancer.png
│   │   └── js
│   │   ├── htmx@2.0.4.min.js
│   │   ├── popover.min.js
│   │   ├── selectbox.min.js
│   │   ├── theme-setter.js
│   │   └── toggle-theme.js
│   ├── controllers
│   │   ├── init_rest.go # REST initial controller
│   │   ├── init_web.go # Web initial controller
│   │   └── initpages # Initial templ docs
│   │   └── home.templ
│   ├── sources
│   │   └── css
│   │   └── input.css
│   ├── translations
│   │   ├── translations.go
│   │   ├── en
│   │   │   └── translations.yaml
│   │   └── es
│   │   ├── translations.yaml
│   │   └── validator.go
│   └── ui
│   ├── components
│   │   ├── button
│   │   │   └── button.templ
│   │   ├── drawer
│   │   │   └── drawer.templ
│   │   ├── form
│   │   │   └── form.templ
│   │   ├── icon
│   │   │   ├── icon_data.go
│   │   │   ├── icon_defs.go
│   │   │   └── icon.go
│   │   ├── input
│   │   │   └── input.templ
│   │   ├── label
│   │   │   └── label.templ
│   │   ├── pagination
│   │   │   └── pagination.templ
│   │   ├── popover
│   │   │   └── popover.templ
│   │   ├── selectbox
│   │   │   └── selectbox.templ
│   │   ├── table
│   │   │   └── table.templ
│   │   └── toggle
│   │   └── toggle.templ
│   ├── layouts
│   │   ├── drawer.templ
│   │   ├── flash_messages.templ
│   │   ├── Initial.templ
│   │   └── sidemenu.templ
│   └── utils
│   └── templui.go
├── core
│   └── ...
├── internal
│   ├── domain
│   │   └── models # Here will be all your models
│   │   └── init.go
├── pkg
│   ├── config
│   │   └── config.go
│   ├── generators
│   │   ├── entities.go
│   │   └── generators.go
│   └── versioning
│   └── version.go
└── prisma
└── schema
└── schema.prisma

```

## Why Gomancer?
Expand All @@ -147,6 +214,10 @@ We have everything: ORMs, HTTP Servers, UI Libraries, Validation packages..._EVE

That's why Gomancer was born.

## About types

Now the only thing to notice is all dates are handled as UTC and show as Local when data is shown in a HTML input :/. There is an issue [#27](https://github.com/manicar2093/gomancer/issues/27) to review this.

## Roadmap

- [X] Start a project
Expand All @@ -159,7 +230,8 @@ That's why Gomancer was born.
- [X] Create all at once: controller, model, migration and repository
- [ ] Create API documentation
- [ ] Create auth implementation
- [ ] Add CRUD HTML templates
- [X] Add CRUD HTML templates
- [ ] Add CRUD HTML testing
- [ ] Add API testing

## License
Expand Down
6 changes: 6 additions & 0 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ tasks:
- ./scripts/run_integration_test.sh

install:
deps: [generate]
cmds:
- go install

Expand All @@ -26,3 +27,8 @@ tasks:
desc: Current version of gomancer
cmds:
- cz version -p

generate:
desc: Generates all needed code for project
cmds:
- go tool templ generate --proxy="http://localhost:8090" --open-browser=false -v
27 changes: 23 additions & 4 deletions bootstrap/bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ var templatesFS embed.FS
//go:embed core/*
var coreFS embed.FS

//go:embed cmd/*
var cmdFS embed.FS

type (
fileWithContent struct {
name, tmplName string
Expand Down Expand Up @@ -55,6 +58,10 @@ var (
"Taskfile.yml",
"taskfile.yml",
},
{
"Makefile",
"Makefile",
},
{
".air.toml",
"air.toml",
Expand Down Expand Up @@ -84,16 +91,25 @@ var (
},
},
{
string(domain.CmdApiControllersPackagePath),
string(domain.CmdServiceControllersPackagePath),
[]fileWithContent{
{
"init.go",
"cmd_api_controllers_init",
"init_rest.go",
"cmd_service_controllers_init_rest",
},
},
},
{
string(domain.CmdServiceControllersPackagePath),
[]fileWithContent{
{
"init_web.go",
"cmd_service_controllers_init_web",
},
},
},
{
string(domain.CmdApiPackagePath),
string(domain.CmdServicePackagePath),
[]fileWithContent{
{
"main.go",
Expand Down Expand Up @@ -167,6 +183,9 @@ func InitProject(input InitProjectInput) (string, error) {
if err := copyCoreToProject(projectDirName, input); err != nil {
return "", err
}
if err := copyCmdToProject(projectDirName, input); err != nil {
return "", err
}

var (
tpl = template.Must(template.ParseFS(templatesFS, "templates/*"))
Expand Down
Loading
Loading