Commit Graph

99 Commits

Author SHA1 Message Date
ekzyis 47183d3cf9 Add error.templ 2024-07-10 09:13:52 +02:00
ekzyis 822bcb36ed Align login link to end 2024-07-10 07:47:01 +02:00
ekzyis 5518553221 Randomize figlet font 2024-07-10 07:25:03 +02:00
ekzyis 862a6d584f Use templ components 2024-07-10 07:25:03 +02:00
ekzyis 01f85bd098 Setup tailwindcss 2024-07-10 06:12:43 +02:00
ekzyis 4ed1ae973b Put js, css into own dirs 2024-07-10 04:54:26 +02:00
ekzyis 3d3ae16617 Index page with templ 2024-07-10 04:47:25 +02:00
ekzyis 5969b23a31 Fix undefined CTE execution order
"""
The sub-statements in WITH are executed concurrently with each other and with the main query.
Therefore, when using data-modifying statements in WITH, the order in which the specified updates actually happen is unpredictable.
"""
-- https://www.postgresql.org/docs/14/queries-with.html

Also see https://stackoverflow.com/questions/47622827/cte-execution-order
2023-12-04 04:45:27 +01:00
ekzyis 0ea0cecfc3 Show market outcome 2023-12-04 02:36:09 +01:00
ekzyis fe5feccfee Implement market settlement 2023-12-04 01:36:59 +01:00
ekzyis 51e204b64a Add frontend for market settlement 2023-12-03 08:51:40 +01:00
ekzyis 938bff20e6 Add pubkey column to market table 2023-12-03 07:22:13 +01:00
ekzyis c7ae559777 Implement withdrawal 2023-12-03 06:21:57 +01:00
ekzyis ce95a2111b Update matchmaking 2023-12-03 02:03:48 +01:00
ekzyis 0be35c5cf5 Add TODO 2023-12-03 02:01:27 +01:00
ekzyis 555e8f0767 Remove unnecessary comments 2023-12-02 23:41:39 +01:00
ekzyis 28546962f3 Add msats to session 2023-12-02 23:30:48 +01:00
ekzyis 49cacb266c Order cancelation 2023-12-02 23:22:14 +01:00
ekzyis fd6111b590 Create sell orders 2023-11-29 18:48:21 +01:00
ekzyis 5edb220b37 Fix tx value used on BeginTx error 2023-11-29 18:38:04 +01:00
ekzyis 0ae9f671d4 Add sell order form 2023-11-29 08:11:56 +01:00
ekzyis c9de76ac75 Add market stats page 2023-11-29 04:11:46 +01:00
ekzyis ef304a3047 Fix typo 2023-11-27 18:29:07 +01:00
ekzyis e84db076a4 Use router-view for markets 2023-11-27 00:59:15 +01:00
ekzyis c96eeb7668 Show user orders 2023-11-27 00:21:39 +01:00
ekzyis fb7fbae699 Fix invoice polling finds no rows 2023-11-26 23:53:35 +01:00
ekzyis aa6db6a5e1 Fix foreign key constraint violation during market creation 2023-11-26 23:48:55 +01:00
ekzyis e5e9ae0667 Remove market end date from invoice description 2023-11-26 23:40:11 +01:00
ekzyis 73162155d5 Fix orphaned invoices with Tx and Context usage
txs are now rolled back on order error
2023-11-26 23:22:34 +01:00
ekzyis 6d7cd2573d Show user invoices 2023-11-26 22:35:51 +01:00
ekzyis 9026f56359 Update TODO 2023-11-26 18:56:02 +01:00
ekzyis 50724161c2 Update invoice description 2023-11-26 18:40:57 +01:00
ekzyis bc10fe025b First create order then invoice
This should prevent that we poll for invoices that had an error during order creation.

I should probably fix this with the context package.
2023-11-26 18:40:57 +01:00
ekzyis c1af91b0e4 Use JSON for errors 2023-11-26 18:21:26 +01:00
ekzyis ce64608894 Allow creation of markets 2023-11-20 02:52:08 +01:00
ekzyis 4b0d017b98 Add invoice description 2023-11-20 00:38:52 +01:00
ekzyis 4aaada7cb7 Add invoice view 2023-11-20 00:38:52 +01:00
ekzyis ebdf0d1e90 Add order form
* add POST /api/order -> 402 Payment Required
* redirect to /invoice/:id
2023-11-20 00:38:52 +01:00
ekzyis 55afc3b097 Add /market/:id route 2023-11-20 00:38:52 +01:00
ekzyis cdeb088a13 Show market list 2023-11-08 03:01:58 +01:00
ekzyis c44346774a Remove commented out HTTP API 2023-11-07 18:49:19 +01:00
ekzyis 5c225c1f25 Add logout button to /user 2023-11-07 14:02:25 +01:00
ekzyis 4e343d49d0 implement login with vue
* use vue router
* use pinia
* use tailwindcss
* use vite
* transform /api/login and /api/login/callback into JSON APIs
* add Access-Control-Allow-Credentials header
* add TODO about JSON errors
2023-11-07 09:06:35 +01:00
ekzyis 9a87fe7342 Rename to HandleInvoiceStatus 2023-11-03 23:43:56 +01:00
ekzyis edfbd2cc92 Test logout 2023-11-03 23:38:23 +01:00
ekzyis e2a09ccdd1 refactor: put test hooks and boilerplate into own package 2023-11-03 21:17:04 +01:00
ekzyis fc6fb9914e Test login + callback 2023-11-03 20:34:21 +01:00
ekzyis c66e96bf3f refactor: fix init and use DI
* fix init misuse which makes running tests impossible since tests are run inside a temporary test directory which breaks env loading

* use dependency injection pattern for server creation and global server context in route handlers
2023-11-03 20:34:21 +01:00
ekzyis 7558655458 refactor: Structure code into different packages
I have put too much code into the same files.

Also, I put everything into the same package: main.

This package is only meant for executables.

Therefore, I have refactored my code to use multiple packages. These packages also guarantee separation of concerns since Golang doesn't allow cyclic imports.
2023-09-10 23:13:08 +02:00