2024-11-25 15:45:05 +01:00
|
|
|
# OpenCloud base stack
|
|
|
|
|
|
|
|
OpenCloud relies on a micro services architecture.
|
|
|
|
Each component could be developed using specific technologies.
|
|
|
|
However, in order to preserve product consistency and ease maintenance activities, we strongly encourage using the following technological stacks.
|
|
|
|
|
|
|
|
## Web services
|
|
|
|
|
|
|
|
Web services are developped in Go using Beego stack
|
|
|
|
|
|
|
|
### Environment setup
|
|
|
|
|
|
|
|
When using pricate repositories like the OpenCloud git forge, you should define it as a private repository
|
|
|
|
|
|
|
|
export GOPRIVATE=cloud.o-forge.io
|
|
|
|
|
|
|
|
The Beego stack provides the bee cli tool to ease building process :
|
|
|
|
|
|
|
|
go get github.com/beego/bee/v2@latest
|
|
|
|
|
|
|
|
### Project initialization
|
|
|
|
|
|
|
|
New component creation
|
|
|
|
|
|
|
|
go mod init oc-mycomponent
|
|
|
|
|
|
|
|
Refer to other services component main.go file to write a consitent initialisation process
|
|
|
|
|
|
|
|
### Project build
|
|
|
|
|
|
|
|
In order to build the software :
|
|
|
|
|
|
|
|
bee run -downdoc=true -gendoc=true
|
|
|
|
|
2024-12-10 18:01:58 +01:00
|
|
|
The -downdoc=true -gendoc=true will automatically generate swagger documentation in the /swagger path
|
2024-11-25 15:45:05 +01:00
|
|
|
|
2024-12-10 18:01:58 +01:00
|
|
|
If default Swagger page is displayed instead of your api, change url in swagger/index.html file to :
|
2024-11-25 15:45:05 +01:00
|
|
|
|
|
|
|
url: "swagger.json"
|
|
|
|
|
|
|
|
If annotations are modified without any code changed, a rebuild might not reflect the changes.
|
|
|
|
To force routing information update :
|
|
|
|
|
|
|
|
bee generate routers
|
|
|
|
|
|
|
|
## GUI compoenents
|
|
|
|
|
|
|
|
The GUI are developped using Flutter framework
|
|
|
|
|
|
|
|
### Environment setup
|
|
|
|
|
|
|
|
* Install Flutter framework
|
|
|
|
* Install Android Studio
|
|
|
|
* In "Tools"->"SDK Manager"->"Apparenace & Behaviour/System Settings/Android SDK", go to "SDK tools" and tick the "Android SDK command line tools"
|
|
|
|
* Run <code>flutter doctor</code> commmand and follow instructions to accept SDK licenses
|
|
|
|
* Add Vscode flutter plugin and use Vscode Command palette to create a Flutter project
|
2024-12-10 18:01:58 +01:00
|
|
|
* Also set the target Device using command Palette
|
2024-11-25 15:45:05 +01:00
|
|
|
|
|
|
|
### Project build
|
|
|
|
|
|
|
|
Depending on your target platform :
|
|
|
|
|
|
|
|
flutter build web
|
|
|
|
flutter build linux
|
|
|
|
flutter build windows
|