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
2,935 changes: 1,783 additions & 1,152 deletions shatter-backend/package-lock.json

Large diffs are not rendered by default.

10 changes: 6 additions & 4 deletions shatter-backend/package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "shatter-backend",
"version": "1.0.0",
"main": "index.js",
"main": "dist/server.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"dev": "ts-node-dev --respawn --transpile-only src/server.ts",
"dev": "tsx watch src/server.ts",
"build": "tsc",
"start": "node dist/server.js"
},
Expand All @@ -13,6 +13,7 @@
"license": "ISC",
"description": "",
"dependencies": {
"@google/genai": "^1.41.0",
"axios": "^1.13.5",
"bcryptjs": "^3.0.3",
"cors": "^2.8.5",
Expand All @@ -22,7 +23,8 @@
"mongoose": "^8.19.2",
"pusher": "^5.3.2",
"socket.io": "^4.8.1",
"zod": "^4.1.12"
"zod": "^4.3.6",
"zod-to-json-schema": "^3.25.1"
},
"devDependencies": {
"@eslint/js": "^9.38.0",
Expand All @@ -34,7 +36,7 @@
"eslint": "^9.38.0",
"globals": "^16.4.0",
"jiti": "^2.6.1",
"ts-node-dev": "^2.0.0",
"tsx": "^4.21.0",
"typescript": "^5.9.3",
"typescript-eslint": "^8.46.2"
}
Expand Down
74 changes: 74 additions & 0 deletions shatter-backend/src/ai/prompt_builder.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
/**
* Prompt builder utility class.
*
* Allows incremental construction of a prompt string
* from multiple parts, joined by a configurable separator.
*/
export class Prompt {

private promptParts: string[];
private separator: string;
private promptString: string;


/**
* Creates a new Prompt instance.
*
* @param arr - Initial array of prompt parts.
* @param separator - String used to separate parts when generating the full prompt.
*/
public constructor(arr: string[] = [], separator: string = "\n\n") {
this.promptParts = arr;
this.separator = separator;
this.promptString = arr.join(this.separator);
}

/**
* Returns the current array of prompt parts.
*
* @returns Array of prompt segments.
*/
public getPromptParts(): string[] {
return this.promptParts;
}

/**
* Replaces the current prompt parts with a new array
* and regenerates the full prompt string.
*
* @param arr - New array of prompt segments.
*/
public setPromptParts(arr: string[]): void {
this.promptParts = arr;
this.generatePrompt();
}

/**
* Adds a new part to the prompt and regenerates
* the full prompt string.
*
* @param part - A string segment to append to the prompt.
*/
public addPart(part: string): void {
this.promptParts.push(part);
this.generatePrompt();
}

/**
* Regenerates the full prompt string by joining
* all prompt parts using the configured separator.
*/
public generatePrompt(): void {
this.promptString = this.promptParts.join(this.separator);
}

/**
* Returns the fully generated prompt string.
*
* @returns The complete prompt as a single string.
*/
public getPrompt(): string {
return this.promptString;
}

}
83 changes: 83 additions & 0 deletions shatter-backend/src/ai/prompts/bingo.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
Generate creative bingo entries based on the provided event context.

Goal
Create short bingo squares that describe recognizable moments, traits, or behaviors of professionals at the event.

Length
- 3–8 words per entry.
- Keep entries concise and punchy.

Key Rule: Be Specific
Entries must describe a concrete behavior, situation, or trait someone could realistically notice at the event.

Avoid vague descriptions of conversation.

Avoid phrases like:
- "talking about"
- "discusses"
- "mentions"
- "asks"
- "conversation about"
- "debates"
- "connects on"
- "networking with"

These are too generic and do not describe an observable bingo moment.

Instead prefer:

Observable behaviors
Work-related habits
Professional traits
Real situations that happen during networking
Work artifacts or tools someone references or shows

Good structural patterns

Action
Shows photos of a recent project
Sketches an idea on a napkin
Explains how their team works

Situation
Runs into a former coworker
Recognizes someone from online
Arrives straight from work

Work artifact
Laptop covered in stickers
Shows a product demo
Pulls up slides on their phone

Professional trait
Always “too busy lately”
Recently started a new role
Proud of their latest project

Quote
Has said: "It's been a crazy week"
Has said: "We're hiring right now"

Context usage
Use the provided event context to inspire industry-relevant references when appropriate.

Examples
Shows photos of a recent project
Sketches an idea while talking
Proud of their latest work
Runs into someone they know
Recently changed jobs
Laptop covered in company stickers
Shows a demo on their phone
Explains a project they built
Has said: "It's been a long week"

Avoid
- Generic phrases describing conversation
- Things that always happen at networking events (ex: exchanging LinkedIn)
- Overly abstract statements
- Repeating the same structure across many entries

Diversity rule
Ensure entries vary in structure, wording, and situation.
No more than two entries may begin with the same first word.
Loading
Loading