Val Town Code SearchReturn to Val Town

API Access

You can access search results via JSON API by adding format=json to your query:

https://codesearch.val.run/$%7Bart_info.art.src%7D?q=database&page=210&format=json

For typeahead suggestions, use the /typeahead endpoint:

https://codesearch.val.run/typeahead?q=database

Returns an array of strings in format "username" or "username/projectName"

Found 7792 results for "database"(1798ms)

untitled-4063models.ts1 match

@rohitr21โ€ขUpdated 2 weeks ago
1// Database models and data access layer for the GYM Management System
2
3import {

untitled-4063README.md7 matches

@rohitr21โ€ขUpdated 2 weeks ago
17- **Frontend**: React 18.2.0 with TypeScript
18- **Backend**: Hono.js API framework
19- **Database**: Firebase Firestore
20- **Authentication**: Firebase Auth
21- **Styling**: TailwindCSS
80```
81โ”œโ”€โ”€ backend/
82โ”‚ โ”œโ”€โ”€ database/
83โ”‚ โ”‚ โ”œโ”€โ”€ firebase.ts # Firebase configuration
84โ”‚ โ”‚ โ”œโ”€โ”€ models.ts # Data models and types
85โ”‚ โ”‚ โ””โ”€โ”€ queries.ts # Database query functions
86โ”‚ โ”œโ”€โ”€ routes/
87โ”‚ โ”‚ โ”œโ”€โ”€ admin.ts # Admin routes
1452. **Configure Firebase**:
146 - Create a new Firebase project
147 - Enable Firestore Database
148 - Enable Authentication (Email/Password)
149 - Add environment variables to Val Town
177#### Data Integrity Tests
178- โœ… Input validation
179- โœ… Database constraints
180- โœ… Error handling
181- โœ… Data backup and recovery
204- **Serverless**: Val Town's serverless architecture for auto-scaling
205- **CDN**: Static assets served via CDN
206- **Database Indexing**: Optimized Firestore queries
207- **Caching**: Client-side caching for frequently accessed data
208
209### Database Optimizations
210- **Compound Queries**: Efficient Firestore query patterns
211- **Pagination**: Large datasets handled with pagination

taskswapindex.ts8 matches

@vishuu6969696969โ€ขUpdated 2 weeks ago
2
3import { Hono } from "https://esm.sh/hono@3.11.7";
4import { runMigrations, seedDatabase } from "./database/migrations.ts";
5import auth from "./routes/auth.ts";
6import tasks from "./routes/tasks.ts";
16});
17
18// Initialize database on startup
19let dbInitialized = false;
20
21async function initializeDatabase() {
22 if (!dbInitialized) {
23 console.log('Initializing TaskSwap database...');
24 await runMigrations();
25 await seedDatabase();
26 dbInitialized = true;
27 console.log('Database initialization complete');
28 }
29}
30
31// Middleware to ensure database is initialized
32app.use('*', async (c, next) => {
33 await initializeDatabase();
34 await next();
35});

taskswapmessages.ts1 match

@vishuu6969696969โ€ขUpdated 2 weeks ago
8 getTaskMessages,
9 getTaskById
10} from "../database/queries.ts";
11
12const messages = new Hono();

taskswapusers.ts1 match

@vishuu6969696969โ€ขUpdated 2 weeks ago
4import type { ApiResponse } from "../../shared/types.ts";
5import { requireAuth } from "./auth.ts";
6import { getUserById, getTasks } from "../database/queries.ts";
7
8const users = new Hono();

taskswaptasks.ts1 match

@vishuu6969696969โ€ขUpdated 2 weeks ago
11 updateUserTokens,
12 createExchange
13} from "../database/queries.ts";
14
15const tasks = new Hono();

taskswapauth.ts1 match

@vishuu6969696969โ€ขUpdated 2 weeks ago
12 getSessionUser,
13 deleteSession
14} from "../database/queries.ts";
15
16const auth = new Hono();

taskswapqueries.ts1 match

@vishuu6969696969โ€ขUpdated 2 weeks ago
1// Database query functions for TaskSwap
2
3import { sqlite } from "https://esm.town/v/stevekrouse/sqlite";

taskswapmigrations.ts7 matches

@vishuu6969696969โ€ขUpdated 2 weeks ago
1// Database migrations for TaskSwap
2
3import { sqlite } from "https://esm.town/v/stevekrouse/sqlite";
4
5export async function runMigrations() {
6 console.log('Running database migrations...');
7
8 // Users table
105 await sqlite.execute(`CREATE INDEX IF NOT EXISTS idx_sessions_expires ON sessions(expires_at)`);
106
107 console.log('Database migrations completed successfully');
108}
109
110// Seed data for development
111export async function seedDatabase() {
112 console.log('Seeding database with sample data...');
113
114 // Check if we already have users
115 const existingUsers = await sqlite.execute('SELECT COUNT(*) as count FROM users');
116 if (existingUsers[0].count > 0) {
117 console.log('Database already seeded, skipping...');
118 return;
119 }
220 }
221
222 console.log('Database seeded successfully');
223}

taskswapREADME.md5 matches

@vishuu6969696969โ€ขUpdated 2 weeks ago
16```
17โ”œโ”€โ”€ backend/
18โ”‚ โ”œโ”€โ”€ database/
19โ”‚ โ”‚ โ”œโ”€โ”€ migrations.ts # Database schema
20โ”‚ โ”‚ โ””โ”€โ”€ queries.ts # Database operations
21โ”‚ โ”œโ”€โ”€ routes/
22โ”‚ โ”‚ โ”œโ”€โ”€ auth.ts # Authentication endpoints
44- **Backend**: Hono (TypeScript API framework)
45- **Frontend**: React 18.2.0 with TypeScript
46- **Database**: SQLite with Val Town's sqlite service
47- **Styling**: TailwindCSS with custom design system
48- **Authentication**: Simple token-based auth
58
591. The app runs on Val Town's platform
602. Database tables are auto-created on first run
613. Visit the app URL to start using TaskSwap
624. Create a profile and start posting or browsing tasks

bookmarksDatabase

@s3thiโ€ขUpdated 4 months ago

sqLiteDatabase1 file match

@ideofunkโ€ขUpdated 7 months ago