MyTodo
This Application created with gogen cli tools with several command :
gogen domain core
gogen entity Todo
gogen error MessageMustNotEmpty
gogen error TodoAlreadyChecked
gogen usecase RunTodoCreate
gogen usecase RunTodoCheck
gogen usecase GetAllTodo
gogen repository SaveTodo Todo RunTodoCreate
gogen repository FindOneTodo Todo RunTodoCheck
gogen repository FindAllTodo Todo GetAllTodo
gogen gateway withmongodb
gogen gateway withsqlitedb
gogen controller restapi
gogen application mytodo
How to run it
- copy file
config.sample.json
- paste it into new file with name
config.json
- open first terminal run
go mod tidy
to download the go dependency - still in first terminal, run the backend apps with command
go run main.go mytodo
- open second terminal then change directory to web folder
cd web/
- in second terminal run
npm install
to download the vue dependency - still in second terminal run the frontend apps with command
npm run dev
- open
http://127.0.0.1:5173/web/
in browser
This application by default run with database sqlite.
if you want to switch into mongodb you need to switch in application/app_mytodo.go
replace line
datasource := withsqlitedb.NewGateway(log, appData, cfg)
with
datasource := withmongodb.NewGateway(log, appData, cfg)