Build configuration
Prerequisites
DoctorSoft+ requires Node.js 18 or higher for building and deployment.
- Node.js 18+ installed
- All required environment variables configured
- A Supabase project set up with the correct URL and anon key
Build process
Configure environment variables
Set up all required environment variables for your deployment platform. See the Environment Variables page for the complete list.
Build the application
Run the build command to compile TypeScript and bundle the application:This command:
- Runs TypeScript compilation (
tsc) - Bundles the application using Vite
- Optimizes assets and splits code into chunks
- Outputs the production build to the
distdirectory
Build settings summary
| Setting | Value |
|---|---|
| Build command | npm run build |
| Output directory | dist |
| Node version | 18+ |
| Package manager | npm |
Code splitting strategy
The Vite configuration includes intelligent code splitting to optimize load times:- vendor-react: Core React and ReactDOM
- vendor-router: React Router
- vendor-supabase: Supabase client
- vendor-query: TanStack Query
- vendor-forms: Form handling (react-hook-form, Zod)
- vendor-editor: Rich text editor (lazy loaded)
- vendor-charts: Chart.js (lazy loaded)
- vendor-calendar: FullCalendar (lazy loaded)
- vendor-dnd: Drag and drop utilities
Deployment platforms
DoctorSoft+ can be deployed to various platforms:Netlify
Deploy to Netlify with automatic deployments and easy configuration
Vercel
Deploy to Vercel with optimized edge network and instant rollbacks
Docker
Containerize your application for self-hosted deployments
Post-deployment verification
After deploying to any platform, verify the following:Authentication works
Test the login functionality to ensure Supabase authentication is working correctly.
Troubleshooting
Blank page after deployment
Common causes:- Missing environment variables
- Incorrect Supabase URL or anon key
- SPA routing not configured (missing
_redirectsfile) - Build failed but deployment continued
- Check browser console for specific error messages
- Verify all environment variables are set correctly
- Ensure the
distfolder contains the_redirectsfile - Review build logs for TypeScript or bundling errors
Supabase connection error
Common causes:- Environment variables not set in deployment platform
- Supabase project is paused or deleted
- Invalid Supabase URL or anon key
- Network/firewall issues blocking Supabase
- Verify
VITE_SUPABASE_URLandVITE_SUPABASE_ANON_KEYin your platform settings - Check that your Supabase project is active at https://supabase.com/dashboard
- Confirm the anon key matches your project’s key
- Test the Supabase URL directly in your browser
File upload errors
Common causes:- Incorrect bucket name in
VITE_BUCKET_NAME - Storage bucket doesn’t exist in Supabase
- Row Level Security (RLS) policies blocking uploads
- File size exceeds
VITE_MAX_FILE_SIZE_MBlimit
- Verify the bucket name matches your Supabase Storage bucket
- Check that the bucket exists in Supabase Dashboard > Storage
- Review RLS policies to ensure authenticated users can upload
- Adjust
VITE_MAX_FILE_SIZE_MBif needed for larger files
Local development
To test the application locally before deployment:http://localhost:5173.
To preview the production build locally:
Next steps
Environment Variables
Configure all required environment variables
Deploy to Netlify
Step-by-step Netlify deployment guide
Deploy to Vercel
Step-by-step Vercel deployment guide
Docker Deployment
Containerize and deploy with Docker