This guide walks you through every command needed to run MELIKA on your local machine. By the end you will have the Express API listening on portDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Imjuanisss/proyecto-melika/llms.txt
Use this file to discover all available pages before exploring further.
3000, the React frontend on port 5173, and both connected to a local PostgreSQL database — ready to log in, book appointments, and explore all three user roles.
Prerequisites
Before you start, make sure the following are installed and available on yourPATH:
| Requirement | Minimum version | Notes |
|---|---|---|
| Node.js | 20.x | The client package.json enforces "node": ">=20.0.0" |
| npm | bundled with Node.js | Used for both server and client dependencies |
| PostgreSQL | 14+ recommended | Must be running locally with a user that can create databases |
| Git | any recent version | For cloning the repository |
| psql | bundled with PostgreSQL | Used to apply the database schema file |
Setup Steps
Install server dependencies
Navigate into the This installs Express 5,
server directory and install all Node.js dependencies.pg, jsonwebtoken, bcrypt, nodemailer, googleapis, cors, and dotenv, along with nodemon as a dev dependency.Configure server environment variables
Create a
.env file inside the server/ directory. MELIKA’s db.js reads individual DB_* variables, while the rest control auth, CORS, and email.The Gmail credentials are used by Nodemailer to send verification codes and doctor invitation emails. For local testing you can substitute an App Password if you prefer not to configure OAuth2.
Create the database and run the schema
Create the The schema file provisions tables for users, appointments, clinical records, doctor schedules, medications, audit logs, and more — all in the correct dependency order.
melika_db database (if it does not exist yet), then apply the full schema file. This creates all tables, indexes, functions, and triggers in a single pass.Start the backend server
From inside the You should see the following confirmation in your terminal:
server/ directory, start the development server. nodemon is configured to watch src/server.js and restarts automatically when that file changes.Install frontend dependencies
Open a new terminal, navigate to the This installs React 19, React Router DOM v7, FullCalendar 6,
client/ directory, and install the React dependencies.@react-pdf/renderer, @pdfslick/react, and Vite 8, among others.Configure client environment variables
Create a If you changed the backend port, update this value to match.
.env file inside the client/ directory. The apiClient.js module reads VITE_API_URL to build every HTTP request.Verify the Backend Is Running
Before opening the browser, confirm the API is healthy with a quickGET to the root endpoint:
200 OK with that body means Express is up, the middleware is loaded, and all routes are registered.
Create the First Admin User
MELIKA does not expose a public sign-up flow for admin accounts. Use the bundled seed script to create the first administrator directly in the database:admin role. Check the script source at server/scripts/crearAdmin.js to see the default credentials and update them before running in any shared environment.
CORS Configuration
The server allows requests from the following origins by default (configured insrc/server.js):
cors middleware with a No permitido por CORS error before any route logic runs. To allow additional origins (such as a staging domain), add them to FRONTEND_URL or extend the allowedOrigins array.