OrgInfo
backend (Golang), frontend (JavaScript, Jquery)
orginfo will be a development response for the requirement of registration, maintenance and data
processing to organizational practices.
Powered by |
|
|
please notice me if you have any other idea ...
Requirements
````
/docs/requirements
````
open requirements file
Development map
mkdir orginfo && cd orginfo
go mod init orginfo
------------------------------------------echo
go get github.com/labstack/echo/v4
------------------------------------------gorm
go get -u gorm.io/gorm
go get -u gorm.io/driver/sqlite
------------------------------------------ozzo-validation
go get github.com/go-ozzo/ozzo-validation
Domain generator
to create new domain with CRUD operation and other prerequisite:
run, build and execute this file:
domain generator
and follow command(s) ...
like run this from '/config/cli/generator/bin/':
cd go/src/orginfo/config/cli/generator/bin/
pattern #1
input from command and flag one by one:
./generator sub-command -domain_name="DOMAIN NAME" -fields="field1-string-field1_1,field2-uint-field1_2,..."
run this for add a new domain:
./generator new -domain_name="DOMAIN_NAME" -fields="codeType-uint-code_type,code-uint-code"
Also, to remove a domain run this:
./generator delete -domain_name="DOMAIN_NAME"
pattern #2
import domain(s) from json type file ...
./generator new -from_file
remove domain(s) from json type file ...
./generator delete -from_file
the file name must be: `input.json`. in this address: `/config/cli/generator/`
you can find default of file in this address: [sample structure](cli/generator/input_struct.json)
[
{
"domain_name": "string",
"fields": [
{
"name": "string",
"type": "string",
"json_name": "string"
}
]
}
]
https://user-images.githubusercontent.com/49469395/194825671-d93fe8e4-64fb-4c67-a8fb-c5e29e55e16c.mp4
Create and set service for production
Create service
nano /lib/systemd/system/orginfo.service
Set service
[Unit]
Description=orginfo
[Service]
Type=simple
Restart=always
RestartSec=5s
ExecStart=/home/aliz/go/src/orginfo/bin/orginfo
[Install]
WantedBy=multi-user.target
Service's actions
service orginfo start
service orginfo restart
service orginfo status
service orginfo enable
service orginfo stop
SDKs setting
Environment
Json collection
To use and call from API platform like "Postman":
/docs/orginfo.postman_collection.json
Git
for clone
git clone git@github.com:ar-mokhtari/orginfo.git
for continue on existing repo:
cd existing_repo
git remote add origin `git address`
git branch -M main
git push -uf origin main
for production, there is stable main branch:
git checkout main
for develop:
git checkout -b developing
after all, back to main:
git merge --no-ff developing
Docker (compose)
for detail see:
docker-compose.yaml
docker compose up -d