MediVault is an advanced, real-time medicine reservation, search, and inventory management application designed for pharmacies and campus health centers. It integrates intelligent features like AI-driven symptom search, prescription text extraction, simple medical explanations, and automatic refill reminders.
Built with Svelte v5, Convex, ShadCN UI, Bun, and the Gemini/Codex API.
- Secure Authentication: Custom email/password verification using secure password hashing.
- Smart Directory Search: Browse and search medicines, filterable and sortable by symptoms, prescription requirements, and current stock availability.
- Prescription Vault: Securely upload prescription documents/photos. Link them to reservations of restricted medicines when required.
- Drug Interaction Warning (Wow Factor):
- Intra-Cart Warning: Alerts you if two medicines currently in your cart interact negatively.
- Order History Warning: Cross-checks new items against medicines ordered within the last 7 days.
- Refill Reminders: Predicts when a user's medicine supply is running low based on dosage and order cycles, triggering timely reminders.
- Reservation Workflow: Review customer orders, approve or reject restricted items based on vault-linked prescriptions.
- Inventory & Expiry Tracker: Manage stock, log expiry dates, and review upcoming low stock alerts.
- Customer Medical Records: Review a customer's historic orders and interaction profile flags.
- User Management: Create, delete, or promote users to pharmacist roles.
- Catalog Management: Full CRUD operations on medicines, categorization, and drug interaction rule mappings.
- Inventory Dashboard: Comprehensive reporting on sales, low stock, and expiring inventory.
MediVault/
├── bun.lockb
├── package.json
├── svelte.config.js
├── tailwind.config.js
├── vite.config.js
├── README.md
├── convex/ # Convex Database & Serverless Logic
│ ├── schema.ts # Typed database schema
│ ├── users.ts # Auth and User CRUD queries & mutations
│ ├── medicines.ts # Medicine catalogue functions & filters
│ ├── reservations.ts # Cart & checkout mutations
│ ├── notifications.ts # Real-time event notifications
│ └── ai.ts # Actions interfacing with external AI LLMs
├── src/
│ ├── app.html
│ ├── app.css # Centralized global CSS stylesheet (no scattered styles)
│ ├── lib/
│ │ ├── components/ # UI components (shadcn & customized layout blocks)
│ │ ├── convexClient.ts # Convex initialization configuration
│ │ └── utils/ # Helper scripts (e.g. drug interaction checker)
│ └── routes/ # SvelteKit Layout-Group Routes
│ ├── (public)/ # Landing page, about pages
│ ├── (auth)/ # Login & registration portals
│ ├── (app)/ # Customer dashboard, cart, prescriptions vault, history
│ ├── (pharmacist)/ # Pharmacist orders manager, inventory tracker
│ ├── (admin)/ # Admins dashboard, user manager, database managers
│ └── api/ # API layer endpoints (AI tools & cron tasks)
To prevent fragmented styling:
- No Scattered Styles: Inline styles or component-level
<style>tags are strictly avoided. - Global Theme Definition: All CSS variable custom tokens (such as harmonious HSL colors, dark modes, animations, font definitions) are maintained inside a single entry stylesheet:
👉
src/app.css - Tailwind Integration: Tailwind utility classes are combined with these central variables to build interactive, polished interfaces.
MediVault runs using Bun as the primary runtime and package manager.
Make sure you have Bun installed.
-
Install Dependencies:
bun install
OR
bun run setup
-
Initialize Convex Dev Environment: Run the Convex development server. This configures database schemas and updates generated helper client bindings:
bun run convex dev
-
Start the Frontend Development Server: Launch the SvelteKit Vite dev server:
bun run dev
-
Run Integration and Automated Tests: Automatically test app modules, schema configurations, and UI routing to find and fix bugs:
# Run Vitest unit & schema integration tests bun run test:unit --run # Run Playwright E2E verification tests bun run test:e2e