# documentationsite **Repository Path**: caloch/documentationsite ## Basic Information - **Project Name**: documentationsite - **Description**: This is a Golang project managing handlers and domains, it is to implement a CMS system using go, having a static server and uploader, plus well managed REST requests, my Golang practice - **Primary Language**: JavaScript - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2023-07-29 - **Last Updated**: 2023-11-13 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ## GO Flavorings, 1. go mod init' as 'documentationsite' 2. in main, appName(), version(), Prerequsites: ``` $ go env -w GO111MODULE=on $ go env -w GOPROXY=https://goproxy.cn,direct #delve debugging $ git clone https://github.com/go-delve/delve $ cd delve $ go install github.com/go-delve/delve/cmd/dlv ``` Hints and musts: ``` 1. fileName having _, will not be included in project files, such as 'session_test.go, this has to be run by go run session_test.go 2. reflex: reflex -r "\.go$" -s go run . 3. cd db, sqlite3 mydb.db, .tables, select * from Users/insert ``` TODOs: 1. go session, get package by: go get github.com/kataras/go-sessions/v3 2. go cache 3. go jwt 4. go json 5. routes.go 6. go reflex, 'go get github.com/cespare/reflex 7. go sqlite3 8. login to get jwt token; jwt verify; permission check; data logic; cors; return json; 9. this very often is not an spa, so, session is used in this app, rather than jwt; 10. browser-sync, npm install -g brwoser-sync, cd static && browser-sync start --server --files "js/*.js", "*.css, *.html" Known Issues: 1. currently having one bug which happens when switching sub pages, if sub page model also has a same name property in array type, currently select, it would cause the select options to render multiple times, but the page model is correct; why do the options get rendered so many times when there is already removePoped function existing. workaround: avoid using same model property name for array; reason is topper level keeps rendering the same control many times. fix: solved it by introducing a calo.global object which gets rendered so leave the model replaced each time router navigates 2. known issue: nested model should not have same name, or else it will cause control content losing refs: 1. go operate mysql: http://www.topgoer.com/%E6%95%B0%E6%8D%AE%E5%BA%93%E6%93%8D%E4%BD%9C/go%E6%93%8D%E4%BD%9Cmysql/insert%E6%93%8D%E4%BD%9C.html 2. go operate config file: https://www.jianshu.com/p/c5458774a967 3. https://freshman.tech/file-upload-golang/ 4. https://www.golangprograms.com/example-of-golang-crud-using-mysql-from-scratch.html#:~:text=In%20this%20tutorial%2C%20we%20are%20going%20to%20see,as%20database%20front%20end%20to%20handle%20these%20operations.