Skip to content

Commit 8c64bc2

Browse files
committed
chore(dev): add development tooling and automation
- Add .nvmrc to enforce Node 14 requirement - Add .prettierrc for consistent code formatting - Add setup-dev.sh for automated project setup - Validates Node version - Installs dependencies - Creates config.json from template - Provides clear instructions Improves developer onboarding and prevents Node version issues.
1 parent 91710ee commit 8c64bc2

File tree

3 files changed

+49
-0
lines changed

3 files changed

+49
-0
lines changed

.nvmrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
14
2+

.prettierrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"parser": "babel"
3+
}
4+

setup-dev.sh

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#!/bin/bash
2+
# Development setup script for timetracker-ui
3+
4+
set -e
5+
6+
echo "🚀 Setting up timetracker-ui for development..."
7+
8+
# Check Node version
9+
NODE_VERSION=$(node -v | cut -d'v' -f2 | cut -d'.' -f1)
10+
if [ "$NODE_VERSION" -lt 14 ] || [ "$NODE_VERSION" -gt 16 ]; then
11+
echo "⚠️ Warning: Node $NODE_VERSION detected. This project requires Node 14-16."
12+
echo " Run 'nvm use 14' to switch to the correct version."
13+
exit 1
14+
fi
15+
16+
echo "✅ Node $(node -v) detected"
17+
18+
# Install dependencies
19+
echo "📦 Installing dependencies..."
20+
npm install
21+
22+
# Create config.json if it doesn't exist
23+
if [ ! -f "static/config.json" ]; then
24+
echo "📝 Creating static/config.json from template..."
25+
cp static/config.json.dist static/config.json
26+
echo "✅ Created static/config.json (you can customize this file)"
27+
else
28+
echo "✅ static/config.json already exists"
29+
fi
30+
31+
# Install proxy service dependencies
32+
echo "📦 Installing proxy service dependencies..."
33+
cd srv && npm install
34+
cd ..
35+
36+
echo ""
37+
echo "✅ Setup complete! You can now run:"
38+
echo ""
39+
echo " TIMETRACKER_URL=https://tt.netresearch.de/ npm run dev"
40+
echo ""
41+
echo " The dev server will start on http://0.0.0.0:8081"
42+
echo ""
43+

0 commit comments

Comments
 (0)