Code Monkey home page Code Monkey logo

shurco / litecart Goto Github PK

View Code? Open in Web Editor NEW
165.0 165.0 30.0 22.28 MB

๐Ÿ›’ litecart - shopping cart in 1 file with card and cryptocurrency payment support

License: MIT License

Go 47.33% Shell 4.58% JavaScript 7.68% HTML 6.96% Vue 31.83% CSS 1.61%
basket cart commerce cryptocurrency-exchanges e-commerce ecommerce ecommerce-platform go golang hacktoberfest payment paypal self-hosted shop shopping-cart spectrocoin stripe stripe-payments tailwind

litecart's Introduction

Hi there ๐Ÿ‘‹

I'm Dmitry, an open-source enthusiast, and avid contributor. I'm the author of Werbot and NetMoth.

๐Ÿ‘ท Check out what I'm currently working on

  • shurco/litecart - ๐Ÿ›’ litecart - shopping cart in 1 file with card and cryptocurrency payment support (2 days ago)
  • werbot/lime - ๐Ÿ‹โ€๐ŸŸฉ light license-key server in 1 file (2 days ago)
  • netmoth/netmoth - ๐Ÿš€ A lightweight, fast, and comprehensive solution for traffic analysis and intrusion detection. (2 days ago)
  • shurco/goSign - โœ๏ธ Sign documents without stress (2 days ago)
  • werbot/werbot - ๐Ÿ”‘ Team Access Sharing - a self-hosted solution with single sign-on for secure, easy shared access to servers, databases, and applications. (1 month ago)

๐ŸŒฑ My latest projects

๐Ÿ”จ My recent Pull Requests

๐Ÿ““ Gists I wrote

โญ Recent Stars

  • xvzc/SpoofDPI - A simple and fast anti-censorship tool written in Go (1 day ago)
  • apernet/OpenGFW - OpenGFW is a flexible, easy-to-use, open source implementation of GFW (Great Firewall of China) on Linux (3 weeks ago)
  • nixys/nxs-backup - The tool for creating, delivering and rotating backups for GNU/Linux distributions. (3 weeks ago)
  • jonhadfield/ip-fetcher - A library and CLI to fetch IP ranges from popular online sources (3 weeks ago)
  • ntop/nDPI - Open Source Deep Packet Inspection Software Toolkit (3 weeks ago)

๐Ÿ’ฌ Feedback

If you use one of my projects, I'd love to hear from you! Don't be shy and let me know what you liked and what needs being improved. Got an issue? Open a ticket, I don't bite and will try my best to help!

litecart's People

Contributors

dependabot[bot] avatar github-actions[bot] avatar kaichaosun avatar msalbrain avatar shurco avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

litecart's Issues

๐Ÿš€ [Feature]: sell recurring services (ie: seo for clients)

Feature Description

I'm using gumroad now but its not ideal, they actually don't officially support services only files.

Additional Context (optional)

No response

Code Snippet (optional)

package main

import "fmt"

func main() {
  fmt.Print("hello word")
}

Checklist:

  • I agree to follow litecart's Code of Conduct.
  • I have checked for existing issues that describe my suggestion prior to opening this one.
  • I understand that improperly formatted feature requests may be closed without explanation.

๐Ÿค— [Question]: admn credentials docker

first of all thank you for this project

Question Description

Is it possible that the docker image isn't primed with admin data?
Even after running the docker init or restarting I can't seem to login with [email protected] / Pass123

error:

๐Ÿ›’ litecart - open source shopping-cart in 1 file
โ”œโ”€ Cart UI: http://0.0.0.0:8080/
โ””โ”€ Admin UI: http://0.0.0.0:8080/_/
{"level":"info","latency":"1.511822ms","status":200,"method":"GET","url":"/_/signin","time":1704103392,"message":"Success"}
{"level":"error","caller":"/home/runner/work/litecart/litecart/internal/handlers/private/auth.go:36","error":"user with the given email is not found","time":1704103400}
{"level":"error","latency":"16.248537ms","status":500,"method":"POST","url":"/api/sign/in","time":1704103400,"message":"Server error"}

shellscript to reproduce:

test -d lc_base || {
  mkdir -p lc_base lc_digitals lc_uploads site || true
  docker run \
    -v ./lc_base:/lc_base \
    -v ./lc_digitals:/lc_digitals \
    -v ./lc_uploads:/lc_uploads \
    -v ./site:/site \
    --rm shurco/litecart:latest init
}

docker run -d \
  --name litecart \
  --restart unless-stopped \
  -p '8090:8080' \
  -v ./lc_base:/lc_base \
  -v ./lc_digitals:/lc_digitals \
  -v ./lc_uploads:/lc_uploads \
  -v ./site:/site \
  shurco/litecart:latest

Checklist:

  • I agree to follow litecart's Code of Conduct.
  • I have checked for existing issues that describe my questions prior to opening this one.
  • I understand that improperly formatted questions may be closed without explanation.

๐Ÿ› [Bug]: Blank page when navigating settings

Bug Description

When I was browsing the settings I saw a blank white page with no UI after navigating through several settings pages.

How to Reproduce

  • Visit localhost:8080.
  • Click through the first four menu icons on the left.
  • Once on settings, click through Authentication, Payment, Webhook Events.
  • Then click back to Payment.
  • The page goes completely white with no UI visible.

Expected Behavior

I would expect it to navigate back to the Payment settings UI.

litecart Version

v0.1.12

Code Snippet (optional)

No response

Checklist:

  • I agree to follow litecart's Code of Conduct.
  • I have checked for existing issues that describe my problem prior to opening this one.
  • I understand that improperly formatted bug reports may be closed without explanation.

๐Ÿ› [Bug]: error 413 (Payload Too Large) for files over a megabyte

Bug Description

When I'm uploading a file-asset over a megabyte, the server will fail silently with: 413 (Payload Too Large) in the browser console

I guess I can just overwrite a small file with a bigger one (in the lc_digital) using scp e.g., but perhaps the upload-endpoint could accept a higher uploadsize.

How to Reproduce

Steps to reproduce the behavior:

  1. add a product
  2. upload a digital file around 10 mb

Expected Behavior

accept bigger file uploads

litecart Version

v0.1.9

Code Snippet (optional)

No response

Checklist:

  • I agree to follow litecart's Code of Conduct.
  • I have checked for existing issues that describe my problem prior to opening this one.
  • I understand that improperly formatted bug reports may be closed without explanation.

๐Ÿ› [Bug]: ERROR:failed to render: render: template index does not exist

Bug Description

image

I can access Admin UI,but when I setted up,I cant access Cart UI

How to Reproduce

I build it with docker
error log
2023/11/22ย 10:31:54 | stdout | {"level":"error","latency":"332.804ยตs","status":500,"method":"GET","url":"/","error":"failedย toย render:ย render:ย templateย indexย doesย notย exist","time":"2023-11-22T02:31:54Z","message":"Serverย error"}

Expected Behavior

Cant access Cart UI

litecart Version

v0.1.5

Code Snippet (optional)

No response

Checklist:

  • I agree to follow litecart's Code of Conduct.
  • I have checked for existing issues that describe my problem prior to opening this one.
  • I understand that improperly formatted bug reports may be closed without explanation.

Cognitive Code complexity

Bug Description

read about it here:
https://dev.to/marcello_h/solve-code-complexity-in-go-56hg
It is up to you what you want to do with this knowledge.

My report:
litecart/internal/app.go:34:1 - NewApp has complexity: 27
complexity = 1

  • 1 (found 'if' at line: 40, complexity = 2)
  • 1 (found 'if' at line: 45, complexity = 3)
  • 1 (found 'if' at line: 57, complexity = 4)
  • 1 (found 'if with lines >= 10' at line: 57, complexity = 5)
    • 2 (found 'if' at line: 59, complexity = 7)
    • 2 (found 'else' at line: 61, complexity = 9)
      • 3 (found 'if' at line: 62, complexity = 12)
  • 1 (found 'if' at line: 83, complexity = 13)
  • 1 (found 'if' at line: 97, complexity = 14)
  • 1 (found 'if' at line: 107, complexity = 15)
  • 1 (found 'if with lines >= 10' at line: 107, complexity = 16)
  • 1 (found 'if with lines >= 25' at line: 107, complexity = 17)
    • 2 (found 'if' at line: 122, complexity = 19)
    • 2 (found 'if' at line: 127, complexity = 21)
  • 1 (found 'if' at line: 133, complexity = 22)
  • 1 (found 'else' at line: 135, complexity = 23)
  • 1 (found 'else with lines >= 10' at line: 135, complexity = 24)
    • 2 (found 'go' at line: 138, complexity = 26)
    • 2 (found 'go with lines >= 10' at line: 138, complexity = 27)

litecart/internal/handlers/private/setting.go:19:1 - Version has complexity: 14
complexity = 1

  • 1 (found 'if' at line: 23, complexity = 2)
  • 1 (found 'logical operator' at line: 23, complexity = 3)
  • 1 (found 'if' at line: 28, complexity = 4)
  • 1 (found 'if with lines >= 10' at line: 28, complexity = 5)
    • 2 (found 'if' at line: 32, complexity = 7)
    • 2 (found 'if' at line: 36, complexity = 9)
    • 2 (found 'if' at line: 41, complexity = 11)
    • 2 (found 'if' at line: 47, complexity = 13)
  • 1 (found 'if' at line: 52, complexity = 14)

litecart/internal/handlers/public/cart.go:17:1 - Checkout has complexity: 13
complexity = 1

  • 1 (found 'if' at line: 19, complexity = 2)
  • 1 (found 'range' at line: 24, complexity = 3)
  • 1 (found 'if' at line: 32, complexity = 4)
  • 1 (found 'if' at line: 37, complexity = 5)
  • 1 (found 'range' at line: 42, complexity = 6)
  • 1 (found 'range with lines >= 10' at line: 42, complexity = 7)
  • 1 (found 'range with lines >= 25' at line: 42, complexity = 8)
    • 2 (found 'range' at line: 44, complexity = 10)
    • 2 (found 'if' at line: 61, complexity = 12)
  • 1 (found 'if' at line: 81, complexity = 13)

litecart/internal/queries/cart.go:21:1 - Carts has complexity: 17
complexity = 1

  • 1 (found 'if' at line: 39, complexity = 2)
  • 1 (found 'defer' at line: 42, complexity = 3)
  • 1 (found 'for' at line: 44, complexity = 4)
  • 1 (found 'for with lines >= 10' at line: 44, complexity = 5)
  • 1 (found 'for with lines >= 25' at line: 44, complexity = 6)
    • 2 (found 'if' at line: 60, complexity = 8)
    • 2 (found 'if' at line: 64, complexity = 10)
    • 2 (found 'if' at line: 68, complexity = 12)
    • 2 (found 'if' at line: 72, complexity = 14)
    • 2 (found 'if' at line: 76, complexity = 16)
  • 1 (found 'if' at line: 83, complexity = 17)

litecart/internal/queries/cart.go:151:1 - CartSendMail has complexity: 74
complexity = 1

  • 1 (found 'if' at line: 158, complexity = 2)
    • 2 (found 'if' at line: 159, complexity = 4)
  • 1 (found 'if' at line: 165, complexity = 5)
  • 1 (found 'if' at line: 170, complexity = 6)
  • 1 (found 'defer' at line: 173, complexity = 7)
  • 1 (found 'defer with lines >= 5' at line: 173, complexity = 8)
    • 2 (found 'if' at line: 174, complexity = 10)
  • 1 (found 'logical operator' at line: 174, complexity = 11)
    • 2 (found 'else' at line: 176, complexity = 13)
  • 1 (found 'range' at line: 181, complexity = 14)
  • 1 (found 'range with lines >= 10' at line: 181, complexity = 15)
  • 1 (found 'range with lines >= 25' at line: 181, complexity = 16)
  • 1 (found 'range with lines >= 50' at line: 181, complexity = 17)
    • 2 (found 'if' at line: 184, complexity = 19)
      • 3 (found 'if' at line: 185, complexity = 22)
    • 2 (found 'if' at line: 191, complexity = 24)
    • 2 (found 'if with lines >= 10' at line: 191, complexity = 25)
      • 3 (found 'if' at line: 193, complexity = 28)
      • 3 (found 'defer' at line: 196, complexity = 31)
      • 3 (found 'for' at line: 198, complexity = 34)
      • 3 (found 'for with lines >= 10' at line: 198, complexity = 35)
        • 4 (found 'if' at line: 206, complexity = 39)
    • 2 (found 'if' at line: 213, complexity = 41)
    • 2 (found 'if with lines >= 10' at line: 213, complexity = 42)
      • 3 (found 'if' at line: 216, complexity = 45)
  • 1 (found 'logical operator' at line: 216, complexity = 46)
    • 3 (found 'if' at line: 219, complexity = 49)
    • 3 (found 'if with lines >= 10' at line: 219, complexity = 50)
      • 4 (found 'if' at line: 221, complexity = 54)
        • 5 (found 'if' at line: 222, complexity = 59)
      • 4 (found 'if' at line: 227, complexity = 63)
  • 1 (found 'if' at line: 236, complexity = 64)
  • 1 (found 'if' at line: 240, complexity = 65)
  • 1 (found 'if' at line: 243, complexity = 66)
  • 1 (found 'if' at line: 250, complexity = 67)
    • 2 (found 'range' at line: 252, complexity = 69)
  • 1 (found 'if' at line: 258, complexity = 70)
    • 2 (found 'range' at line: 260, complexity = 72)
  • 1 (found 'if' at line: 274, complexity = 73)
  • 1 (found 'if' at line: 278, complexity = 74)

litecart/internal/queries/install.go:19:1 - Install has complexity: 17
complexity = 1

  • 1 (found 'defer' at line: 21, complexity = 2)
  • 1 (found 'if' at line: 24, complexity = 3)
  • 1 (found 'defer' at line: 27, complexity = 4)
  • 1 (found 'defer with lines >= 5' at line: 27, complexity = 5)
    • 2 (found 'if' at line: 28, complexity = 7)
  • 1 (found 'logical operator' at line: 28, complexity = 8)
    • 2 (found 'else' at line: 30, complexity = 10)
  • 1 (found 'if' at line: 37, complexity = 11)
  • 1 (found 'if' at line: 42, complexity = 12)
  • 1 (found 'defer' at line: 45, complexity = 13)
  • 1 (found 'if' at line: 49, complexity = 14)
  • 1 (found 'range' at line: 62, complexity = 15)
    • 2 (found 'if' at line: 63, complexity = 17)

litecart/internal/queries/pages.go:26:1 - ListPages has complexity: 13
complexity = 1

  • 1 (found 'if' at line: 32, complexity = 2)
  • 1 (found 'if' at line: 37, complexity = 3)
  • 1 (found 'defer' at line: 40, complexity = 4)
  • 1 (found 'for' at line: 42, complexity = 5)
  • 1 (found 'for with lines >= 10' at line: 42, complexity = 6)
    • 2 (found 'if' at line: 48, complexity = 8)
    • 2 (found 'if' at line: 52, complexity = 10)
    • 2 (found 'if' at line: 56, complexity = 12)
  • 1 (found 'if' at line: 63, complexity = 13)

litecart/internal/queries/products.go:22:1 - ListProducts has complexity: 21
complexity = 1

  • 1 (found 'if' at line: 44, complexity = 2)
  • 1 (found 'if with lines >= 10' at line: 44, complexity = 3)
    • 2 (found 'range' at line: 51, complexity = 5)
  • 1 (found 'if' at line: 58, complexity = 6)
  • 1 (found 'if' at line: 64, complexity = 7)
  • 1 (found 'defer' at line: 67, complexity = 8)
  • 1 (found 'for' at line: 69, complexity = 9)
  • 1 (found 'for with lines >= 10' at line: 69, complexity = 10)
  • 1 (found 'for with lines >= 25' at line: 69, complexity = 11)
    • 2 (found 'if' at line: 82, complexity = 13)
    • 2 (found 'if' at line: 86, complexity = 15)
  • 1 (found 'logical operator' at line: 86, complexity = 16)
    • 2 (found 'if' at line: 90, complexity = 18)
  • 1 (found 'if' at line: 97, complexity = 19)
  • 1 (found 'if' at line: 103, complexity = 20)
  • 1 (found 'logical operator' at line: 103, complexity = 21)

litecart/internal/queries/products.go:111:1 - Product has complexity: 13
complexity = 1

  • 1 (found 'if' at line: 132, complexity = 2)
  • 1 (found 'else' at line: 134, complexity = 3)
  • 1 (found 'if' at line: 158, complexity = 4)
    • 2 (found 'if' at line: 159, complexity = 6)
  • 1 (found 'if' at line: 165, complexity = 7)
  • 1 (found 'if' at line: 169, complexity = 8)
  • 1 (found 'logical operator' at line: 169, complexity = 9)
  • 1 (found 'if' at line: 173, complexity = 10)
  • 1 (found 'if' at line: 177, complexity = 11)
  • 1 (found 'if' at line: 181, complexity = 12)
  • 1 (found 'if' at line: 185, complexity = 13)

litecart/internal/queries/products.go:350:1 - ProductDigital has complexity: 31
complexity = 1

  • 1 (found 'defer' at line: 354, complexity = 2)
  • 1 (found 'if' at line: 357, complexity = 3)
  • 1 (found 'defer' at line: 361, complexity = 4)
  • 1 (found 'defer with lines >= 5' at line: 361, complexity = 5)
    • 2 (found 'if' at line: 362, complexity = 7)
  • 1 (found 'logical operator' at line: 362, complexity = 8)
    • 2 (found 'else' at line: 364, complexity = 10)
  • 1 (found 'if' at line: 372, complexity = 11)
    • 2 (found 'if' at line: 373, complexity = 13)
  • 1 (found 'if' at line: 379, complexity = 14)
  • 1 (found 'else' at line: 381, complexity = 15)
  • 1 (found 'if' at line: 387, complexity = 16)
  • 1 (found 'defer' at line: 390, complexity = 17)
  • 1 (found 'for' at line: 392, complexity = 18)
  • 1 (found 'for with lines >= 10' at line: 392, complexity = 19)
    • 2 (found 'if' at line: 400, complexity = 21)
  • 1 (found 'if' at line: 407, complexity = 22)
  • 1 (found 'if' at line: 413, complexity = 23)
  • 1 (found 'defer' at line: 416, complexity = 24)
  • 1 (found 'for' at line: 418, complexity = 25)
  • 1 (found 'for with lines >= 10' at line: 418, complexity = 26)
    • 2 (found 'if' at line: 427, complexity = 28)
    • 2 (found 'if' at line: 431, complexity = 30)
  • 1 (found 'if' at line: 438, complexity = 31)

litecart/internal/queries/products.go:492:1 - DeleteDigital has complexity: 16
complexity = 1

  • 1 (found 'if' at line: 495, complexity = 2)
  • 1 (found 'switch' at line: 499, complexity = 3)
  • 1 (found 'case' at line: 500, complexity = 4)
    • 2 (found 'if' at line: 503, complexity = 6)
    • 2 (found 'if' at line: 507, complexity = 8)
    • 2 (found 'range' at line: 515, complexity = 10)
      • 3 (found 'if' at line: 516, complexity = 13)
  • 1 (found 'case' at line: 521, complexity = 14)
    • 2 (found 'if' at line: 522, complexity = 16)

litecart/internal/queries/setting.go:25:1 - Settings has complexity: 21
complexity = 1

  • 1 (found 'if' at line: 32, complexity = 2)
  • 1 (found 'if' at line: 42, complexity = 3)
  • 1 (found 'defer' at line: 45, complexity = 4)
  • 1 (found 'for' at line: 68, complexity = 5)
  • 1 (found 'for with lines >= 10' at line: 68, complexity = 6)
    • 2 (found 'if' at line: 71, complexity = 8)
    • 2 (found 'if' at line: 76, complexity = 10)
      • 3 (found 'branch' at line: 77, complexity = 13)
    • 2 (found 'type switch' at line: 80, complexity = 15)
    • 2 (found 'case' at line: 81, complexity = 16)
    • 2 (found 'case' at line: 83, complexity = 17)
      • 3 (found 'if' at line: 85, complexity = 20)
  • 1 (found 'if' at line: 92, complexity = 21)

litecart/internal/queries/setting.go:100:1 - UpdateSettings has complexity: 26
complexity = 1

  • 1 (found 'defer' at line: 102, complexity = 2)
  • 1 (found 'if' at line: 105, complexity = 3)
  • 1 (found 'defer' at line: 108, complexity = 4)
  • 1 (found 'defer with lines >= 5' at line: 108, complexity = 5)
    • 2 (found 'if' at line: 109, complexity = 7)
  • 1 (found 'logical operator' at line: 109, complexity = 8)
    • 2 (found 'else' at line: 111, complexity = 10)
  • 1 (found 'if' at line: 117, complexity = 11)
  • 1 (found 'defer' at line: 120, complexity = 12)
  • 1 (found 'switch' at line: 123, complexity = 13)
  • 1 (found 'case' at line: 124, complexity = 14)
  • 1 (found 'case' at line: 133, complexity = 15)
    • 2 (found 'if' at line: 135, complexity = 17)
    • 2 (found 'if' at line: 139, complexity = 19)
  • 1 (found 'case' at line: 147, complexity = 20)
  • 1 (found 'case' at line: 152, complexity = 21)
  • 1 (found 'case' at line: 160, complexity = 22)
  • 1 (found 'case' at line: 169, complexity = 23)
  • 1 (found 'range' at line: 173, complexity = 24)
    • 2 (found 'if' at line: 174, complexity = 26)

litecart/internal/queries/setting.go:306:1 - SettingStripe has complexity: 13
complexity = 1

  • 1 (found 'if' at line: 311, complexity = 2)
  • 1 (found 'defer' at line: 314, complexity = 3)
  • 1 (found 'for' at line: 316, complexity = 4)
  • 1 (found 'for with lines >= 10' at line: 316, complexity = 5)
    • 2 (found 'if' at line: 319, complexity = 7)
    • 2 (found 'switch' at line: 323, complexity = 9)
    • 2 (found 'case' at line: 324, complexity = 10)
    • 2 (found 'case' at line: 326, complexity = 11)
    • 2 (found 'case' at line: 328, complexity = 12)
  • 1 (found 'if' at line: 333, complexity = 13)

litecart/internal/queries/setting.go:341:1 - ListSocials has complexity: 19
complexity = 1

  • 1 (found 'if' at line: 348, complexity = 2)
  • 1 (found 'defer' at line: 351, complexity = 3)
  • 1 (found 'for' at line: 353, complexity = 4)
  • 1 (found 'for with lines >= 10' at line: 353, complexity = 5)
    • 2 (found 'if' at line: 356, complexity = 7)
    • 2 (found 'if' at line: 360, complexity = 9)
    • 2 (found 'if with lines >= 10' at line: 360, complexity = 10)
      • 3 (found 'switch' at line: 361, complexity = 13)
      • 3 (found 'case' at line: 362, complexity = 14)
      • 3 (found 'case' at line: 364, complexity = 15)
      • 3 (found 'case' at line: 366, complexity = 16)
      • 3 (found 'case' at line: 368, complexity = 17)
      • 3 (found 'case' at line: 370, complexity = 18)
  • 1 (found 'if' at line: 376, complexity = 19)

litecart/internal/queries/setting.go:384:1 - SettingMail has complexity: 18
complexity = 1

  • 1 (found 'if' at line: 390, complexity = 2)
  • 1 (found 'defer' at line: 393, complexity = 3)
  • 1 (found 'for' at line: 395, complexity = 4)
  • 1 (found 'for with lines >= 10' at line: 395, complexity = 5)
    • 2 (found 'if' at line: 398, complexity = 7)
    • 2 (found 'if' at line: 402, complexity = 9)
    • 2 (found 'if with lines >= 10' at line: 402, complexity = 10)
      • 3 (found 'switch' at line: 403, complexity = 13)
      • 3 (found 'case' at line: 404, complexity = 14)
      • 3 (found 'case' at line: 406, complexity = 15)
      • 3 (found 'case' at line: 409, complexity = 16)
      • 3 (found 'case' at line: 411, complexity = 17)
      • 3 (found 'case' at line: 413, complexity = 18)

litecart/pkg/archive/tar.go:63:1 - ExtractTar has complexity: 17
complexity = 1

  • 1 (found 'if' at line: 65, complexity = 2)
  • 1 (found 'defer' at line: 68, complexity = 3)
  • 1 (found 'if' at line: 71, complexity = 4)
  • 1 (found 'defer' at line: 74, complexity = 5)
  • 1 (found 'for' at line: 77, complexity = 6)
  • 1 (found 'for with lines >= 10' at line: 77, complexity = 7)
    • 2 (found 'if' at line: 79, complexity = 9)
      • 3 (found 'if' at line: 80, complexity = 12)
    • 2 (found 'if' at line: 85, complexity = 14)
      • 3 (found 'if' at line: 88, complexity = 17)

litecart/pkg/archive/zip.go:51:1 - ExtractZip has complexity: 16
complexity = 1

  • 1 (found 'if' at line: 53, complexity = 2)
  • 1 (found 'defer' at line: 56, complexity = 3)
  • 1 (found 'if' at line: 59, complexity = 4)
  • 1 (found 'if' at line: 63, complexity = 5)
  • 1 (found 'range' at line: 67, complexity = 6)
  • 1 (found 'range with lines >= 10' at line: 67, complexity = 7)
    • 2 (found 'if' at line: 68, complexity = 9)
      • 3 (found 'branch' at line: 69, complexity = 12)
    • 2 (found 'if' at line: 73, complexity = 14)
    • 2 (found 'if' at line: 78, complexity = 16)

litecart/pkg/update/update.go:28:1 - Init has complexity: 19
complexity = 1

  • 1 (found 'defer' at line: 36, complexity = 2)
  • 1 (found 'if' at line: 39, complexity = 3)
  • 1 (found 'defer' at line: 46, complexity = 4)
  • 1 (found 'if' at line: 48, complexity = 5)
  • 1 (found 'else' at line: 52, complexity = 6)
    • 2 (found 'if' at line: 53, complexity = 8)
    • 2 (found 'if' at line: 49, complexity = 10)
  • 1 (found 'if' at line: 61, complexity = 11)
  • 1 (found 'defer' at line: 65, complexity = 12)
  • 1 (found 'if' at line: 68, complexity = 13)
    • 2 (found 'if' at line: 70, complexity = 15)
  • 1 (found 'if' at line: 75, complexity = 16)
  • 1 (found 'if' at line: 80, complexity = 17)
    • 2 (found 'if' at line: 81, complexity = 19)

54 = files
177 = functions
74 = highest complexity
4.84 = overall average complexity per function

How to Reproduce

All the code with high numbers can hide bugs because of the complex structure. These can be candidates for refactoring.

Expected Behavior

Simple code, that's easy to maintain.

litecart Version

latest on github

Code Snippet (optional)

No response

Checklist:

  • I agree to follow litecart's Code of Conduct.
  • I have checked for existing issues that describe my problem prior to opening this one.
  • I understand that improperly formatted bug reports may be closed without explanation.

๐Ÿš€ [Feature]: auction style bidding

Feature Description

would be nice to have this with an auction based site.

Additional Context (optional)

No response

Code Snippet (optional)

package main

import "fmt"

func main() {
  fmt.Print("hello word")
}

Checklist:

  • I agree to follow litecart's Code of Conduct.
  • I have checked for existing issues that describe my suggestion prior to opening this one.
  • I understand that improperly formatted feature requests may be closed without explanation.

๐Ÿ› [Bug]: Error running litecart for the first time

Bug Description

After init and serve and visiting localhost:8000 I saw a blank page and the following in the developer console of my browser:

21:45:04.189 Uncaught Error: Extension Error: The validator 'all' must be a function.
    Zn http://localhost:8080/_/assets/vee-validate-usGg8cAm.js:5
    $t http://localhost:8080/_/assets/vee-validate-usGg8cAm.js:5
    <anonymous> http://localhost:8080/_/assets/index-BETTTWNd.js:2
    <anonymous> http://localhost:8080/_/assets/index-BETTTWNd.js:2

How to Reproduce

  • Downloaded the litecart binary for my platform.
  • Ran litecart init and it created the dirs.
  • Ran litecart serve and it ran successfully.
  • Then I tried to visit localhost:8080 and I was met with a blank page.
  • I looked at the web developer console and saw the error.

Expected Behavior

Litecart should start and present me with the first page.

litecart Version

litecart version LiteCart v0.1.11 (453b7e4) from 2024-07-07

Code Snippet (optional)

No response

Checklist:

  • I agree to follow litecart's Code of Conduct.
  • I have checked for existing issues that describe my problem prior to opening this one.
  • I understand that improperly formatted bug reports may be closed without explanation.

๐Ÿค— [Question]: How to configure the stripe?

Question Description

Hi, I had build litecart wit docker on my Nas,I access litecart by Cloudflare Tunnel,But I canโ€™t configure the stripe Pay method.
Is there have a guide?

By the way.I want help translate litecart into Chinese,How can I do that?

Code Snippet (optional)

No response

Checklist:

  • I agree to follow litecart's Code of Conduct.
  • I have checked for existing issues that describe my questions prior to opening this one.
  • I understand that improperly formatted questions may be closed without explanation.

๐Ÿค— [Question]: building locally

Question Description

please can you add instructions for building locally
this will help those who wish to contribute to the project
I believe npm install yarn, yarn add vite and yarn build are at least required

Code Snippet (optional)

No response

Checklist:

  • I agree to follow litecart's Code of Conduct.
  • I have checked for existing issues that describe my questions prior to opening this one.
  • I understand that improperly formatted questions may be closed without explanation.

๐Ÿš€ [Feature]: Request for support for Easy Pay

Feature Description

It's heavily used in China. Requesting support. Thank you.

Official website๏ผšhttps://pay.cccyun.cc/
development documentation๏ผšhttps://pay.ivmei.cn/doc.html

Additional Context (optional)

thanks

Checklist:

  • I agree to follow litecart's Code of Conduct.
  • I have checked for existing issues that describe my suggestion prior to opening this one.
  • I understand that improperly formatted feature requests may be closed without explanation.

๐Ÿš€ [Feature]: Support for payment via Webhook

Feature Description

this is the simplest payment provider: a webhook

Basically, this payment provider just returns a {payment: 'success'} status e.g.

Reason: in the broadsense a transactio/payment can also mean 'entitled to download'.
Imagine a transaction which requires a somebody starring a github project, liking a post e.g.
Or even fictional currencies like kudos per users (in a db elsewhere).
Using this generic payment webhook, various other integrations could become possible (even proxying to payment provider-integrations which run elsewhere)

Additional Context (optional)

No response

Code Snippet (optional)

No response

Checklist:

  • I agree to follow litecart's Code of Conduct.
  • I have checked for existing issues that describe my suggestion prior to opening this one.
  • I understand that improperly formatted feature requests may be closed without explanation.

๐Ÿค— [Question]: stripe return parameter_invalid_empty

Question Description

Ver.0.1.3
stripe 400 Error

"description": "", is empty,but I had add the description
ITS WORK IN VER 0.1.2

Code Snippet (optional)

parameter_invalid_empty - line_items[0][price_data][product_data][description]
You passed an empty string for 'line_items[0][price_data][product_data][description]'. We assume empty values are an attempt to unset a parameter; however 'line_items[0][price_data][product_data][description]' cannot be unset. You should remove 'line_items[0][price_data][product_data][description]' from your request or supply a non-empty value.

Checklist:

  • I agree to follow litecart's Code of Conduct.
  • I have checked for existing issues that describe my questions prior to opening this one.
  • I understand that improperly formatted questions may be closed without explanation.

๐Ÿ› [Bug]: Internal server error adding new product

Bug Description

I started the server and added a new product. I clicked the "Add" button and it didn't appear to do anything. I clicked it again and then started getting this error. Here's a screenshot of the UI:

image

Log:

{"level":"info","ip":"127.0.0.1","latency":"881.549ยตs","status":200,"method":"POST","url":"/api/_/products","time":1722347820,"message":"Success"}
{"level":"error","caller":"/home/runner/work/litecart/litecart/internal/handlers/private/product.go:47","error":"constraint failed: UNIQUE constraint failed: product.slug (2067)","time":1722347823}

When I refreshed the page it turned out the product had already been crated.

How to Reproduce

  1. Go to the UI to add a product.
  2. Input some details and press "Save".
  3. Press "Save" again when it doesn't save.
  4. See the error.

Expected Behavior

If the product has been added I'd expect it to show up in the product list behind the form so it's clear it's already been added, and maybe a more informative error message telling me it's already been added. Maybe the button should be greyed out once clicked.

litecart Version

v0.1.12

Code Snippet (optional)

No response

Checklist:

  • I agree to follow litecart's Code of Conduct.
  • I have checked for existing issues that describe my problem prior to opening this one.
  • I understand that improperly formatted bug reports may be closed without explanation.

๐Ÿš€ [Feature]: More language support and more currency support

Feature Description

I've used this program successfully and it's very clean and fast. But there are too few things that can be customized, and the homepage is a little sketchy. The shopping cart is only in English, and the currency types are only USD and EUR, I hope to add support for RMB.There is no formatting support for the description page of the product, it is suggested to add markdown support.

Additional Context (optional)

No response

Code Snippet (optional)

No response

Checklist:

  • I agree to follow litecart's Code of Conduct.
  • I have checked for existing issues that describe my suggestion prior to opening this one.
  • I understand that improperly formatted feature requests may be closed without explanation.

๐Ÿ› [Bug]: Cant add paymethod spectrocoin

Bug Description

ERROR:

2024/01/09ย 11:10:40 | stdout | {"level":"warn","latency":"603.536ยตs","status":404,"method":"PATCH","url":"/api/_/settings","time":1704769840,"message":"Clientย error"} -- | -- | --

image

How to Reproduce

Steps to reproduce the behavior:
ADD NEW PAYMETHOD

Expected Behavior

NEW PAYMETHOD

litecart Version

v0.1.9

Code Snippet (optional)

2024/01/09ย 11:10:40 | stdout | {"level":"warn","latency":"603.536ยตs","status":404,"method":"PATCH","url":"/api/_/settings","time":1704769840,"message":"Clientย error"}
-- | -- | --

Checklist:

  • I agree to follow litecart's Code of Conduct.
  • I have checked for existing issues that describe my problem prior to opening this one.
  • I understand that improperly formatted bug reports may be closed without explanation.

๐Ÿ› [Bug]: First step after install

Bug Description

Invalid token, after installation and authorization in the admin.

Expected Behavior

Invalid token

litecart Version

v0.1.0

Checklist:

  • I agree to follow litecart's Code of Conduct.
  • I have checked for existing issues that describe my problem prior to opening this one.
  • I understand that improperly formatted bug reports may be closed without explanation.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.