1e19e5e2dd29670da05f995ec775752463ebc080
Step Competition App
A modern, streamlined web application for hosting workplace step competitions with 48+ participants across multiple teams.
Features
3 Simple Tabs:
- Log Your Steps - Easy 2-step selection (team → name) + instant personal history view
- Team Standings - Combined team and individual leaderboards
- Competition Stats - Overall metrics and visual progress charts
Key Capabilities:
- CSV bulk import for quick setup (8 teams × 6 people = 48 participants)
- Team-first navigation makes finding your name fast
- Personal step history shown immediately after selecting your name
- Real-time leaderboards with gold/silver/bronze highlighting
- Visual charts showing team progress over time
- Mobile-friendly responsive design
- SQLite backend - no complex database setup
Quick Start
1. Install and Start
cd /home/sascha/gitea/step-competition
npm install
npm start
2. Setup Teams & Participants
Option A: CSV Import (Recommended for 48 people)
- Create a CSV file with 3 columns:
team_name,participant_name,email - See
sample_import.csvfor reference format - Open the app and go to "Log Your Steps" tab
- Scroll down to "Admin: Bulk Import" section
- Select your CSV file and click "Import CSV"
Example CSV format:
team_name,participant_name,email
Team Alpha,Alice Johnson,alice@example.com
Team Alpha,Bob Smith,bob@example.com
Team Beta,Carol Williams,carol@example.com
Option B: Use Sample Data
node sample-data.js
3. Start Logging Steps
For Participants:
- Open http://localhost:3060 (or your Tailscale URL)
- Select your team from dropdown
- Select your name from dropdown
- See your personal stats and history on the right
- Enter today's date and step count
- Click "Submit Steps"
For Viewing Results:
- Team Standings tab: See which teams and individuals are winning
- Competition Stats tab: View overall progress and charts
Accessing Remotely
The server listens on port 3060 and is accessible via:
Via Tailscale:
# Find your Tailscale IP
tailscale ip -4
# Share with participants
http://YOUR_TAILSCALE_IP:3060
Via Local Network:
# Find your local IP
hostname -I | awk '{print $1}'
# Share with participants
http://YOUR_LOCAL_IP:3060
CSV Import Format
Your CSV must have these exact column headers:
team_name- Name of the teamparticipant_name- Person's full nameemail- Email address (optional, can be empty)
The import will:
- Create teams automatically if they don't exist
- Add participants to their teams
- Skip duplicates (same name + team)
- Report how many teams and participants were created
Project Structure
step-competition/
├── src/
│ ├── server.js # Express server and API endpoints
│ └── database.js # SQLite database initialization
├── public/
│ ├── index.html # 3-tab interface
│ ├── styles.css # Responsive styling
│ └── app.js # Frontend JavaScript
├── sample_import.csv # Template for bulk import (8 teams, 48 people)
├── step_competition.db # SQLite database (auto-created)
└── README.md
API Endpoints
Teams & Participants
GET /api/teams- Get all teamsPOST /api/teams- Create a teamGET /api/participants- Get all participantsPOST /api/participants- Create a participantPOST /api/import/csv- Bulk import from CSVGET /api/participants/:id/history- Get participant's step history
Steps
POST /api/steps- Submit or update stepsGET /api/steps/:participantId/:date- Get steps for specific date
Leaderboards
GET /api/leaderboard/individual- Individual rankingsGET /api/leaderboard/team- Team rankingsGET /api/progress/daily- Daily progress data for charts
Configuration
Change Port:
Edit src/server.js line 8:
const PORT = process.env.PORT || 3060;
Or use environment variable:
PORT=8080 npm start
Database Schema
teams
id,name,created_at
participants
id,name,email,team_id,created_at
daily_steps
id,participant_id,date,steps,created_at,updated_at- Unique constraint on (participant_id, date)
Tips for Running a Competition
- Pre-populate: Use CSV import to set up all 48 participants before launch
- Test First: Import sample_import.csv and test with a few entries
- Share URL: Send the Tailscale or local network URL to all participants
- Daily Reminders: Encourage participants to log steps daily
- Showcase Leaderboards: Display the Team Standings tab on a monitor
- Backup Data: Periodically copy
step_competition.dbfile
Troubleshooting
CSV import fails:
- Check that your CSV has the exact column headers:
team_name,participant_name,email - Make sure there are no extra spaces or special characters
- Verify the file is saved as CSV format, not Excel
Can't find my name:
- Make sure you select the correct team first
- Names are listed alphabetically within each team
- Check that your name was imported correctly
Steps not saving:
- Verify you selected both team and name
- Check that you entered a valid number for steps
- Make sure the date is in the correct format
Port 3060 already in use:
- Change the PORT in src/server.js to another number (e.g., 3070)
- Or stop the other service using that port
Resetting the Competition
To start fresh:
rm step_competition.db
npm start
A new empty database will be created. You'll need to re-import your participants.
Browser Compatibility
Works with all modern browsers:
- Chrome/Edge (recommended)
- Firefox
- Safari
- Mobile browsers (iOS/Android)
License
ISC
Description
Languages
JavaScript
72.1%
CSS
17.5%
HTML
10.4%