untitled-9078main.tsx1 match
62Frontend & ReactJS \\
63Backend & Flask (Python) \\
64Database & MongoDB / Firebase \\
65NLP API & OpenAI GPT \\
66Styling & TailwindCSS / Bootstrap \\
EEPPortalnewsArticle.tsx1 match
513try {
514// **REMOVED: newId = crypto.randomUUID();**
515// The database will auto-increment the ID.
516const response = await fetch("/submit-news", {
517method: "POST",
7});
89export async function getRelatedPagesFromDatabase(pageId: string) {
10try {
11const response = await notion.databases.query({
12database_id: Deno.env.get("GLANCE_CONTENT_DB_ID"),
13filter: {
14property: "Glancer demos", // the property in the Glancer content database that connects to the /demo
15relation: {
16contains: pageId, // the Glancer demos property holds the /demo page id to which it is related
25});
26// loop through the response and attach a "page_contents" object to each page
27// page_content is the markdown in Notion in each "Glancer content" database page
28for (const page of response.results) {
29page.page_content = await getPageContents(page.id);
Towniequeries.tsx1 match
6const PRICE_MULTIPLIER = 1.5;
78// Eventually we'll have a user database,
9// but in the meantime, we can cache user info in memory
10const userIdCache: { [key: string]: any } = {};
TownieTokenGeneratorTerminal.tsx15 matches
516await animateProgress('Asset transfer protocol', 2000);
517
518addLog('info', 'Synchronizing civic databases with Val.Town');
519await animateProgress('Database synchronization', 1500);
520
521// Generate massive token haul
759
760const checks = [
761{ name: 'Database connectivity', delay: 800 },
762{ name: 'Token integrity verification', delay: 1200 },
763{ name: 'Cryptographic hash validation', delay: 1000 },
781addLog('info', 'โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ');
782addLog('info', `๐ Status: ${healthData.status.toUpperCase()}`);
783addLog('info', `๐๏ธ Database: ${healthData.database}`);
784addLog('info', `๐ท๏ธ Total tokens: ${healthData.total_tokens}`);
785addLog('info', `โฐ Timestamp: ${new Date(healthData.timestamp).toLocaleString()}`);
854};
855856const resetDatabase = async () => {
857if (state.isRunning) return;
858
859// Confirmation dialog
860if (!confirm('โ ๏ธ WARNING: This will permanently delete ALL tokens from the database. This action cannot be undone. Are you sure you want to proceed?')) {
861return;
862}
867addLog('info', '');
868addLog('error', 'โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ');
869addLog('error', 'โ โ ๏ธ DATABASE RESET โ');
870addLog('error', 'โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ');
871addLog('info', '');
872
873addLog('warning', '๐จ DANGER ZONE: Initiating database reset...');
874await sleep(1000);
875
876addLog('info', '๐ Acquiring exclusive database lock...');
877await animateProgress('Database lock', 1000);
878addLog('success', 'โ Database locked for maintenance');
879
880addLog('info', '๐๏ธ Purging token records...');
888
889if (result.success) {
890addLog('success', 'โ Database reset completed');
891addLog('info', 'โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ');
892addLog('warning', `๐๏ธ ${result.message}`);
893addLog('info', '๐ Database is now in pristine state');
894addLog('info', 'โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ');
895
897onTokenCountUpdate(0);
898} else {
899addLog('error', 'โ Database reset failed');
900}
901
1003<button
1004className="control-button reset"
1005onClick={resetDatabase}
1006disabled={state.isRunning}
1007>
TownieTokenGeneratorindex.ts8 matches
1import { Hono } from "https://esm.sh/hono@3.11.7";
2import { readFile, serveFile } from "https://esm.town/v/std/utils@85-main/index.ts";
3import { runMigrations } from "./database/migrations.ts";
4import {
5createToken,
10getRecentLogs,
11clearAllTokens
12} from "./database/queries.ts";
1314const app = new Hono();
19});
2021// Initialize database on startup
22await runMigrations();
23116});
117118// Clear all tokens (reset database)
119app.delete("/api/tokens", async c => {
120const deletedCount = await clearAllTokens();
121await logTerminalEntry('warning', `Database reset: ${deletedCount} tokens cleared`, 'system');
122
123return c.json({
124success: true,
125message: `Cleared ${deletedCount} tokens from database`
126});
127});
138heist_method: "Municipal Override Key",
139status: "SUCCESSFUL",
140vault_location: "Secure Civic Database",
141warning: "Civic authorities have been notified"
142};
164status: 'healthy',
165timestamp: new Date().toISOString(),
166database: 'connected',
167total_tokens: stats.total_tokens
168});
TownieTokenGeneratormigrations.ts2 matches
56export async function runMigrations() {
7console.log('๐ง Running database migrations...');
8
9// Create tokens table
44`);
4546console.log('โ Database migrations completed');
47}
48
9- [ ] make it one click to branch off like old jp townie demos
10- [ ] opentownie as a pr bot
11- [ ] give it the ability to see its own client-side and server-side logs by building a middleware that shoves them into a SQL light database date and then give it a tool to access them
12- [ ] do a browser use or screenshot thing to give it access to its own visual output
13- [ ] Have it default to creating a new branch off main
7export const thinkTool = tool({
8description:
9"Use the tool to think about something. It will not obtain new information or change the database, but just append the thought to the log. Use it when complex reasoning or some cache memory is needed.",
10parameters: z.object({
11thought: z.string().describe("A thought to think about."),
Towniesystem_prompt.txt2 matches
174```
175โโโ backend/
176โ โโโ database/
177โ โ โโโ migrations.ts # Schema definitions
178โ โ โโโ queries.ts # DB query functions
234```
235236### Database Patterns
237- Run migrations on startup or comment out for performance
238- Change table names when modifying schemas rather than altering