Prerequisites
Before you begin, ensure you have the following installed on your system:- Node.js v18 or higher (v24.13.1 recommended)
- MySQL 8.0 or higher
- npm or bun package manager
- Git for version control
Clone the Repository
Clone the OdontologyApp repository to your local machine:Install Dependencies
Install the project dependencies using your preferred package manager:Database Setup
Import the Schema
Import the database schema from the provided SQL file:This will create all necessary tables including:
branches- Clinic branchesusers- System users (admin, doctors, secretaries)doctors- Doctor-specific informationpatients- Patient recordsappointments- Appointment schedulingmedical_records- Clinical records- And more…
Environment Configuration
Create a.env file in the root directory with your database credentials:
The application uses SvelteKit’s
$env/static/private module to load environment variables. Make sure your .env file is in the project root and never commit it to version control.Run Development Server
Start the development server:- Local:
http://localhost:5173 - Network:
http://<your-ip>:5173
--host flag in the dev script allows access from other devices on your network.
Available Scripts
The following npm scripts are available inpackage.json:
| Script | Command | Description |
|---|---|---|
dev | vite dev --host | Start development server with network access |
build | vite build | Build for production |
preview | vite preview | Preview production build locally |
check | svelte-kit sync && svelte-check | Type check the application |
check:watch | svelte-kit sync && svelte-check --watch | Type check in watch mode |
prepare | svelte-kit sync | Sync SvelteKit types |
Verify Installation
Check Server Status
Ensure the dev server is running without errors and displays the SvelteKit startup message.
Project Structure
Troubleshooting
Database connection errors
Database connection errors
- Verify MySQL is running:
sudo systemctl status mysql - Check credentials in
.envfile - Ensure database
ontology_dbexists - Verify user has proper permissions
Port already in use
Port already in use
If port 5173 is already in use, Vite will automatically try the next available port. Check the terminal output for the actual port.
Module not found errors
Module not found errors
Run
npm install again to ensure all dependencies are installed. Clear node_modules and reinstall if issues persist:Type checking errors
Type checking errors
Run
npm run check to see all type errors. The application uses JSDoc for type annotations, so check your IDE’s TypeScript support is enabled.Next Steps
Contributing Guide
Learn how to contribute to the project
Testing Guide
Understand the testing approach
Deployment
Deploy to production
Architecture
Explore the system architecture
