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/?q=database&page=273&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 8428 results for "database"(6854ms)

untitled-4063members.ts2 matches

@rohitr21โ€ขUpdated 1 month ago
2
3import { Hono } from "https://esm.sh/hono@3.11.7";
4import { memberModel, billModel, feePackageModel } from "../database/models.ts";
5import { logger } from "../utils/logger.ts";
6import {
58 const members = await memberModel.search(filters);
59
60 // Simple pagination (in production, use database-level pagination)
61 const startIndex = (page - 1) * limit;
62 const endIndex = startIndex + limit;

untitled-4063auth.ts7 matches

@rohitr21โ€ขUpdated 1 month ago
8 sendPasswordResetEmail
9} from "https://esm.sh/firebase@10.7.1/auth";
10import { auth } from "../database/firebase.ts";
11import { userModel } from "../database/models.ts";
12import { logger } from "../utils/logger.ts";
13import {
58 const firebaseUser = userCredential.user;
59
60 // Get user data from database
61 const userData = await userModel.findByEmail(email);
62
63 if (!userData) {
64 logger.security('User not found in database during login', {
65 email,
66 firebaseUid: firebaseUser.uid
210 const firebaseUser = userCredential.user;
211
212 // Create user in database
213 const userId = await userModel.create({
214 email,
360 }
361
362 // Check if user exists in our database
363 const userData = await userModel.findByEmail(email);
364 if (!userData) {
474 }
475
476 // Update user in database
477 await userModel.update(c.user!.uid, { email });
478

untitled-4063models.ts1 match

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

untitled-4063README.md7 matches

@rohitr21โ€ขUpdated 1 month 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 1 month 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 1 month ago
8 getTaskMessages,
9 getTaskById
10} from "../database/queries.ts";
11
12const messages = new Hono();

taskswapusers.ts1 match

@vishuu6969696969โ€ขUpdated 1 month 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 1 month ago
11 updateUserTokens,
12 createExchange
13} from "../database/queries.ts";
14
15const tasks = new Hono();

taskswapauth.ts1 match

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

taskswapqueries.ts1 match

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

customer-database-setup2 file matches

@stevenvapiโ€ขUpdated 1 week ago

prDatabase

@pdwโ€ขUpdated 2 weeks ago