Yu-Gi-Oh! Deck Building and Card Inventory Management web interface written in Common Lisp, utilizing HTMX.
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

4 месяцев назад
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. # cl-deck-builder2
  2. ## About
  3. This is a project to...
  4. - Build TCG decks: "The Deck Builder"
  5. - Keep track of TCG inventory: "The Inventory Manager"
  6. - Support sale of TCG Inventory via "The Deck Builder"
  7. It's a [Caveman2](https://github.com/fukamachi/caveman) web app, written in [Common Lisp](https://lisp-lang.org/).
  8. The entire application may be built and run inside a [Docker](https://www.docker.com/) container.
  9. You may access a live instance at [https://phntsm.ddns.net/](https://phntsm.ddns.net/).
  10. ## Usage
  11. There are three components to this project. "The Inventory Manager",
  12. "The Deck Builder," and "The User Interface". The Deck Builder sources
  13. in-stock products from the Inventory Manager. When the Deck Builder
  14. constructs a Deck, it keeps a record of which cards are located in
  15. which decks. When a Deck is purchased, this information can be updated
  16. via a web interface. The User Interface is a convenient front-end.
  17. The project may be used by loading a Docker image, loading the code
  18. directly into a Lisp sytem like [SBCL](http://sbcl.org/), or using a
  19. development environment like [Portacle](https://portacle.github.io/).
  20. Once loaded, follow the code below to start the development
  21. environment, or, if you're using the Docker image, simply type:
  22. ```bash
  23. % make docker-build
  24. % make docker-run
  25. ```
  26. ## Installation
  27. First, set up [SBCL](http://sbcl.org/) and [Quicklisp](https://www.quicklisp.org/beta/).
  28. If you're using [Portacle](https://portacle.github.io/), you should be all set already, just clone the repository.
  29. Clone the master repository from
  30. [http://phntsm.ddns.net/git/cl-deck-builder.git/](http://phntsm.ddns.net/git/cl-deck-builder.git/):
  31. ```bash
  32. % cd ~/quicklisp/local-projects/
  33. git clone http://phntsm.ddns.net/git/cl-deck-builder.git/
  34. ```
  35. ```lisp
  36. ;; You may have to push whatever directory you're in to *LOCAL-PROJECT-DIRECTORIES*
  37. (push #P"~/code/cl-deck-builder2/" ql:*local-project-directories*)
  38. ;; Load cl-deck-builder2 and tests
  39. (ql:quickload '(:cl-deck-builder2 :cl-deck-builder2-test))
  40. ;; cl-deck-builder2.asd finds src/package.lisp which contains package
  41. ;; definition - switch to this package for development.
  42. (in-package :cl-deck-builder2)
  43. ;; Start the server:
  44. ;; in src/main.lisp we define a custom function, MY/START, that will
  45. ;; INVOKE-RESTART if the server is already running.
  46. ;;
  47. ;; IPv4
  48. (my/start :address "0.0.0.0" :port 5001 :server :woo)
  49. ;; IPv6
  50. (my/start :address "::" :port 5001 :server :woo)
  51. ;; For development session:
  52. (use-package '(:cl-deck-builder2.db
  53. :cl-deck-builder2.draw
  54. :cl-deck-builder2.models
  55. :cl-deck-builder2.toolkit
  56. :cl-deck-builder2-test))
  57. ```
  58. ### Requirements
  59. You'll need Quicklisp, and the dependencies listed in the ASDF System
  60. Definition file, as well as the following system libraries installed.
  61. ```bash
  62. # Install Software
  63. % apt install build-essential git jq sbcl
  64. % apt install nginx fcgiwrap libev-dev sqlite3 libsqlite3-dev collectd imagemagick ruby ruby-sidekiq
  65. # For source code hosting
  66. % apt install cgit python3-pygments python3-markdown
  67. ```
  68. - [What is build-essential Ubuntu, how to install and use it?](https://linuxhint.com/install-build-essential-ubuntu/)
  69. - [git](https://git-scm.com/): Version Control
  70. - [jq](https://jqlang.github.io/jq/): Parsin JSON files on the command line
  71. - [SBCL](http://sbcl.org/): Lisp Implementation
  72. - [NGINX](https://www.nginx.com/): Web Server for HTTP, HTTPS, IPv4, IPv6, other services can be forwarded behind NGINX as well
  73. - [fcgiwrap](https://www.nginx.com/resources/wiki/start/topics/examples/fcgiwrap/): Simple FastCGI wrapper for CGI scripts (The project runs as a CGI script)
  74. - [libev](http://software.schmorp.de/pkg/libev.html): Event loop used by [woo](https://github.com/fukamachi/woo)
  75. - [sqlite3](https://www.sqlite.org/index.html): In-memory database store
  76. - [collectd](https://collectd.org/): collectd is a daemon which collects system and application performance metrics periodically and provides mechanisms to store the values in a variety of ways, for example in RRD files. This also nets us [RRDtool](https://oss.oetiker.ch/rrdtool/) which we can use for charts and graphs.
  77. - [ImageMagick](https://www.imagemagick.org/): We use this to generate deck images and other various image manipulations.
  78. - [Ruby](https://www.ruby-lang.org/en/): We use the [Sidekiq](https://sidekiq.org/) job scheduler, which is written in Ruby.
  79. You may want to set up [cgit](https://git.zx2c4.com/cgit/) git web.
  80. There is also a `Dockerfile` with a `Makefile`.
  81. ## Author
  82. _Bubblegumdrop <staticsunn@gmail.com>_
  83. ## Copyright
  84. Copyright (c) 2024 Bubblegumdrop
  85. ## License
  86. GPLv3+
  87. ## Localization Workflow
  88. `lisp.pot` contains the string to translate that were extracted from
  89. the `.lisp` files.
  90. `djula.pot` contains the strings to transtlate that were extracted
  91. from the djula templates.
  92. gettext is the default translation engine.
  93. ### Update Translations
  94. To build the translations:
  95. # Extract all {_ ... _} sequences from Djula templates
  96. make locale/templates/LC_MESSAGES/djula.pot
  97. # Extract all (_ ... _) sequences from LISP code
  98. make locale/templates/LC_MESSAGES/lisp.pot
  99. # Produce combined project template for translation
  100. make locale/templates/LC_MESSAGES/cl-deck-builder2.pot
  101. ... make your translation edits to cl-deck-builder2.pot ...
  102. ### Compile Translations
  103. To Produce the `.mo` files, add your language to `LOCALES` in the
  104. `Makefile` then update the translations with the `tr` target:
  105. LOCALES := en_US ja_JP
  106. # Produce the translations
  107. make tr
  108. The default `LANG` is currently `en_US` in `view.lisp`:
  109. (defun render (template-path &optional env (lang "en_US"))
  110. "Use Djula to render a template."
  111. (let ((template (gethash template-path *template-registry*)))
  112. (unless template
  113. (setf template (djula:compile-template* (princ-to-string template-path)))
  114. (setf (gethash template-path *template-registry*) template))
  115. (with-locale (lang)
  116. (apply #'djula:render-template*
  117. template nil
  118. env))))
  119. ## TODO
  120. See [todo.md](doc/todo.md)