That's fantastic! Congratulations, that's a massive achievement. Going back to fix the AI integration is exactly what hackathons are all about.
Here is the updated submission text. I've re-written the "What it does," "How we built it," "Challenges," "Accomplishments," "What we learned," and "What's next" sections to fully include your successful AI integration.
Inspiration For the "When Worlds Collide" theme, we were inspired by the collision of two isolated "worlds": the fast-paced, high-stress Student World and the Senior World, which is rich with life experience but often suffers from social isolation. Students need perspective, and seniors have perspective to give. Our app is the bridge that smashes these two worlds together for mutual benefit.
What it does Aura Connect is an AI-powered, real-time web platform that connects university students with senior citizen listeners for on-demand, 10-minute wellness chats.
Users register as either a "Student" or "Senior," and their account (including their name, user type, and personal interests) is stored in an SQLite database.
When a student requests a chat, our PHP-based "Agent" matches them with an available senior. This agent is Agentic AI:
It reads both users' profiles and interests (e.g., Student: "Mental Health", Senior: "Mentorship").
It sends this context to the Google Gemini API with a custom prompt.
The AI generates a personalized, real-time icebreaker on the spot.
Both users are then redirected to a private chat room, where the AI's custom message is waiting as the first message, and the chat correctly shows both users' real first names.
How we built it We built Aura Connect as a full-stack, "vanilla" PHP application integrated with a generative AI.
Back-End: PHP 8+
Database: SQLite for all user accounts, roles, and interests.
Front-End: "Vanilla" JavaScript (ES6+), Tailwind CSS, and HTML.
Routing: A custom Front Controller (index.php) directs all page views and API calls.
Agentic AI & Matchmaking: We built a custom "Agent" that uses two systems:
Generative AI: An ai_service.php file securely calls the Google Gemini API to generate personalized icebreakers based on user interests.
Real-Time State: We use a state.json file (now with a richer structure for names and interests) as a real-time state manager. Asynchronous JavaScript (fetch) polls our PHP API for updates.
Data Integrity: To prevent corruption from simultaneous requests, we implemented PHP's file-locking (flock()) on all state and chat files, creating a "wait-in-line" queue for all server actions.
Challenges we ran into The "Race Condition": Our biggest challenge. When a student and senior matched at the same time, they would both try to write to the state.json file, and the last one to save would overwrite the other. A match would never be made.
Solution: We re-architected the back-end to use a state_utils.php helper. This helper uses PHP's flock() function to "lock" the file, forcing one process to finish writing before the other can start. This 100% solved the corruption.
The "500 Fatal Error" (AI Integration): Our initial attempts to integrate the Gemini AI caused a fatal 500 Internal Server Error, breaking the chat.
Solution: We enabled PHP's display_errors and traced the crash. We discovered our chat helper file (chat_log_utils.php) was not "bulletproof"—it was failing when trying to read an empty or null file (before the AI had time to write to it). We re-wrote the helper to safely handle null or empty files, which fixed the crash and allowed the AI to function.
The "Zombie Session": When testing, we found one browser tab (Student) would suddenly become the other (Senior). We learned that all browser tabs share one PHP Session.
Solution: We had to learn to test like real-world users, using an Incognito Window or a completely different browser to create a second, separate user session.
Accomplishments that we're proud of We Successfully Integrated Agentic AI: We didn't just "use" an AI. We built an intelligent agent that reads dynamic user data (names and interests) from our database, passes it to the Gemini API, and pipes the response directly into the chat room. We're incredibly proud of debugging this complex, asynchronous-feeling process in a pure PHP environment.
We Defeated a Server-Side Race Condition: Figuring out and implementing the flock() solution was a major technical breakthrough that shows a deep understanding of server-side state.
A Full-Stack, Database-Driven App: We built a complete system from scratch with a secure SQLite database, user registration, password hashing, protected routes, and session management.
We Fixed the "Alex" Bug: We successfully upgraded our entire state management system to pass real user names and interests, making the chat experience fully personalized.
What we learned File locking (flock) is not optional when dealing with state files. It's the only way to prevent race conditions.
How to Debug a "Black Box": When the AI calls failed with a 500 error, we learned to stop guessing. We had to trace the failure from the fetch call to the PHP include and finally to a single helper function that couldn't handle an empty file. It taught us to build our helper functions to be "bulletproof."
How to properly test a login system. You must use separate browser sessions (like Incognito) to simulate two different users.
What's next for Aura Connect Now that our AI-powered platform is stable, we have a clear roadmap.
True Interest-Based Matching: Upgrade the matchmaking from "first-available" to a true, interest-based system. This involves using our SQLite database as the queue, allowing the agent to run a query like SELECT * FROM senior_queue WHERE interest = 'student_interest'.
User Dashboards: Build a personal dashboard where a user can see their chat history and "favorite" or save key insights from their conversations.
WebSockets: To scale up, we would replace the polling system with a Node.js WebSocket server for zero-latency messaging.

Log in or sign up for Devpost to join the conversation.