Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,13 @@ cp .env.example .env
npm run db:push
```

5. Start the development server:
5. (Optional) Seed demo tournaments:

```bash
npm run seed
```

6. Start the development server:

```bash
npm run dev
Expand All @@ -99,6 +105,7 @@ The application will be available at `http://localhost:5173`
- `npm run start` - Start production server
- `npm run check` - Type check with TypeScript
- `npm run db:push` - Push database schema changes
- `npm run seed` - Seed demo tournaments with sample data

## 🏆 Tournament Features

Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"lint:check": "eslint . --max-warnings=0",
"prepare": "if [ -z \"$CI\" ]; then npm run validate; fi",
"start": "NODE_ENV=production node dist/index.js",
"seed": "NODE_ENV=development tsx server/seed.ts",
"test": "echo \"Add test script here\"",
"test:coverage": "echo \"Add test coverage script here\"",
"type-check": "tsc --noEmit",
Expand Down
3 changes: 3 additions & 0 deletions server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ npm run start
# Push schema changes to database
npm run db:push

# Seed demo tournaments (optional)
npm run seed

# View database configuration
cat drizzle.config.ts
```
Expand Down
14 changes: 14 additions & 0 deletions server/seed.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { storage } from './storage';

async function seed() {
try {
await storage.initializeData();
console.log('Sample tournaments seeded successfully.');
process.exit(0);
} catch (error) {
console.error('Failed to seed demo tournaments:', error);
process.exit(1);
}
}

seed();
3 changes: 0 additions & 3 deletions server/storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,3 @@ export class DatabaseStorage implements IStorage {
}

export const storage = new DatabaseStorage();

// Initialize sample data on startup
storage.initializeData().catch(console.error);
Loading