Skip to main content

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 pnpm

Installation

1

Clone the Repository

Clone the Clínica Vitalis repository to your local machine:
git clone <repository-url>
cd clinica-vitalis
2

Install Backend Dependencies

Navigate to the backend directory and install dependencies:
cd backend
pnpm install
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
3

Configure Environment Variables

Create a .env file in the backend directory with the following configuration:
PORT=8080
JWT_SECRET=your-secret-key-here
Make sure to use a strong, unique secret key for JWT_SECRET in production environments.
The backend uses SQLite, so no additional database configuration is needed. The database file will be created automatically on first run.
4

Start the Backend Server

Start the Express backend server:
# From the backend directory
npx ts-node app.ts
Or for development with auto-reload:
npx nodemon app.ts
You should see:
Servidor corriendo en el puerto 8080
The backend API will be available at http://localhost:8080
5

Install Frontend Dependencies

Open a new terminal, navigate to the frontend directory, and install dependencies:
cd hospital-staff-manager
pnpm install
This will install:
  • React 19 and React DOM
  • Redux Toolkit for state management
  • Material-UI components
  • React Router for navigation
  • And other frontend dependencies
6

Start the Frontend Development Server

Launch the Vite development server:
# From the hospital-staff-manager directory
pnpm dev
The application will start and be available at http://localhost:5173 (default Vite port)
7

Create Your First Admin User

To access the platform, you need to register an admin user. Make a POST request to the registration endpoint:
curl -X POST http://localhost:8080/auth/register \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Admin",
    "surname": "User",
    "email": "admin@clinicavitalis.com",
    "password": "securepassword123"
  }'
Or use the registration form in the frontend interface at http://localhost:5173/register
8

Login to the Platform

Navigate to http://localhost:5173/login and sign in with your credentials:
{
  "email": "admin@clinicavitalis.com",
  "password": "securepassword123"
}
Upon successful login, you’ll receive a JWT token that will be stored and used for authenticated requests.

Verify Installation

After completing the setup, verify everything is working:

Backend Health Check

The backend exposes several API endpoints. Verify they’re accessible:
# Test authentication endpoint
curl http://localhost:8080/auth/login

# Should return validation errors (expected without credentials)

Frontend Access

  1. Open your browser to http://localhost:5173
  2. You should see the Clínica Vitalis login page
  3. Login with your admin credentials
  4. You should be redirected to the dashboard

API Endpoints Overview

The backend provides the following RESTful API endpoints:
EndpointDescription
/auth/registerRegister new users
/auth/loginAuthenticate and receive JWT
/professionalsManage medical professionals
/patientsManage patient records
/appointmentsHandle appointment scheduling
/specialitiesManage medical specialties
/socials_worksManage insurance providers
/work_schedulesCoordinate 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:
1

Build the Frontend

cd hospital-staff-manager
pnpm build
This creates optimized production files in the dist directory.
2

Build the Backend

cd backend
npx tsc
This compiles TypeScript to JavaScript for production deployment.
3

Deploy

Deploy the dist folder (frontend) and compiled backend to your hosting provider of choice.

Troubleshooting

If port 8080 or 5173 is already in use, you can change them:
  • Backend: Modify the PORT in your .env file
  • Frontend: Vite will automatically try the next available port, or configure in vite.config.ts
SQLite should work out of the box. If you encounter issues:
  • Ensure the backend directory has write permissions
  • Check that sqlite3 package is properly installed
  • The database file will be created automatically on first run
If you experience CORS issues:
  • Ensure the backend CORS configuration allows your frontend origin
  • The backend uses the cors package which is already configured
  • Check that both servers are running on the expected ports
If authentication isn’t working:
  • Verify your JWT_SECRET is set in the .env file
  • 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

Build docs developers (and LLMs) love