modelgen

Application to create (start app) go webservice with 3-Tier Architecture.
The Generated Application inculeds :-
- Go mod
- Configeration file
- Dockerfile
- DAL,BLL,DTO,API and API_Tests for every Database Table
- Compatalbe with
mysql
postgres
mssql
sqlite
oracle
- Using
as ORM
Installation
$ go get -u github.com/tarekbadrshalaan/modelgen
$ vi config.json
{
"AppName" : "Application",
"Module" : "{{github.com/packagepath}}",
"DBConnectionString" : "{{Database ConnectionString}}",
"DBEngine" : "{{Database Engine}}",
"WebAddress" : "0.0.0.0",
"WebPort" : 7070
}
$ modelgen
$ cd Application/
$ go build .
go: finding github.com/tarekbadrshalaan/goStuff/configuration latest
go: finding github.com/jinzhu/inflection latest
$ ./Application
Example
pg_restore -U postgres -d dvdrental ~/dvdrental.tar
$ vi config.json
{
"AppName" : "Application",
"Module" : "github.com/Application",
"DBConnectionString" : "host=127.0.0.1 port=5432 user=postgres password=postgres dbname=dvdrental sslmode=disable",
"DBEngine" : "postgres",
"WebAddress" : "0.0.0.0",
"WebPort" : 7070
}
$ modelgen
$ cd Application/
├──> Application
├──> config.json
├──> go.mod
├──> main.go
├──> Dockerfile
db
│ ├──> database.go
api
│ ├──> ActorAPI.go
│ ...
bll
│ ├──> ActorBLL.go
│ ...
dal
│ ├──> ActorDAL.go
│ ...
dto
│ ├──> ActorDTO.go
│ ...
test
│ ├──> Actor_test.go
│ ...
│ ├──> test.json
─────────────────────────────
Docker
# build docker image
docker build -t concept-api .
# run docker container
docker run --rm -it -p 7070:7070 --env-file .env --network host concept-api
Concept
- in
you can find the expected result of the generator.
Contributing
PRs accepted.
License
