cookie cutter for small scale web application
-
Authentication:
cookies + login session LUT
-
Authorization:
role and access LUT
-
Web API:
-
Static File:
-
Virtual File Server:
hide physical file path from end user
- install golang
- install nodeJS
- install GCC compiler (for golang compile github.com/mattn/go-sqlite3 package)
- install Visual Studio Code (or any equivalent text editor)
Open command line terminal (target directory to project directory)
> cd backend
> go build
> cd ../frontend
> npm install
> npm run build
Using terminal: (target directory to project directory)
To build backend server:
> cd backend
> go build
To build frontend server:
> cd frontend
> npm run build
To start web server:
> cd frontend
> npm run start
- Create an empty database
- Start run with enable flag
dbinittable
and change database setting pointed to newly created database- in order to generate all basic data tables
- test record will not affect in-production database
- Edit ./util/helper.go
- modify
GetTestDB()
function to target your test database
- modify
- Go to ./generateRecord_test.go
- uncomment
TestGenerateRecords()
- run test on
TestGenerateRecords()
- comment back
TestGenerateRecords()
- uncomment
- Run unit test
go test ./...