Important: Please keep in mind the project is built to have only one executable & transferable file. All the assets/credentials are embeded into the binary.
Important: The build can be run in two modes: release and devonly. devonly build mode does not serve embeded UI assets to support quick development and to not re-compile backend side each time. Please use make run for compiling project in devonly mode, and make build to get a production-ready binary.
Requirements
Google OAuth
Google Cloud Storage (service key)
MySQL/MariaDB 5.7 or higher
NodeJS v18
Init Project
Run make init and add your GCP service key (with Read-Write-Create access to Cloud Storage) to the ./credentials/gcp.json file
Ensure you set all the variables in ./credentials/env file. Here's the example:
APP_KEY=A02E..F== # base64 encoded bytes, used for JWT generating
GOOGLE_OAUTH_CLIENT_ID={cient id}
GOOGLE_OAUTH_SECRET={oauth secret}
GOOGLE_OAUTH_CALLBACK_URL=http://localhost:3000/auth/callback/google
STORAGE_BUCKET_NAME=my-bucket-name
DB_DSN=luke:secret@tcp(127.0.0.1:3306)/tutor
Development
Use make ui-watch, or run npm run watch from the ./ui dir
Use make run to compile project in devonly mode. Please keep in mind server will be serving assets from the actual ./ui/public directory