Quickstart Guide
Get your Clínica Vitalis instance up and running quickly with this comprehensive setup guide.Prerequisites
Before you begin, ensure you have the following installed:- Node.js (v16 or higher)
- pnpm (v10.20.0 or higher) - Package manager
- Git - For cloning the repository
This project uses pnpm as the package manager. If you don’t have it installed, run:
npm install -g pnpmInstallation
Install Backend Dependencies
Navigate to the backend directory and install dependencies:This will install all required backend packages including:
- Express for the API server
- Sequelize ORM for database operations
- JWT for authentication
- bcryptjs for password hashing
- express-validator for input validation
Configure Environment Variables
Create a The backend uses SQLite, so no additional database configuration is needed. The database file will be created automatically on first run.
.env file in the backend directory with the following configuration:Start the Backend Server
Start the Express backend server:Or for development with auto-reload:You should see:The backend API will be available at
http://localhost:8080Install Frontend Dependencies
Open a new terminal, navigate to the frontend directory, and install dependencies:This will install:
- React 19 and React DOM
- Redux Toolkit for state management
- Material-UI components
- React Router for navigation
- And other frontend dependencies
Start the Frontend Development Server
Launch the Vite development server:The application will start and be available at
http://localhost:5173 (default Vite port)Create Your First Admin User
To access the platform, you need to register an admin user. Make a POST request to the registration endpoint:Or use the registration form in the frontend interface at
http://localhost:5173/registerVerify Installation
After completing the setup, verify everything is working:Backend Health Check
The backend exposes several API endpoints. Verify they’re accessible:Frontend Access
- Open your browser to
http://localhost:5173 - You should see the Clínica Vitalis login page
- Login with your admin credentials
- You should be redirected to the dashboard
API Endpoints Overview
The backend provides the following RESTful API endpoints:| Endpoint | Description |
|---|---|
/auth/register | Register new users |
/auth/login | Authenticate and receive JWT |
/professionals | Manage medical professionals |
/patients | Manage patient records |
/appointments | Handle appointment scheduling |
/specialities | Manage medical specialties |
/socials_works | Manage insurance providers |
/work_schedules | Coordinate staff work schedules |
All endpoints except
/auth/register and /auth/login require JWT authentication. Include the token in the Authorization header: Bearer <your-token>Building for Production
When you’re ready to deploy:Troubleshooting
Port Already in Use
Port Already in Use
If port 8080 or 5173 is already in use, you can change them:
- Backend: Modify the
PORTin your.envfile - Frontend: Vite will automatically try the next available port, or configure in
vite.config.ts
Database Connection Issues
Database Connection Issues
SQLite should work out of the box. If you encounter issues:
- Ensure the backend directory has write permissions
- Check that
sqlite3package is properly installed - The database file will be created automatically on first run
CORS Errors
CORS Errors
If you experience CORS issues:
- Ensure the backend CORS configuration allows your frontend origin
- The backend uses the
corspackage which is already configured - Check that both servers are running on the expected ports
JWT Token Issues
JWT Token Issues
If authentication isn’t working:
- Verify your
JWT_SECRETis set in the.envfile - Check that the token is being sent in the Authorization header
- Ensure the token hasn’t expired
Next Steps
Now that you have Clínica Vitalis running, explore the features:Explore Features
Learn about all the capabilities of Clínica Vitalis
API Reference
Dive into the complete API documentation
