mike

package module
v0.0.0-...-9d742bf Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 10, 2022 License: AGPL-3.0 Imports: 2 Imported by: 0

README

mike-sierra-sierra

More soon!

Contributing
Install Nix

Only two dev tools are required: git to clone the sources from GitHub and nix. Please see the appropriate installation instructions from https://nixos.org/download.html#nix-quick-install.

Then, run the following command that will download all dev tools (the first time) and open a shell with all dev tools installed:

$ nix-shell
Enable HTTPS support

Run the following commands:

$ mkcert -install
$ mkcert localhost ::1
$ mv localhost+1.pem ./secrets/cert.pem
$ mv localhost+1-key.pem ./secrets/key.pem

Warning: ~/.local/share/mkcert/rootCA-key.pem file that mkcert automatically generates gives complete power to intercept secure requests from your machine. Do not share it.

Start the dev Docker container
# build and watch the Go sources
$ make start
# Build and watch the CSS and Javascript
$ make watch
# Then, access https://localhost:8443
Database

Mike-sierra-sierra uses SQLite to persist data. The database file is located at ./database/file/mike.db You must create the database file yourself and run the ./database/schema/install.sql script on it in order to create the DB tables.

First-time registration

Upon first starting the container, go to https://localhost:8443/first-time-registration to register your admin user.

Go commands
# Run unit tests
$ make test-go
# Run golint
$ make lint-go
# Generate html test coverage
$ make coverage-go-html
NPM commands
# Install npm dependencies
$ npm install 
# Build and minify the CSS and Javascript (for production)
$ npm run build
# Run unit tests
$ npm test
# Display text test coverage
$ npm test -- --coverage
# Build and watch (for development)
$ make watch

s

Add music files to the dev Docker image
# Run an alpine container with bind-mount to a folder where you have music (on your host). Replace <my-user> in the command
$ docker run -it --rm -v /home/<my-user>/Music:/source -v mike_music:/dest alpine ash
[container]$ cp /source/*.mp3 dest
Build the production Docker image
# Build the image
$ make build-docker-image
# Run goss tests on the built image to ensure everything keeps working
$ make dgoss-ci
How to edit the goss.yaml file interactively
# It will run the container with goss and goss.yaml inside. --user allows you to edit the goss.yaml file.
# The env variable disables HTTPS (otherwise you need to provide valid cert and key)
$ dgoss edit -e MIKE_DISABLE_HTTPS=1 --user=$(id -u) hyzual/mike-sierra-sierra
# Once in the container, you can run goss commands
[container]$ goss autoadd
Run stylelint
$ npm run stylelint -- ./styles
# To automatically fix problems
$ npm run stylelint -- --fix ./styles
Run eslint
$ npm run eslint -- .
# To automatically fix problems
$ npm run eslint -- --fix .
Run prettier
# To automatically format HTML templates, Typescript files and CSS assets
$ npm run prettier -- --write ./templates ./scripts ./styles

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Cwd

func Cwd() (string, error)

Cwd returns the current working directory of the server This is then used to include templates and serve static assets like CSS and JS files

Types

This section is empty.

Directories

Path Synopsis
cmd
cli
server
adapter
Package adapter holds all code dedicated to side-effects and communication with the outside world (databse, os, filesystem, REST API, etc.).
Package adapter holds all code dedicated to side-effects and communication with the outside world (databse, os, filesystem, REST API, etc.).
adapter/rest
Package rest implements the REST API.
Package rest implements the REST API.
adapter/server
Package server implements the music server.
Package server implements the music server.
adapter/server/app
Package app groups together app routes.
Package app groups together app routes.
adapter/server/user
Package user groups together user authentication code.
Package user groups together user authentication code.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL