initial commit
nclazz/soundwerft/pipeline/head This commit looks good Details

master
Niclas Thobaben 2024-02-26 11:28:32 +01:00
commit 474ea2b33d
7 changed files with 292 additions and 0 deletions

31
.gitignore vendored 100644
View File

@ -0,0 +1,31 @@
# If you prefer the allow list template instead of the deny list, see community template:
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
#
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib
# Test binary, built with `go test -c`
*.test
# Output of the go coverage tool, specifically when used with LiteIDE
*.out
report/
# Dependency directories (remove the comment below to include it)
vendor/
# Go workspace file
go.work
.idea/
*.iml
# Local and generated files
bin/
.env
*_templ.go

29
Jenkinsfile vendored 100644
View File

@ -0,0 +1,29 @@
pipeline {
agent any
tools {
go '1.22'
}
environment {
NEXUS = credentials('jenkins_nexus')
GITEA_TOKEN = credentials('jenkins_gitea_token')
}
options {
timeout(time: 30, unit: "MINUTES")
}
stages {
stage('Build and Test') {
steps {
sh 'make'
}
}
}
post {
always {
cleanWs()
}
}
}

26
Makefile 100644
View File

@ -0,0 +1,26 @@
.DEFAULT_GOAL: all
.PHONY: all
all: check build ## Build and test the complete project
.PHONY: help
help: ## Display this help
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_0-9-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
##@ General
.PHONY: build
build: vendor ## Build the project locally
go build -o bin/soundwerft ./cmd
.PHONY: check
check: test ## Run all tests and linters
.PHONY: test
test: vendor test-unit ## Run all tests
.PHONY: test-unit
test-unit: vendor ## Run all unit tests
go test ./... -cover -coverprofile=coverage.out -race --tags=unit
vendor: go.mod
go mod vendor

15
README.md 100644
View File

@ -0,0 +1,15 @@
<h1 align="center">SoundWerft - The Docks for your musical creations</h1>
The idea behind **SoundWerft** is to streamline the idea of the Music Machine by Mike Monday.
The Music Machine uses a Trello template for its workflow. Though this is nice and accessible for everybody, I
personally felt it was to open for myself. The rules of the machine restrict listening back to sketches for a certain
amount of time, but this was not enforced by Trello. So I found myself constantly listening back to my current work,
instead of actively working on it.
**SoundWerft** is more restrictive in that sense. It disallows working on sketches at a certain status within a (configurable)
time limit. It also streamlines the workflow by managing the work to be done. Instead of mindlessly strolling around the Trello
board, finding the next required task, it tells you what should be done next.
Although this may sound very restrictive, producers can still decide how and what to continue (except locked sketches). The app
will however enforce a more thoughtful approach to production and helps to get more tracks done in a shorter time.

7
cmd/main.go 100644
View File

@ -0,0 +1,7 @@
package cmd
import "fmt"
func main() {
fmt.Println("hello soundwerft")
}

181
docs/features.md 100644
View File

@ -0,0 +1,181 @@
# Features & Requirements
## Users, Accounts & Profiles
- A user can sign up and create an account
- Authentication methods:
- authentication/session token for UI
- api-token for (JSON-)API
- A user account contains a custom display name, username and an email-address
- A user can sign in using either the username or the email-address
- The username can not be changed
- The display name can be changed at any time
- There can only be **one** account per email-address
- A user can customize the app to his preference
- Theming
- Language
- A user can have a custom image/avatar
- A user account be blocked by an administrator
- A user account is blocked for a certain amount of time after x failed login attempts
- A user account can be deleted
- A deletion will only soft delete at first
- Deleted accounts will be completely removed after a retention timeout
- A user can restore their account when forgetting the password
- A mail with a verification token is sent, from which the user can restore the password
## Progress System
- The progress system tracks the overall progress of the producer over the complete sketch pipeline and releases per user
- A Milestone is an achievable goal based on stats
- A Milestone can have deadline
- Milestones can be configured per user
- There can be any number of milestones
- There can only be a single milestone with the same configuration
- A Milestone can be reoccurring after completion or unreached (i.e. daily splurge)
- Available Milestones
- `x` splurges (until `time`)
- `x` sketches in `phase` (until `time`)
- `x` releases (until `time`)
- `x` amount of time spend on sketches (until `time`)
- The progress is measured with stats
- Ratio Sketches/Releases
- Ration Sketches in Phases
- Mean-time to release (time from sketch created -> finished over all sketches)
- Mean-time to done (time from sketch created -> done)
- Mean-time to draft (time from sketch created -> draft)
## Task System
- The task system determines the next best work item (sketch)
- Tasks can be
- Splurge
- Start direct listening session
- Start creative session
- The task system prioritizes tasks based on the phases of the sketches and defined milestones
- If there is an uncompleted splurge-milestone and no splurge today -> Splurge
- If there is an unlocked sketch with status listening -> Start direct listening session
- If there is an unlocked sketch in phase (prio: release, draft, discover) -> Start creative session
- If there is no other work-item found -> Splurge or "Lucky Dip" (select random sketch from incubate)
- If there are no open sketches found -> Splurge
## Sketch Pipeline
- A sketch is a musical idea
- A sketch has an activity history (changes and sessions)
- A sketch is associated with a phase in the sketch-pipeline
- The sketch-pipeline consists of these phases
- Incubate - Not actively worked on, awaiting further action
- Splurge - A quick idea, not meant to be of any quality
- Discover - A splurge of a splurge, the most creative phase
- Draft - A sketch with a purpose to which the sketch will be developed
- Done - A sketch which contains everything to serve the purpose
- Release - A sketch which needs final touches, mixing etc.
- Finished - A finished sketch
- When a sketch is finished, a release is created (-> release)
- A sketch can not be deleted. It either needs to go through the pipeline until finished or moved back into the "backlog"
- A sketch is moved through the pipeline based on transition rules (-> transition rules)
- A sketch can be locked on certain conditions
- A locked sketch can not be listened to
- A locked sketch can not be "worked" on (no session started)
- A locked sketch can not be moved through the pipeline
- A locked sketch can be edited (title, description, etc.)
- A sketch has a status of
- active - default status, the sketch is actively been worked on
- listening - set when the sketch is locked, requiring a direct listening session to move forward
- finished - the sketch is finished
- A new sketch can be created from an existing sketch (i.e. to create a VIP or Remix)
- The sketches are then linked together, but are moved through the pipeline separately
- A sketch can be tagged
- Tagged sketches are linked, but move separately through the pipeline
- A sketch contains a title, description (optional), purpose (set on Discover->Done), todos (checklist)
- A sketch can contain additional metadata with custom fields (-> configurable)
- Predefined fields: Genre, BPM, Key, Time Signature
- The Sketch Pipeline can be configured per user
- Time to wait after Splurge (default: 3 days)
- Time to wait after Done (default: 7 days)
- Time to wait after "work" (after a session has been completed) (default: 1 day)
- Default Metadata fields (more can be added per sketch)
- A sketch contains sessions
- A session is the work on a sketch in its current phase
- A session can be started on a sketch, paused and completed
- A session can either be a creative session (actively working on a sketch) or direct listening
- A direct listening session does not have a premise
- A direct listening session always has a review
- wins, opportunities, problems
- decision: keep in current phase, move forward, move to "backlog"
- There can only be one open session per user and per sketch
- A creative session can not be started, if the sketch has status listening
- After a direct listening session, the sketch has the status active
- When starting a session, a premise can be set
- A premise is a short description of what the goal of the session is
- The premise can include open todos from the sketch
- The premise can create new todos for the sketch
- A time limit can be set, after which a ringtone is heard the session is stopped
- When completing a session, a review can be set
- A review can contain a description
- A review can complete todos from the premise (marking them as done in the sketch)
- A review can create new todos for the next session
- A review **always** includes the result of the session as an audio file
- A sketch can either be manually created and start at any phase
- For phases other than splurge, requires an audio file
- A sketch is typically created by starting a splurge
- A splurge creates a new sketch in Splurge and immediately starts a session
- Starting a splurge includes the same configuration as starting a session (premise, etc.)
### Phase Transition Rules
Variables
wait_time_splurge
wait_time_done
| From -> To | Incubate | Splurge | Discover | Draft | Done | Release | Finished |
|------------|---------------------------------------|---------|---------------------------------------|---------------------------------------|-------------------------------------|----------------------------------------------------------|-------------|
| Incubate | - | - | At any time | If previously has been in Draft | - | If previously has been in Done or Release | - |
| Splurge | After `wait_time_splurge` has elapsed | - | After `splurge_wait_time` has elapsed | - | - | - | - |
| Discover | At any time | - | - | At any time, sketch gets `draft` flag | - | - | - |
| Draft | At any time | - | - | - | At any time, sketch get `done` flag | - | - |
| Done | After `wait_time_done` has elapsed | - | - | - | - | After `wait_time_done` has elapsed, sketch get `rc` flag | - |
| Release | At any time | - | - | - | - | - | At any time |
| Finished | - | - | - | - | - | - | - |
## Release System
- A release is a finished track or song
- A release is either based on a finished sketch or newly created
- A release contains the title, description, cover art, metadata, links
- A release that is based on a sketch is linked to the sketch
## Administration
## Technical Requirements
- Sketches and Releases have a slug, which is a URL-friendly representation of the title
- Slugs are only present in the URL for a nice UX, but are not used for actual reference
- Background Job
- A Background job can be implemented and either run cyclic or manually started by an admin user
- A Background job does not run concurrently, only one job of a type can run a time
- A Background job has a persistent log (levels: info, warn, error)
- Logs will be deleted by a cleanup job
- Starting a job creates an execution with status running, finished or failed
## App View / Sitemap
The following are the pages of the application, which can be directly navigated to. Each page may contain additional views
which are not directly routable (i.e. starting session for a sketch).
- Index `/` - Landing page containing register call-to-action -> form directly on the page, redirects to user home if logged in
- Login `/signin` - Sign in page
- Recover `/signin/recover` - Form to enter email-address for account recovery
- Register `/register` - Registration page, uses same form as on home
- Privacy Policy `/privacy-policy` - Privacy Policy
- Terms `/terms-of-service` - Legal page
- **After login**
- Home `/u/<username>` - Home page of the user with the overview dashboard
- Sketches `/u/<username>/sketches` - List of all sketches of the user
- Releases `/u/<username>/releases` - List of all releases of the user
- Settings `/settings` - Account settings
- Profile `/settings/profile` - Profile settings (email, avatar) + delete account action
- Security - `/settings/security` - Security settings (password, api tokens, maybe audit log and devices)
- Preferences - `/settings/preferences` - App preferences (theme, language, time zone)
- Pipeline - `/settings/pipeline` - Configuration of the sketch pipeline
- Sketch `/s/<sketch-id>/<slug>` - Page of a single sketch
- Release `/r/<release-id>/<slug>` - Page of a single release`
- **After login with admin**
- Home `/admin` - Admin dashboard
- Configuration `/admin/manage` - admin configuration page
- Accounts `/admin/manage/accounts` - Overview over all registered users
- Single account `/admin/manage/accounts/<user-id>` - Single page of a user to manage
- App - `/admin/manage/application` - configure application (i.e. max upload size, mail-server etc.)
- Jobs - `/admin/manage/jobs` - configure and manage automated jobs, like cleanup etc.

3
go.mod 100644
View File

@ -0,0 +1,3 @@
module git.l--n.de/nclazz/soundwerft
go 1.21.0