~w96k/doujinhub

531f79d21d8d272c313aae2d31cf1f8f043dce15 — Mikhail Kirillov 6 months ago ee834fc + 457e6c0
Merge branch 'feature/guix' into develop
M .gitignore => .gitignore +2 -1
@@ 1,1 1,2 @@
__pycache__
\ No newline at end of file
__pycache__
app/css/mini.css
\ No newline at end of file

A .guix-channel => .guix-channel +3 -0
@@ 0,0 1,3 @@
(channel
  (version 0)
  (directory "guix"))
\ No newline at end of file

A DEV.org => DEV.org +16 -0
@@ 0,0 1,16 @@
* Tech choice
** Background
   I'm user of guix system distribution and newbie python developer. I
   love LISPs a lot, but they (all) lack libraries for web, that's why
   programming language choice is Python for this project. If we will
   encoruage performance problems some parts can be rewritten at
   Common Lisp or Go.
** Guix
   Guix can create environments like pienv, but guix is not limited to
   python. It can be used for almost everything.
* What to implement
** DONE Guile script for virtual environment
** DONE Mini.css guix loading
** TODO About page
** TODO Setup postgresql
** TODO Change license to AGPL since its a web service project

M README.md => README.md +34 -1
@@ 1,5 1,24 @@
# Doujinhub
  Hosting service for collaboration on creating music.
Hosting service for collaboration between composers, performers
and sound engeneers.

## Name
Doujinshi is a japanese word meaning magazines published as a cooperative
effort by a group of individuals who share a common ideology or goals
with the aim of establishing a medium through which their work can be
presented. Doujin is a word that generalises this concept to other
fields. Doujin basically means any group of people with same interest
producing something to public. Doujin can be applied to music
collectives, for example:
https://invidio.us/channel/moonbowmusicmovie.
  
## How it works
1. Composer creates a music project and add a sheet music
2. Performers play a composer's music, record it and upload audio files
3. Sound engeneers try to bring all audio files into one piece and do
   post processing, then they upload final product.
4. Composition is done by a collaborative effort and available under
   free cultural work license.

## Features
   - Collaborate


@@ 26,5 45,19 @@ cd doujinhub
flask run
```

## Development
This project is under active development. Potencially it is not
limited to music production only. Things that will be done located at
todo tracker: https://todo.sr.ht/~w96k/doujinhub

I'll try to minimize usage of javascript. All javascript is available
under free license and librejs compatible. Also by choosing python a
programming languge I'll try to have as simple codebase as possible.

Project uses GNU coding guidelines.

## Donations
Any donation is apprecieted: https://liberapay.com/w96k/donate

## License
   [GPLv3](LICENSE)

D app.py => app.py +0 -9
@@ 1,9 0,0 @@
from flask import Flask
app = Flask(__name__)

@app.route("/")
def hello():
    return "Hello World!"

if __name__ == "__main__":
    app.run()

A app/__init__.py => app/__init__.py +5 -0
@@ 0,0 1,5 @@
from flask import Flask

app = Flask(__name__)

from app import routes

A app/routes.py => app/routes.py +8 -0
@@ 0,0 1,8 @@
from flask import render_template
from app import app

@app.route('/')
@app.route('/index')
def index():
    user = {'username': 'Miguel'}
    return render_template('index.html', title='Home', user=user)

A app/templates/index.html => app/templates/index.html +8 -0
@@ 0,0 1,8 @@
<html>
  <head>
    <title>{{ title }} - Microblog</title>
  </head>
  <body>
    <h1>Hello, {{ user.username }}!</h1>
  </body>
</html>

D env.scm => env.scm +0 -3
@@ 1,3 0,0 @@
(specifications->manifest
 '("python"
   "python-flask"   ))

M env.sh => env.sh +6 -1
@@ 1,1 1,6 @@
guix environment --container --manifest=env.scm --verbosity=2 --network
# Create virtual environment for a project
guix environment --container \
     -L guix/ \
     -e "(@ (non-gnu packages doujinhub) doujinhub)" \
     --network \
     -v 2

A guix/non-gnu/packages/doujinhub.scm => guix/non-gnu/packages/doujinhub.scm +85 -0
@@ 0,0 1,85 @@
;;; Doujinhub --- Web-service for a collaboration between composers,
;;; performancers, sound engeneers and other music artists.
;;;
;;; Copyright © 2020 Mikhail Kirillov <w96k@posteo.net>
;;;
;;; This file is part of Doujinhub
;;;
;;; Doujinhub is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;;
;;; Doujinhub is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with Doujinhub.  If not, see <http://www.gnu.org/licenses/>.

;; Virtual environment for a project
;;
;; We use guix to create something similar to python virtual
;; environment, but its not limited only to python. We can use it
;; almost for everything.

(define-module (non-gnu packages doujinhub)
  #:use-module (non-gnu packages mini-css)
  #:use-module (guix packages)
  #:use-module (guix git-download)
  #:use-module (guix build-system python)
  #:use-module (guix build-system trivial)
  #:use-module (guix build utils)
  #:use-module (guix gexp)
  #:use-module (gnu packages base)
  #:use-module (gnu packages python)
  #:use-module (gnu packages python-web)
  #:use-module ((guix licenses) #:prefix license:))

;; Return package for guix environment cli command
(define-public doujinhub
  (package
    (name "doujinhub")
    (version "0.0.1")
    (source (local-file "." "doujinhub" #:recursive? #t))
    (build-system trivial-build-system)
    (propagated-inputs
     `(("python-flask" ,python-flask)
       ("python-flask-wtf" ,python-flask-wtf)
       ("python-flask-sqlalchemy" ,python-flask-sqlalchemy)))
    (inputs
     `(("python" ,python)))
    (native-inputs
     `(("coreutils" ,coreutils)
       ("mini-css" ,mini-css)))
    (arguments
     `(#:modules ((guix build utils))
       #:builder
       (begin
	 (use-modules (guix build utils))

	 (newline)
	 (display %build-inputs)
	 
	 (let ((out (assoc-ref %outputs "out"))
	       (coreutils (assoc-ref %build-inputs "coreutils"))
	       (mini-css (assoc-ref %build-inputs "mini-css"))
	       (source (assoc-ref %build-inputs "source")))
	   
	   (mkdir out)
	   (mkdir (string-append out "/bin"))

	   ;; Copy code of the project
	   (copy-recursively (string-append source "/app") out)

	   ;; Copy mini.css in /public folder
	   (copy-recursively (string-append mini-css "/lib/node_modules/mini.css/src/mini/")
			     (string-append out "/css/mini.css"))
	   ))))
    (synopsis "Web-service for a collaboration between performance,
composers and sound engeneers.")
    (description "Web-service for a collaboration between performance,
composers and sound engeneers.")
    (home-page "https://doujinhub.com")
    (license license:gpl3)))

A guix/non-gnu/packages/mini-css.scm => guix/non-gnu/packages/mini-css.scm +60 -0
@@ 0,0 1,60 @@
;;; Doujinhub --- Web-service for a collaboration between composers,
;;; performancers, sound engeneers and other music artists.
;;;
;;; Copyright © 2020 Mikhail Kirillov <w96k@posteo.net>
;;;
;;; This file is part of Doujinhub
;;;
;;; Doujinhub is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;;
;;; Doujinhub is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with Doujinhub.  If not, see <http://www.gnu.org/licenses/>.

(define-module (non-gnu packages mini-css)
  #:use-module (guix packages)
  #:use-module (guix git-download)
  #:use-module (guix build-system node)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (gnu packages node))

(define-public mini-css
  (package
    (name "mini.css")
    (version "3.0.1")
    (source
     (origin
       (method git-fetch)
       (uri (git-reference
	     (url "https://github.com/Chalarangelo/mini.css")
	     (commit (string-append "v" version))))
       (file-name (git-file-name name version))
       (sha256
	(base32
	 "0fgp7hqfv5qvbgvkvf8k00ac5div0lmc3gm3rk6x7k5qsdhvcfhg"))))
    (build-system node-build-system)
    (arguments
     `(#:phases
       (modify-phases %standard-phases
	 (add-after 'install 'bin-delete
	   (lambda* (#:key inputs outputs #:allow-other-keys)
	     (delete-file (string-append (assoc-ref %outputs "out") "/bin"))
	     #t))
	 )))
    (synopsis "A minimal, responsive, style-agnostic CSS framework.")
    (description "mini.css is a lightweight CSS framework (under 7KB
gzipped) designed with mobile devices and modern browsers in
mind. Responsiveness, ease of use and customization are some of the
main features of the framework, while accessibility and extensive
documentation are some of the secondary focuses of the project. The
framework is written using Sass, while most of its components are
based on Flexbox.")
    (home-page "https://minicss.org")
    (license license:expat)))