FirstProjectmigrations.ts1 match
8* Initialize database tables
9*/
10export async function initializeDatabase() {
11// Create job postings table
12await sqlite.execute(`
FirstProjectREADME.md1 match
19โ โโโ database/
20โ โ โโโ migrations.ts # Schema definitions
21โ โ โโโ queries.ts # DB query functions
22โ โโโ routes/
23โ โ โโโ jobs.ts # Job posting routes
JobPlatformapp.js16 matches
21init();
2223async function init() {
24// Set view source link
25setViewSourceLink();
41}
4243function setViewSourceLink() {
44// Get the current URL and convert it to Val Town URL
45const currentUrl = window.location.href;
4950// Event Listeners
51function setupEventListeners() {
52// Job form submission
53jobForm.addEventListener('submit', async (e) => {
82}
8384// Job Functions
85async function loadJobs() {
86try {
87const response = await fetch('/api/jobs');
111}
112113async function submitJobPosting() {
114try {
115const formData = {
148}
149150// Chat Functions
151function enableChat() {
152usernameContainer.innerHTML = `<p class="text-sm text-gray-600">Chatting as: <span class="font-semibold">${escapeHtml(username)}</span> <button id="change-username" class="text-blue-600 text-xs hover:underline">Change</button></p>`;
153
185}
186187async function loadChatMessages() {
188try {
189const response = await fetch('/api/chat');
210}
211212function renderChatMessages(messages) {
213chatMessages.innerHTML = messages.map(msg => `
214<div class="chat-message ${msg.username === username ? 'text-right' : ''}">
225}
226227function startChatPolling() {
228// Clear any existing interval
229if (chatPollingInterval) {
273}
274275async function sendChatMessage() {
276const message = chatInput.value.trim();
277if (!message || !username) return;
306}
307308// Utility Functions
309function formatDate(timestamp) {
310if (!timestamp) return 'Unknown';
311
318}
319320function formatTime(timestamp) {
321if (!timestamp) return '';
322
328}
329330function escapeHtml(str) {
331if (!str) return '';
332return str
JobPlatformqueries.ts6 matches
2021// Job posting queries
22export async function createJob(job: JobPosting): Promise<number> {
23const result = await sqlite.execute(
24`INSERT INTO ${JOBS_TABLE} (title, company, description, contact)
30}
3132export async function getJobs(): Promise<JobPosting[]> {
33const result = await sqlite.execute(
34`SELECT * FROM ${JOBS_TABLE} ORDER BY created_at DESC`
37}
3839export async function getJob(id: number): Promise<JobPosting | null> {
40const result = await sqlite.execute(
41`SELECT * FROM ${JOBS_TABLE} WHERE id = ?`,
4647// Chat message queries
48export async function createChatMessage(message: ChatMessage): Promise<number> {
49const result = await sqlite.execute(
50`INSERT INTO ${CHAT_TABLE} (username, message)
56}
5758export async function getChatMessages(limit = 50): Promise<ChatMessage[]> {
59const result = await sqlite.execute(
60`SELECT * FROM ${CHAT_TABLE}
66}
6768export async function getRecentChatMessages(
69since: number,
70limit = 50
JobPlatformmigrations.ts1 match
8* Run database migrations to set up the schema
9*/
10export async function runMigrations() {
11// Create jobs table
12await sqlite.execute(`
JobPlatformREADME.md1 match
19โ โโโ database/
20โ โ โโโ migrations.ts # Schema definitions
21โ โ โโโ queries.ts # DB query functions
22โ โโโ routes/ # Route modules
23โ โ โโโ jobs.ts # Job posting endpoints
67- `types.ts` - TypeScript interfaces and types used throughout the application
8- `utils.ts` - Utility functions used by both frontend and backend
910## Types
AkashJobForm.tsx1 match
377- Design and implement new features for our web applications
378- Write clean, maintainable, and efficient code
379- Collaborate with cross-functional teams to define and implement new features
380- Troubleshoot and fix bugs in existing applications
381- Mentor junior developers and conduct code reviews`,
8* Scores a resume against job requirements
9*/
10export function scoreResume(resume: Resume, jobRequirement: JobRequirement): ScoringResult {
11if (!resume.parsedData) {
12throw new Error("Resume must be parsed before scoring");
57* Calculates skill matches between resume skills and job requirements
58*/
59function calculateSkillMatches(
60candidateSkills: string[],
61requiredSkills: string[],
110* Calculates experience relevance based on job title and description
111*/
112function calculateExperienceRelevance(
113experiences: { company: string; title: string; description: string }[],
114jobTitle: string,
135* Calculates education relevance (simplified)
136*/
137function calculateEducationRelevance(
138education: { institution: string; degree: string; field?: string }[]
139): number {
166* Uses AI to generate personalized feedback for a candidate
167*/
168export async function generateCandidateFeedback(
169resume: Resume,
170jobRequirement: JobRequirement,
7* Parses resume text using OpenAI to extract structured information
8*/
9export async function parseResume(resumeText: string): Promise<ParsedResumeData> {
10try {
11const prompt = `
85* Extracts contact information from resume text
86*/
87export async function extractContactInfo(resumeText: string): Promise<{ name: string; email: string; phone?: string }> {
88try {
89const prompt = `