Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
5c0d2ee
chore(docker): add production compose and nginx config
wmhchathuranga Jul 31, 2025
4088e2b
chore(docker): add production compose and nginx config and updated MD
wmhchathuranga Aug 1, 2025
5971077
chore(docker): add production compose and nginx config and updated do…
wmhchathuranga Aug 1, 2025
31402e4
chore(docker): add production compose and nginx config and updated do…
wmhchathuranga Aug 1, 2025
8106ce4
chore(docker): add production compose and nginx config and updated do…
wmhchathuranga Aug 1, 2025
8a1e4f2
chore(docker): add production compose and nginx config and updated do…
wmhchathuranga Aug 1, 2025
5e18137
chore(docker): add production compose and nginx config and updated do…
wmhchathuranga Aug 1, 2025
705d1f3
chore(docker): add production compose and nginx config and updated do…
wmhchathuranga Aug 1, 2025
e442ee1
chore: updated .env.example to fix the refis issue
wmhchathuranga Aug 7, 2025
832e287
chore: updated Readme.md - Start analytics
wmhchathuranga Aug 7, 2025
9fb7958
chore: updated Flag and IP added
wmhchathuranga Aug 18, 2025
ee9174f
chore: updated Flag and IP added
wmhchathuranga Aug 18, 2025
c7265b3
chore: updated Flag and IP added
wmhchathuranga Aug 18, 2025
0896475
chore: updated Flag and IP added
wmhchathuranga Aug 18, 2025
6ae5433
chore: updated Flag and IP added
wmhchathuranga Aug 18, 2025
008c826
chore: updated Flag and IP added
wmhchathuranga Aug 18, 2025
15f9b79
chore: updated Flag and IP added
wmhchathuranga Aug 18, 2025
3935b33
chore: updated Flag and IP added
wmhchathuranga Aug 18, 2025
8be2c4c
chore: flag icon
wmhchathuranga Aug 18, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 27 additions & 16 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
APP_NAME=Laravel
APP_ENV=local
APP_KEY=
APP_KEY=base64:gJfQiLAc+AgXNseszAHy1K88Y/6oEFmpflBKul2eXsI=
APP_DEBUG=true
APP_TIMEZONE=UTC
APP_URL=http://localhost
Expand All @@ -22,42 +22,43 @@ LOG_DEPRECATIONS_CHANNEL=null
LOG_LEVEL=debug

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_HOST=mysql
DB_PORT=3306
DB_DATABASE=lua.sh
DB_USERNAME=root
DB_PASSWORD=
DB_DATABASE=lua_sh
DB_USERNAME=sail
DB_PASSWORD=root

SESSION_DRIVER=database
SESSION_LIFETIME=120
SESSION_ENCRYPT=false
SESSION_PATH=/
SESSION_DOMAIN=null

BROADCAST_CONNECTION=log
BROADCAST_CONNECTION=pusher
FILESYSTEM_DISK=local
QUEUE_CONNECTION=database

CACHE_STORE=database
CACHE_STORE=redis
CACHE_PREFIX=

MEMCACHED_HOST=127.0.0.1

REDIS_CLIENT=phpredis
REDIS_HOST=127.0.0.1
REDIS_HOST=redis
REDIS_PASSWORD=null
REDIS_PORT=6379

RESEND_API_KEY=

MAIL_MAILER=log
MAIL_HOST=127.0.0.1
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS="hello@example.com"
MAIL_FROM_NAME="${APP_NAME}"
MAIL_MAILER=smtp
MAIL_SCHEME=null
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
MAIL_USERNAME=
MAIL_PASSWORD=
# MAIL_ENCRYPTION=null
# MAIL_FROM_ADDRESS="hello@example.com"
MAIL_FROM_NAME="lua"

AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
Expand All @@ -69,3 +70,13 @@ SENTRY_LARAVEL_DSN=
SENTRY_TRACES_SAMPLE_RATE=1.0

VITE_APP_NAME="${APP_NAME}"

WWWUSER=1000
WWWGROUP=1000

PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_APP_CLUSTER=

VITE_REVERB_APP_KEY="${PUSHER_APP_KEY}"
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,5 @@ yarn-error.log
/.idea
/.vscode
/.zed
package-lock.json
composer.lock
36 changes: 36 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# ---------- 1) Composer deps ----------
FROM composer:2 AS vendor
WORKDIR /app
COPY composer.json composer.lock ./
RUN composer install --no-dev --prefer-dist --no-scripts --no-progress --no-interaction
COPY . .
RUN composer install --no-dev --prefer-dist --optimize-autoloader --no-progress --no-interaction

# ---------- 2) Frontend build ----------
FROM node:20-alpine AS frontend
WORKDIR /app
COPY package.json package-lock.json* ./
RUN npm ci
COPY . .
RUN npm run build

# ---------- 3) PHP runtime (FPM) ----------
FROM php:8.3-fpm-alpine AS app
WORKDIR /var/www/html

# System libs & PHP extensions
RUN apk add --no-cache bash libjpeg-turbo-dev libpng-dev libzip-dev oniguruma-dev icu-dev \
&& docker-php-ext-configure gd \
&& docker-php-ext-install pdo_mysql gd opcache intl zip

# Copy app code & built assets
COPY --from=vendor /app /var/www/html
COPY --from=frontend /app/public/build /var/www/html/public/build

# Permissions for Laravel
RUN mkdir -p storage/framework/{cache,sessions,views} storage/logs bootstrap/cache \
&& chown -R www-data:www-data /var/www/html

# FPM listens on 9000
EXPOSE 9000
CMD ["php-fpm", "-F"]
112 changes: 112 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,115 @@ For self-hosting or local development, please check the [Self Hosting](https://d
A big thanks to our sponsors and partners who make Lua possible. If you're interested in sponsoring Lua and supporting the project, please check out our profile on [GitHub sponsors](https://github.com/sponsors/luadotsh) ❤️

[mercantive.com](https://mercantive.com) • [changelogfy.com](https://changelogfy.com)


## ⚡ Quick Start

| Step | Command |
|------|--------|
| Clone the repo | `git clone https://github.com/wmhchathuranga/lua.sh.git && cd lua.sh` |
| Copy env file | `cp .env.example .env` and update the .env |
| Install PHP deps | `composer install` *(or Sail Composer)* |
| Start Docker | `docker compose -f docker-compose.yml up -d --build` |
| Laravel setup | `./vendor/bin/sail artisan key:generate && ./vendor/bin/sail artisan migrate --seed && ./vendor/bin/sail artisan storage:link` |
| Frontend setup | `./vendor/bin/sail npm ci && ./vendor/bin/sail npm i -D tailwindcss@^3 postcss@^8 autoprefixer@^10 && ./vendor/bin/sail npm run dev` |
| Start Analytics | `./vendor/bin/sail artisan queue:work` |
| Access app | [http://localhost](http://localhost) |

---

## 🚀 Installation

Follow these steps for a full local development environment:

### **Prerequisites**
- [Docker](https://www.docker.com/products/docker-desktop)
- Docker Compose plugin
- Git
- Node.js & npm *(optional if using Sail’s Node image)*
- Composer *(optional if using Sail’s Composer image)*

---

### **1️⃣ Clone & Configure**
```bash
git clone https://github.com/wmhchathuranga/lua.sh.git lua.sh
cd lua.sh

# Copy environment
cp .env.example .env
```
And update the .env
---

### **2️⃣ Install PHP Dependencies**
```bash
composer install
```

---

### **3️⃣ Start the Docker Stack**
```bash
docker compose -f docker-compose.yml up -d --build
```

Verify services:
```bash
./vendor/bin/sail ps
```

---

### **4️⃣ Laravel Setup**
```bash
./vendor/bin/sail artisan key:generate
./vendor/bin/sail artisan migrate --seed
./vendor/bin/sail artisan storage:link
```

---

### **5️⃣ Install Frontend**
```bash
./vendor/bin/sail npm ci

# Ensure compatible TailwindCSS version
./vendor/bin/sail npm i -D tailwindcss@^3 postcss@^8 autoprefixer@^10

# Run Vite dev server
./vendor/bin/sail npm run dev
```

---

### **✅ Access Your App**
- **Application:** [http://localhost](http://localhost)
- **MailHog (emails):** [http://localhost:8025](http://localhost:8025)

---

## 🔹 Useful Commands

| Task | Command |
|-----------------------------|-----------------------------------------------|
| Stop containers | `./vendor/bin/sail down` |
| Rebuild without cache | `./vendor/bin/sail build --no-cache` |
| Laravel logs | `./vendor/bin/sail logs -f laravel.test` |
| Queue worker (dev) | `./vendor/bin/sail artisan queue:work` |
| Fresh DB migration & seed | `./vendor/bin/sail artisan migrate:fresh --seed` |
| Clear caches | `./vendor/bin/sail artisan config:clear && ./vendor/bin/sail artisan cache:clear` |

---
```
1. cp .env.example .env
2. composer i
3. docker compose -f docker-compose.yml up -d --build
4. ./vendor/bin/sail ps
5. ./vendor/bin/sail artisan key:generate
6. ./vendor/bin/sail artisan migrate --seed
7. ./vendor/bin/sail artisan storage:link
8. ./vendor/bin/sail npm ci
9. ./vendor/bin/sail npm i -D tailwindcss@^3 postcss@^8 autoprefixer@^10
10. ./vendor/bin/sail npm run dev
```
2 changes: 1 addition & 1 deletion app/Http/Controllers/RedirectController.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function redirect(Request $request, $key = null): RedirectResponse
$link,
$request->userAgent(),
$request->getLanguages(),
$request->ip(),
$request->header('CF-Connecting-IP'),
$request->input('qr') ? true : false,
$utms,
$request->header('Referer')
Expand Down
Loading