A full-stack web application for tracking and analyzing athlete performance data, specifically focused on 10-yard fly time and vertical jump measurements.
- Dashboard: Overview of key performance metrics and recent activity
- Team Management: Create and manage teams with different levels (Club, HS, College)
- Player Management: Add players with team assignments and personal details
- Data Entry: Record measurements with validation and quick-add functionality
- Analytics: Advanced filtering, leaderboards, percentile analysis, and interactive charts
- Import/Export: CSV import with validation and preview, plus data export functionality
- Authentication: Simple admin login system
- React 18 with TypeScript
- Vite for fast development and building
- Tailwind CSS for styling
- shadcn/ui component library
- Chart.js via react-chartjs-2 for data visualization
- React Query for data fetching and caching
- Wouter for routing
- React Hook Form with Zod validation
- Node.js with Express
- TypeScript throughout
- Drizzle ORM with PostgreSQL
- Session-based authentication
- CSV parsing and generation
- Comprehensive REST API
- PostgreSQL (required for all environments)
- Drizzle ORM for type-safe database access
- Schema validation with Zod
-
Install dependencies:
npm install
-
Set up environment variables:
cp .env.example .env # Edit .env with your configuration -
Run database migrations:
npm run db:push
-
Start development server:
npm run dev
When deploying to production, you must set the following environment variables:
-
NODE_ENV=production- RECOMMENDED for production deployments- Enables production error handling (prevents sensitive error details from being exposed)
- Activates rate limiting protections
- Optimizes performance settings
- Note: If not set, the application defaults to
productionmode for safety. However, explicitly setting it is recommended for clarity.
-
DATABASE_URL- PostgreSQL connection string (SQLite is no longer supported) -
NEON_TIER- IMPORTANT for Neon PostgreSQL deployments- Options:
"free","pro", or"scale" - Default:
"pro"if not set - Free tier: 1 connection limit - set
NEON_TIER=freeto prevent connection exhaustion - Pro tier: Up to 20 connections - set
NEON_TIER=pro(default) - Scale tier: Up to 100+ connections - set
NEON_TIER=scale - This optimizes connection pooling for your Neon plan and prevents unexpected costs
- See Neon connection pooling docs
- Options:
-
SESSION_SECRET- Secure random string for session encryption -
ADMIN_USERandADMIN_PASS- Admin credentials
Heroku:
heroku config:set NODE_ENV=production
heroku config:set DATABASE_URL="postgresql://..."
heroku config:set NEON_TIER="pro" # Set to match your Neon plan
heroku config:set SESSION_SECRET="..."Docker:
ENV NODE_ENV=production
ENV DATABASE_URL="postgresql://..."
ENV NEON_TIER="pro"Replit: Set environment variables in the Secrets tab:
NODE_ENV=productionDATABASE_URL=postgresql://...NEON_TIER=pro(orfree/scalebased on your Neon plan)
Other platforms: Consult your platform's documentation for setting environment variables.
npm run build
npm startThe application has built-in safeguards to prevent this, but always double-check your DATABASE_URL.
# Run unit tests (no database required)
npm run test:unit
# For integration tests, create local test database
createdb athletemetrics_test
# Copy test environment template
cp .env.test.example .env.test
# Run all tests
npm test # All tests (unit + integration)
npm run test:integration # Integration tests only (requires PostgreSQL)Unit Tests: Run without a database. Test React components, utilities, and pure logic with mocked dependencies.
Integration Tests: Automatically validate that BLOCKS execution if:
DATABASE_URLis not setDATABASE_URLcontains:railway.app,neon.tech,prod,stagingDATABASE_URLdoesn't include:localhostortest
If tests were accidentally run against production:
- Run audit script:
tsx scripts/audit-test-data.ts - Backup database:
pg_dump $DATABASE_URL > backup.sql - Run cleanup:
CONFIRM_CLEANUP=yes tsx scripts/cleanup-test-data.ts
For comprehensive testing documentation, see docs/TESTING.md which includes:
- Local test database setup
- Docker PostgreSQL configuration
- CI/CD integration
- Test data cleanup procedures
- Troubleshooting guide
- Best practices
Tests run automatically in GitHub Actions with ephemeral PostgreSQL containers. No manual configuration needed for pull requests - see .github/workflows/pr-checks.yml.