-
Notifications
You must be signed in to change notification settings - Fork 54
Run the Timesheet from the source
Stanislav Valasek edited this page Sep 27, 2019
·
2 revisions
Set up a DB
- Install and start PosgreSQL on port 5432.
- Create a DB
timesheet
owned by usertimesheet
with a passwordtimesheet
.
Clone the repository
go get github.com/valasek/timesheet
cd $GOPATH/src/github.com/valasek/timesheet
Add private configuration files
Create config file ./client/.quasar.env.json
with the following content:
{
"development": {
"ENV_TYPE": "Running Development",
"ENV_DEV": "development",
"APP_DOMAIN": "localhost",
"APP_PORT": "3000",
"APP_TYPE": "Version for Academic and Non-Profit Organizations",
"APP_LOGO": "logo-custom.png"
},
"production-<client>": {
"ENV_TYPE": "Running Production <client-name>",
"ENV_PROD": "production-<client-name>",
"APP_DOMAIN": "<IP>,
"APP_PORT": "<PORT>",
"APP_TYPE": "",
"APP_LOGO": "logo-<client>.png"
},
"production-cloud": {
"ENV_TYPE": "Running Production Cloud",
"ENV_PROD": "production-cloud",
"APP_DOMAIN": "timesheet.simplesw.net",
"APP_PORT": "8080",
"APP_TYPE": "Version for Academic and Non-Profit Organizations",
"APP_LOGO": "logo-custom.png"
}
}
Set up a client configuration file - optional - if you need to
- update/add section in
./client/.quasar.env.json
- add logo -
./client/src/statics/logo-<client>.png
- add server config `./server/timesheet-.yaml - each per each configuration
Edit dockerfile to indicate for which client you are building for. Default - cloud.
COPY ./server/timesheet-<client>.yaml /timesheet.yaml
RUN yarn run build-<client>
Install Golang and Go dependencies
cd ./server
go get -u ./...
go run timesheet.go db --clean
go run timesheet.go db --load all
go run timesheet.go server
Install Node, npm and yarn and Quasar Framework
Install node
Install npm a yarn - I recommend to use npm for all global packages and yarn for all local packages
Start the server and client locally
# Open a new terminal and change to the client folder
cd client
# install dependencies
yarn install
# serve with hot reload at localhost:8080
yarn run
Used ports
-
8080 - UI in Vue/Quasar
-
3000 - server in Go
-
5432 - db - postgreSQL
Optionally after/during deployment - replace baseUrl in compiled js files. Not required anymore.
sed -i -e 's/localhost/www.example.com/g' /client/dist/*.js