Skip to content

Commit

Permalink
📃 docs: small update
Browse files Browse the repository at this point in the history
  • Loading branch information
shurco committed Sep 29, 2023
1 parent 34bc1f0 commit 0682c86
Show file tree
Hide file tree
Showing 9 changed files with 174 additions and 155 deletions.
1 change: 1 addition & 0 deletions .github/media/platforms/apple.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions .github/media/platforms/docker.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions .github/media/platforms/linux.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions .github/media/platforms/windows.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ go.work

cmd/__debug_bin*
cmd/main
cmd/cmd
cmd/lc_*/
cmd/site/
fixtures/migration/*_private.sql
Expand Down
111 changes: 59 additions & 52 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,41 +22,51 @@ Litecart is an open source shopping-cart in 1 file of embedded database (SQLite)

## 🏆  Features

- 🚀 Simple and fast one-click installation
- 💰 Support for popular payment systems
- 🔑 Support for selling both files and license keys
- ⚙️ Uses SQLite instead of heavy databases like Mysql, Postgresql, MongoDB
- ☁️ Lightweight website that can be easily modified
- 🧞‍♂️Convenient administration panel
- ⚡️ Works on any hardware, server
- 🔒 Built-in support for HTTPS
- [x] 🚀 Simple and fast one-click installation
- [x] 💰 Support for popular payment systems
- [x] 🔑 Support for selling both files and license keys
- [x] ⚙️ Uses SQLite instead of heavy databases like Mysql, Postgresql, MongoDB
- [x] ☁️ Lightweight website that can be easily modified
- [x] 🧞‍♂️Convenient administration panel
- [x] ⚡️ Works on any hardware, server
- [x] 🔒 Built-in support for HTTPS


## 🏁  Installation
## ⬇️  Installation

## MacOS
`litecart` is engineered for easy installation and operation, requiring just a single command from your terminal. Besides the conventional installation method, `litecart` can also be set up and operated via HomeBrew, Docker, or any other container orchestration tools like Docker Compose, Docker Swarm, Rancher, or Kubernetes.

#### <img width="20" src="/.github/media/platforms/apple.svg">&nbsp;Install on macOS
The fastest method to install `litecart` on macOS involves using Homebrew. This will install the command-line tools and the `litecart` server as a combined executable. If you don't utilize Homebrew, adhere to the Linux instructions below for `litecart` installation.
```shell
brew install shurco/tap/litecart
```

Alternately, you can configure the tap and install the package separately:

``` shell
$ brew tap shurco/tap
$ brew install litecart
```


## Linux/MacOS/Windows
#### <img width="20" src="/.github/media/platforms/linux.svg">&nbsp;Install on Linux
The most straightforward and recommended method to start using `litecart` on Unix operating systems involves installing and utilizing the `litecart` command-line tool. Execute the given command in your terminal and adhere to the instructions displayed on the screen.

Download the [latest release here](https://github.com/shurco/litecart/releases/latest)
```bash
curl -L https://raw.githubusercontent.com/shurco/litecart/main/scripts/install | sh
```

#### <img width="20" src="/.github/media/platforms/windows.svg">&nbsp;Install on Windows
The simplest and most recommended method to start using `litecart` on Windows is by installing and utilizing the `litecart` command-line tool. Execute the given command in your terminal and adhere to the instructions displayed on the screen.
```bash
curl -L https://raw.githubusercontent.com/shurco/litecart/main/scripts/install | sh
```
or download and unzip the [latest version](https://github.com/shurco/litecart/releases/latest) for Windows.

## Try using Docker
Want to give litecart a quick spin on your local machine? You can run the following command from your terminal to have litecart up and running right away.

**For Docker hub containers:**
#### <img width="20" src="/.github/media/platforms/docker.svg">&nbsp;Run using Docker
Docker enables the management and operation of a Litecart instance without requiring the installation of any command-line tools. The Litecart Docker container includes all necessary command-line tools or even for server execution.

```bash
docker run \
--name litecart \
Expand All @@ -67,8 +77,8 @@ docker run \
-v ./lc_uploads:./lc_uploads \
shurco/litecart:latest
```
or

**For Github containers:**
```bash
docker run \
--name litecart \
Expand All @@ -81,40 +91,11 @@ docker run \
```


## 📚&nbsp;&nbsp;Documentation
```
🛒 litecart - shopping-cart in 1 file
Usage:
litecart [command]
Available Commands:
serve Starts the web server (default to 0.0.0.0:8080)
Flags:
-h, --help help for litecart
-v, --version version for litecart
Use "litecart [command] --help" for more information about a command.
```

Parameters for `serve` command:
```
Starts the web server (default to 0.0.0.0:8080)
Usage:
litecart serve [flags]
Flags:
-h, --help help for serve
--http string server address (default "0.0.0.0:8080")
--https string HTTPS server address (auto TLS)
--no-site disable create site
```

## 🚀&nbsp;&nbsp;Getting started
Getting started with litecart is as easy as starting up the litecart server

Default run for Linux/MacOS:
```
Default run for Linux/macOS:
```bash
./litecart serve
```

Expand All @@ -134,9 +115,36 @@ If you need to run on a different port, use the flag `--http`:

> ⚠️&nbsp;&nbsp; Ports <= 1024 are privileged ports. You can't use them unless you're root or have the explicit permission to use them. See this answer for an explanation or wikipedia or something you trust more. Use:
**sudo setcap 'cap_net_bind_service=+ep' /path_to/litecart**
>
## 📚&nbsp;&nbsp;Commands
Usage:
```
./litecart [command] [flags]
```

Available commands:
```
init Init structure
serve Starts the web server (default to 0.0.0.0:8080)
update Update app to the latest version
```

Global flags `./litecart [flags]`:
```
-h, --help help for litecart
-v, --version version for litecart
```

## 🗺️&nbsp;&nbsp;Roadmap
Serve flags `./litecart serve [flags]`:
```
--http string server address (default "0.0.0.0:8080")
--https string HTTPS server address (auto TLS)
--no-site disable create site
```


## 🗺️&nbsp;&nbsp;ToDo
- [x] Product in the form of files
- [x] Product in the form of license keys
- [ ] Product returned via API to another site (example license keys)
Expand All @@ -159,4 +167,3 @@ If you want to say **thank you** and/or support the active development of `litec
4. Support the project by donating a [cup of coffee](https://github.com/sponsors/shurco).

You can learn more about how you can contribute to this project in the [contribution guide](https://github.com/shurco/litecart/blob/master/.github/CONTRIBUTING.md).

110 changes: 110 additions & 0 deletions scripts/install
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
#!/usr/bin/env sh

install() {
command -v uname >/dev/null 2>&1 || {
err "Error: you need to have 'uname' installed and in your path"
}
command -v tar >/dev/null 2>&1 || {
err "Error: you need to have 'tar' installed and in your path"
}
command -v unzip >/dev/null 2>&1 || {
err "Error: you need to have 'unzip' installed and in your path"
}

local _cmd
if command -v curl >/dev/null 2>&1; then
_cmd=curl
elif command -v wget >/dev/null 2>&1; then
_cmd=wget
else
err "Error: you need to have 'curl' or 'wget' installed and in your path"
fi

get_latest_release() {
echo $(curl --silent "https://api.github.com/repos/$1/releases/latest" |
grep '"tag_name":' |
sed -E 's/.*"([^"]+)".*/\1/')
}

echo "Fetching the latest version..."
local _ver
if [ "$_cmd" = curl ]; then
_ver=$(curl --silent "https://api.github.com/repos/shurco/litecart/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/' | sed -E 's/.{,1}//') || {
err "Error: could not fetch the latest litecart version number"
}
elif [ "$_cmd" = wget ]; then
_ver=$(wget -qO- "https://api.github.com/repos/shurco/litecart/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/' | sed -E 's/.{,1}//') || {
err "Error: could not fetch the latest litecart version number"
}
fi

echo "Fetching the host system architecture..."
local _oss
local _cpu
local _arc

_oss="$(uname -s)"
_cpu="$(uname -m)"

case "$_oss" in
Linux) _oss=linux ;;
Darwin) _oss=darwin ;;
MINGW* | MSYS* | CYGWIN*) _oss=windows ;;
*) err "Error: unsupported operating system: $_oss" ;;
esac
case "$_cpu" in
arm64 | aarch64) _cpu=arm64 ;;
x86_64 | x86-64 | x64 | amd64) _cpu=amd64 ;;
*) err "Error: unsupported CPU architecture: $_cpu" ;;
esac
_arc="${_oss}-${_cpu}"

local _ext
case "$_oss" in
linux) _ext="tar.gz" ;;
darwin) _ext="tar.gz" ;;
windows) _ext="zip" ;;
esac

local _url
_url="https://github.com/shurco/litecart/releases/download/v${_ver}/litecart_${_ver}_${_arc}.${_ext}"

echo "Installing litecart_${_ver} for ${_arc}..."
if [ "$_cmd" = curl ]; then
curl --silent --fail --location "$_url" --output "litecart_${_ver}.${_arc}.${_ext}" || {
err "Error: could not fetch the latest litecart file"
}
elif [ "$_cmd" = wget ]; then
wget --quiet "$_url" -O "litecart_${_ver}.${_arc}.${_ext}" || {
err "Error: could not fetch the latest litecart file"
}
fi

if [ "$_ext" = "zip" ]; then
unzip -o "litecart_${_ver}.${_arc}.${_ext}" || {
err "Error: unable to extract the downloaded archive file"
}
else
tar -zxf "litecart_${_ver}.${_arc}.${_ext}" || {
err "Error: unable to extract the downloaded archive file"
}
fi

rm -rf "litecart_${_ver}.${_arc}.${_ext}"

echo ""
echo "litecart successfully installed"
echo ""
echo "To see the command-line options run:"
echo " ./litecart --help"
echo "To start server run:"
echo " ./litecart serve"
echo ""
exit 0
}

err() {
echo "$1" >&2 && exit 1
}

install "$@" || exit 1
3 changes: 0 additions & 3 deletions web/site/layouts/clear.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@
<script src="/assets/js/main.js" type="module"></script>
<link href="/assets/css/style.css" rel="stylesheet">
<link href="/assets/css/main.css" rel="stylesheet">
<script>
const { onMounted, onUpdated, onUnmounted, ref, getCurrentInstance } = Vue;
</script>
</head>

<body>
Expand Down
Loading

0 comments on commit 0682c86

Please sign in to comment.