Back-end for my LMS Website website.
Warning Website is under development, I need to finish this server first before I refactor the client/frontend.
LMS server require this binaries to be present in order to run.
Install required tools if you want to self-host.
- Go version ^1.19
- PostgreSQL
- Clone repository
git clone https://github.com/mystique09/lms-server
- Install dependencies
cd lms-server go mod tidy
- Copy the app.sample.env to app.env add your environment variables
cp app.sample.env app.env # or cat app.sample.env > app.env
- Run the server
PORT=8000 go run cmd/main.go # or, if you have cmake/make PORT=8000 make run
While developing, you need to install this binaries.
- Sqlc, sqlc is used to generate typesafe sql queries. Install sqlc.
- golang-migrate for manual migration. Install golang-migrate.
- mockgen for code mocks, also used for testing. Install gomock.
- Gosec, a go linter for security. Install gosec.
- Go-critic, a linter used to critic go code. Install go-critic.
- Golangci-lint, powerful golang linter. Install golangci-lint.
To run tests:
go test -v -cover -coverprofile=coverage.out
# or
make test
To run linters:
gosec -quiet -exclude-generated ./...
gocritic check -enableAll ./...
golangci-lint run ./...
# or
make lint