mirror of
https://github.com/rishikanthc/Scriberr.git
synced 2026-03-03 00:27:01 +00:00
feat: redesign icon logo and implement independent dev workflow
This commit is contained in:
committed by
Rishikanth Chandrasekaran
parent
7deff5b903
commit
56b9eda843
26
.air.toml
Normal file
26
.air.toml
Normal file
@@ -0,0 +1,26 @@
|
||||
root = "."
|
||||
tmp_dir = "tmp"
|
||||
|
||||
[build]
|
||||
cmd = "go build -o ./tmp/main ./cmd/server/main.go"
|
||||
bin = "./tmp/main"
|
||||
full_bin = ""
|
||||
include_ext = ["go", "tpl", "tmpl", "html"]
|
||||
exclude_dir = ["data", "full_db_backups", "internal/web/dist", "web", "assets", "tmp", "vendor", "node_modules"]
|
||||
include_dir = []
|
||||
exclude_file = []
|
||||
delay = 1000 # ms
|
||||
stop_on_error = true
|
||||
log = "air_errors.log"
|
||||
|
||||
[log]
|
||||
time = true
|
||||
|
||||
[color]
|
||||
main = "magenta"
|
||||
watcher = "cyan"
|
||||
build = "yellow"
|
||||
runner = "green"
|
||||
|
||||
[misc]
|
||||
clean_on_exit = true
|
||||
84
dev.sh
Executable file
84
dev.sh
Executable file
@@ -0,0 +1,84 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Scriberr Development Environment Script
|
||||
# This script starts both the Go backend (with Air live reload) and the React frontend (with Vite HMR) concurrently.
|
||||
|
||||
set -e
|
||||
|
||||
# --- Helper Functions ---
|
||||
|
||||
cleanup() {
|
||||
echo ""
|
||||
echo "🛑 Stopping development servers..."
|
||||
kill $(jobs -p) 2>/dev/null || true
|
||||
echo "✅ Stopped."
|
||||
exit 0
|
||||
}
|
||||
|
||||
# Trap signals for cleanup
|
||||
trap cleanup SIGINT SIGTERM
|
||||
|
||||
# --- Step 1: Ensure Air is installed ---
|
||||
|
||||
if ! command -v air &> /dev/null; then
|
||||
echo "⚠️ 'air' command not found."
|
||||
echo "📦 Auto-installing 'air' for live reload..."
|
||||
|
||||
# Check if GOPATH/bin is in PATH
|
||||
GOPATH=$(go env GOPATH)
|
||||
if [[ ":$PATH:" != *":$GOPATH/bin:"* ]]; then
|
||||
echo "⚠️ $GOPATH/bin is not in your PATH. Adding it temporarily..."
|
||||
export PATH=$PATH:$GOPATH/bin
|
||||
fi
|
||||
|
||||
go install github.com/air-verse/air@latest
|
||||
|
||||
if ! command -v air &> /dev/null; then
|
||||
echo "❌ Failed to install 'air'. Please install it manually: go install github.com/air-verse/air@latest"
|
||||
echo "🔄 Falling back to 'go run' (no live reload for backend)..."
|
||||
USE_GO_RUN=true
|
||||
else
|
||||
echo "✅ 'air' installed successfully."
|
||||
USE_GO_RUN=false
|
||||
fi
|
||||
else
|
||||
USE_GO_RUN=false
|
||||
fi
|
||||
|
||||
# --- Step 2: Ensure Embed Directory Exists & is Populated ---
|
||||
|
||||
DIST_DIR="internal/web/dist"
|
||||
if [ ! -d "$DIST_DIR" ]; then
|
||||
echo "📁 Creating placeholder dist directory for Go embed..."
|
||||
mkdir -p "$DIST_DIR"
|
||||
fi
|
||||
|
||||
# Go's embed directive requires at least one file to match "dist/*"
|
||||
# If the directory is empty, create a dummy file to prevent compilation errors.
|
||||
if [ -z "$(ls -A $DIST_DIR)" ]; then
|
||||
echo "📄 Creating dummy index.html to satisfy embed directive..."
|
||||
echo "<!-- Placeholder for development. In dev mode, the frontend is served by Vite proxy. -->" > "$DIST_DIR/index.html"
|
||||
# Also add a dummy asset to satisfy the static routes if needed
|
||||
echo "placeholder" > "$DIST_DIR/dummy_asset"
|
||||
fi
|
||||
|
||||
# --- Step 3: Start Servers ---
|
||||
|
||||
echo "🚀 Starting development environment..."
|
||||
|
||||
# Start Backend
|
||||
if [ "$USE_GO_RUN" = true ]; then
|
||||
echo "🔧 Starting Go backend (standard run)..."
|
||||
go run cmd/server/main.go &
|
||||
else
|
||||
echo "🔥 Starting Go backend (with Air live reload)..."
|
||||
air &
|
||||
fi
|
||||
|
||||
# Start Frontend
|
||||
echo "⚛️ Starting React frontend (Vite)..."
|
||||
cd web/frontend
|
||||
npm run dev &
|
||||
|
||||
# Wait for all background processes
|
||||
wait
|
||||
@@ -25,10 +25,8 @@ export function ScriberrLogo({ className = "", onClick }: { className?: string;
|
||||
}
|
||||
}}
|
||||
>
|
||||
<ScriberrIcon className="h-8 w-auto select-none transition-all duration-300" />
|
||||
|
||||
{/* Text Logo - Temporarily hidden */}
|
||||
<ScriberrTextLogo className="h-4 sm:h-6 w-auto" />
|
||||
<ScriberrIcon className="h-8 w-auto sm:h-9 select-none transition-all duration-300" />
|
||||
<ScriberrTextLogo className="hidden sm:block sm:h-5 w-auto" />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -118,7 +118,8 @@
|
||||
:root {
|
||||
/* --- BRAND IDENTITY --- */
|
||||
/* Extracted from your logo */
|
||||
--brand-gradient: linear-gradient(135deg, #FFAB40 0%, #FF3D00 100%);
|
||||
/* --brand-gradient: linear-gradient(135deg, #FFAB40 0%, #FF3D00 100%); */
|
||||
--brand-gradient: linear-gradient(135deg, #FF9800 0%, #FF3D00 100%);
|
||||
--brand-solid: #FF6D20;
|
||||
/* The midpoint color for text/icons */
|
||||
--brand-light: rgba(255, 171, 64, 0.12);
|
||||
|
||||
@@ -63,5 +63,29 @@ export default defineConfig({
|
||||
// Improve performance by optimizing chunk sizes
|
||||
chunkSizeWarningLimit: 1000,
|
||||
},
|
||||
server: {
|
||||
proxy: {
|
||||
'/api': {
|
||||
target: 'http://localhost:8080',
|
||||
changeOrigin: true,
|
||||
},
|
||||
'/health': {
|
||||
target: 'http://localhost:8080',
|
||||
changeOrigin: true,
|
||||
},
|
||||
'/swagger': {
|
||||
target: 'http://localhost:8080',
|
||||
changeOrigin: true,
|
||||
},
|
||||
'/install.sh': {
|
||||
target: 'http://localhost:8080',
|
||||
changeOrigin: true,
|
||||
},
|
||||
'/install-cli.sh': {
|
||||
target: 'http://localhost:8080',
|
||||
changeOrigin: true,
|
||||
}
|
||||
}
|
||||
},
|
||||
base: "/",
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user