HealthVault Web Frontend
A modern, responsive Svelte web application for the HealthVault medical chat system.
Features
- š User Authentication - Register, login, and secure session management
- š¬ Real-time Chat - Chat with AI medical assistant about medicines
- š± Responsive Design - Works perfectly on desktop, tablet, and mobile
- šØ Modern UI - Beautiful glass-morphism design with Tailwind CSS
- š¾ Conversation History - Save and manage chat conversations locally
- ā” Fast Performance - Built with Vite for lightning-fast development
Quick Start
Install dependencies:
npm install
Configure Environment Variables:
cp .env.example .env
# Edit .env and update VITE_API_KEY with your actual API key
Start development server:
npm run dev
Open your browser:
Navigate to http://localhost:3000
API Configuration
The application is configured to connect to:
- Backend URL:
https://google-hackathon-henna.vercel.app
- API Key: Update in the store files (see Quick Start step 2)
Tech Stack
- Frontend: Svelte 4 + Vite
- Styling: Tailwind CSS + Glass-morphism effects
- Icons: Lucide Svelte
- State Management: Svelte stores
- Storage: Browser localStorage
- Authentication: JWT tokens
Architecture
src/
āāā lib/
ā āāā components/ # Reusable UI components
ā ā āāā AuthForm.svelte # Login/Register form
ā ā āāā ChatInput.svelte # Message input with send button
ā ā āāā ChatMessage.svelte # Individual chat message bubble
ā ā āāā ConversationList.svelte # Sidebar conversation history
ā āāā stores/ # Svelte stores for state management
ā āāā auth.js # Authentication state and API calls
ā āāā chat.js # Chat state and conversation management
āāā App.svelte # Main application component
āāā main.js # Application entry point
āāā app.css # Global styles and Tailwind imports
Key Features
Authentication System
- JWT token-based authentication
- Persistent login sessions
- Form validation with real-time feedback
- Secure password handling
Chat Interface
- Beautiful message bubbles with gradients
- Click-to-copy functionality
- Auto-scrolling to new messages
- Typing indicators and loading states
- Professional medical assistant responses
Conversation Management
- Create new conversations
- Browse conversation history
- Delete individual conversations
- Search and filter conversations
- Automatic conversation titles
Responsive Design
- Mobile-first approach
- Collapsible sidebar on mobile
- Touch-friendly interactions
- Optimized for all screen sizes
Development
# Start development server
npm run dev
# Build for production
npm run build
# Preview production build
npm run preview
# Run deployment setup
./setup-deployment.sh
Deployment
Quick Deploy to Render
Run setup script:
./setup-deployment.sh
Push to Git:
git add .
git commit -m "Ready for deployment"
git push origin main
Deploy on Render:
- Connect your repository at render.com
- Render will auto-detect the configuration
- Set environment variables in dashboard
- Deploy!
For detailed instructions, see DEPLOYMENT.md
Other Hosting Options
- Vercel: Connect repository for automatic deployments
- Netlify: Drag and drop the
dist
folder
- GitHub Pages: Use GitHub Actions for CI/CD
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
License
MIT License - see LICENSE file for details