Yu-Gi-Oh! Deck Building and Card Inventory Management web interface written in Common Lisp, utilizing HTMX.
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

about.md 12KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315
  1. # What it is
  2. ***Note:** Since the application is still in development, it is common
  3. for components to be unavailable, unresponsive, or outright
  4. unusable. If you're able to, please [submit a message](/contact) with
  5. the text of the page with Copy/Paste (Ctrl+A, Ctrl+C, Ctrl+V) and any
  6. additional information.*
  7. **cl-deck-builder2** is really three things:
  8. - [Inventory Management](#inventory)
  9. - [Deck Builder](#builder)
  10. - [Unifying User Interface](#ui)
  11. This application merges these things into a web interface where you
  12. can create, modify, and update decks, pricing, and inventory data.
  13. It is a web app written in [Common Lisp](https://lisp-lang.org/learn/first-steps)
  14. using [Caveman2](https://github.com/fukamachi/caveman).
  15. ## Inventory Management
  16. The inventory manager is located here: [/cards](/cards).
  17. **cl-deck-builder2** aims to suppliment Crystal Commerce Product
  18. Manager tools.
  19. The original intent was to allow CSV upload of Product Names from
  20. Crystal Commerce. This proved to be unnecessary, as YGOProDeck has all
  21. of the information in the `card_sets` arrays for each card.
  22. The Inventory editor has been superseded by the YGOProDeck editor.
  23. The CSV components and all of the Crystal Commerce code is in
  24. maintenance mode, and due to be removed, as there is no way to access
  25. or update this information currently.
  26. ### How To Use It
  27. Currently the following features are supported:
  28. - Partial List of Inventory Items: [Inventory List](/cards)
  29. - Clicking on the card image will take you to the Inventory for that card
  30. - Each Card has a `YGO-SET` associated with it, and each `YGO-SET` has
  31. one of five `VARIANT-CONDITION` associated with that. The two
  32. together create a `YGO-SET-ITEM` which is where the inventory and
  33. pricing information is contained.
  34. - The information displayed is: `Card Name - Set Code - Set Edition - Set Rarity - Set Price`
  35. - Clicking the Gear displays the `YGO-SET-ITEM` for this particular card.
  36. - Editing of individual inventory items: [Edit #1](/cards/1/view)
  37. - Extraction of additional data on import: exact card name, set
  38. Code, Rarity, and Edition.
  39. - Import of YGOProDeck Extra data: passcodes and linked images based
  40. on passcodes
  41. ## Deck Builder
  42. The deck builder is located here: [/builder](/builder).
  43. The Deck Builder component currently supports searching by full card
  44. name name, e.g. `Magician of Faith`. Any text matching this pattern
  45. entered into the Deck List box will return a list of matching results.
  46. Currently, there are approximately 12000 entries in the database. This
  47. list came from the YGOProDeck API.
  48. ### How To Use It
  49. Simply paste a list of matching cards into the list.
  50. YGOProDeck Decks with extension `.ydk` can be uploaded with an
  51. incomplete public interface which can be found at [/ydk/](/ydk).
  52. ## User Interface
  53. The user interface is a [Caveman2](https://github.com/fukamachi/caveman)
  54. web app with Common Lisp back-end. All of the things that can be done on
  55. the web front-end have supporting code in the CL back-end. You may load
  56. the source code into your editor and mess around with card information
  57. yourself.
  58. ### How To Use It
  59. You're using it right now!
  60. ## Source Code
  61. The source code is available [here](http://[2601:198:100:1261:d250:99ff:fe2e:566a]/git/).
  62. # Completed Feature List
  63. ## Categories
  64. We're using the [Nested Set Model](https://en.wikipedia.org/wiki/Nested_set_model#Example).
  65. You may create Parent Nodes (Left) and Child Nodes (Right). It needs a lot of work and is pretty SQL heavy.
  66. ## Sort By Many Fields
  67. When searching for results, we try to support "Not Just Alphabetical,"
  68. e.g. more than alphabetical sort. You may sort by Qty, Category, Race,
  69. Type, Card Text...
  70. Some of these aren't actually implemented because it's quite a bit of
  71. work. But the majority of the sort patterns are there.
  72. ## Deck Constraints
  73. The constraints placed on a deck during construction at the `/builder`
  74. resource are kind-of arbitrary. Here is the breakdown.
  75. First of all, at the database level, there are no restrictions on a
  76. deck. See [here](https://www.formatlibrary.com/decktypes/inzektor?format=ravine_ruler)
  77. for an example. You will notice in the "Popular Extra Deck Cards" area
  78. there are *20* cards. You may download the `.ydk` file from the
  79. `Download` button at the top. If you import this deck into the app, it
  80. will accept it as is. You will end up with an Extra Deck with 20 cards
  81. in it. This is intended.
  82. You may also notice, that, by design, when you create a new deck,
  83. there will be zero cards in it. This is allowed as well.
  84. However, if you continue to construct a deck, you will eventually be
  85. constrained to 60 cards in your main deck, as well as 15 cards in
  86. extra and side decks. There is no way to prevent this limiting from
  87. occurring.
  88. Ideally, I would like to have a way to switch between "free builder"
  89. and "constrained builder." A problem thus far has been "Where does the
  90. constraint checking happen?" And the current solution lies in the way
  91. the app is structured.
  92. So if you imagine each deck you construct as a template, then the deck
  93. builder is really a template constructor. There is a queue of Saved
  94. Deck Configurations, which can be categorized, with the
  95. [Categories](#categories) feature above.
  96. - Main deck max cards 60
  97. - Side Deck max cards 15
  98. - Extra Deck max cards 15
  99. As it stands, these constraints are hard coded. I'm not sure how I would
  100. implement this, but if I were to, it would be something like, setting
  101. a cookie and doing constraint checking in-line with some kind of CLOS
  102. object.
  103. ### Card Priority
  104. Cards will be added in this order:
  105. - Drag and drop: the card goes where you dropped it, provided the above numeric constraints are met.
  106. - Right click: the card is added at the "end" of the deck list, in
  107. this order: main deck, extra deck, side deck, trying to meet the
  108. above numeric constraints.
  109. Following this, when you save a deck, a priority number is assigned to
  110. the card as follows:
  111. - "normal" 0
  112. - "effect" 1
  113. - "ritual" 2
  114. - "fusion" 3
  115. - "link" 4
  116. - "skill" 5
  117. - "synchro" 6
  118. - "token" 7
  119. - "xyz" 8
  120. - "spell" 9
  121. - "trap" 10
  122. - "effect_pendulum" 11
  123. - "fusion_pendulum" 12
  124. - "normal_pendulum" 13
  125. - "ritual_pendulum" 14
  126. - "synchro_pendulum" 15
  127. - "xyz_pendulum" 16
  128. - Everything Else 17
  129. Lower numbers get put "earlier" in the deck listing. The next time you
  130. load the deck it will be sorted in this order.
  131. ## User Profiles
  132. You may currently register, login, logout, view the user list. This
  133. code has hardly been touched since it was implemented. If I spent more
  134. time working on the user code, I could also implement the "free
  135. builder" toggle system.
  136. The web framework system we're using gives us access to request and
  137. session information, and we can store cookies. There is also a
  138. database extension for managing all of this information persistently
  139. in a database. Our current database model is very simple. There is a
  140. user, with a password, and some metadata.
  141. We currently hash passwords, as well. So your passwords are stored
  142. securely. You currently may not change your password.
  143. When you register an account we ask for an email. We currently do
  144. nothing with this. An email server would take additional time to
  145. configure. A rudimentary setup would most likely be caught in your
  146. spam filters. This also highlights another issue with the app. We don't
  147. currently have a domain name. But that is another topic.
  148. ### Trade Between Profiles
  149. Theoretically this is no different than assigning a `category_id` to a
  150. `ydk_deck`. Simply add a `user_id` field to indicate the user which
  151. created the deck. However, this is not implemented, because I have not
  152. spent the required time looking at user management, as stated above.
  153. ## Charts / Metrics
  154. We have rudimentary charts and metrics provided by
  155. [RRDtool](https://oss.oetiker.ch/rrdtool/). These charts are just host
  156. information. We can feed it all kinds of data. It will take time to
  157. research the data format it ingests and how to produce a chart.
  158. I'm not sure if Crystal Commerce offers pricing or inventory charts or metrics.
  159. ## Picture of Finalized Deck
  160. We use [ImageMagick](https://www.imagemagick.org/) to generate deck
  161. images and other various image manipulations. We have complete control
  162. over the process. Currently output is very rudimentary. However I have
  163. complete control over the pipeline, and at this stage, more time could
  164. be spent developing this pipeline. It is currently sufficient for our
  165. purposes.
  166. The output is currently four static images, the main deck, extra, and
  167. side decks, then a concatenation of the three images. Additionally, we
  168. output the intermediate concatenation images as well.
  169. ## Different Card Games
  170. This is possible, all of the application is currently hard-coded to
  171. use Yu-Gi-Oh!. It would take a quite a bit of time to re-factor all of
  172. the routes to handle this scenario instead of possibly just running
  173. multiple copies of the app, or having dedicated instances of the app
  174. connected to dedicated database back-ends.
  175. Regardless, currently we only support Yu-Gi-Oh!. If more work were
  176. done on the User component, I could make it configurable as a cookie.
  177. ## Builder Controls
  178. Click on a card in the search results to see its information (card text, ATK, DEF, ...).
  179. ### Advanced Search
  180. In the Advanced Search menu you may search by card type, e.g. `frame_type` => `trap` will show you all trap cards.
  181. ## Decks Overview
  182. There is currently a rudimentary decks overview page.
  183. ## Constructed Deck Workflow
  184. The workflow for constructing decks is as follows:
  185. 1. Create deck of cards. Currently we select from all cards. Maybe we
  186. should just select cards from inventory. The majority of this
  187. functionality in place and isn't expected to change. A deck will
  188. always just be a list of cards plus metadata.
  189. 2. The deck of cards has metadata about author, name of deck, time of
  190. creation. The main content of the deck is three lists, comprising
  191. the main, extra, and side decks. This information is not expected
  192. to change in the future. Decks created by a particular user for
  193. example. The underlying metadata representation is what's being
  194. worked on. Currently each item in the database has all information
  195. duplicated from the rest of the database. Changing the price for
  196. one card changes the price for only that one card matching that row
  197. in the database. There will be additional tables to store pricing
  198. information in the next step.
  199. 3. On the Deck Overview page, selecting "Pull Deck" will decrease the
  200. inventory of the lowest priced card in inventory by one for every
  201. card in the deck. This is like "add to cart" in an online shopping
  202. platform, with additional inventory keeping. This is analogous to
  203. the deck construction step, except instead of selecting cards to be
  204. put into a deck, that information is provided prior, and we use
  205. that list of information to construct secondary lists.
  206. 4. On the pulled deck page, for every card in the deck, you will be
  207. able to select cards by edition, condition, and rarity of every
  208. card in the inventory matching that card's passcode. I can
  209. conceive a very simple concept where you attempt to check out, and
  210. then are returned with error messages saying which items had
  211. errors. This is the current approach.
  212. 5. There will be an intermediate stage. Once there is enough inventory
  213. and the deck is "pulled" it will enter an area where each
  214. individual card will be selected. e.g. selecting the rarity or set
  215. of a particular card in each deck.
  216. 6. Once all "errors" are resolved (banlists, constraints, etc), the
  217. "pulled" deck will allow you to "construct" it, which will finalize
  218. the state of this pulled deck in the database, moving it to another
  219. table, the list of decks for sale.
  220. 7. The list of decks for sale is just pulled, constructed decks with
  221. pricing information attached and whether or not it was sold and
  222. what price it was sold at and when.
  223. ## Formats
  224. It appears that I began working on format integration from
  225. YGOProDeck. I have not found a way to integrate this information into
  226. the builder yet.