MediQ - A Healthcare Facility Information System built with React, Go, and PostgreSQL.
- Go 1.22 or higher
- PostgreSQL 15 or higher
- Node.js (v18+) and npm
-
Environment Variables Create a
.envfile in thebackend/directory. It should contain at minimum:SERVER_PORT=8080 DB_HOST=localhost DB_PORT=5432 DB_USER=postgres DB_PASSWORD=postgres DB_NAME=mediq_db JWT_SECRET=your_super_secret_key_here
-
Database Setup & Migrations Make sure your PostgreSQL server is running and the database specified in
.envexists. Then, run the migration tool to set up the schema and tables:cd backend go run cmd/migrate/main.go up(To rollback migrations, you can run
go run cmd/migrate/main.go down) -
Running the Server To start the backend server:
cd backend go run cmd/server/main.goThe server will start on the port specified in your
.envfile (default8080).
-
Install Dependencies From the
frontend/directory, install the required packages:cd frontend npm install -
Running the Development Server Start the Vite development server:
npm run dev
The frontend will typically be accessible at
http://localhost:5173.
You can run the entire system (Database, Backend API, Frontend SPA) with a single command using Docker Compose. The setup automatically creates the database, applies all schema migrations, populates test accounts, and serves the frontend on port 5173.
- Docker Desktop installed and running.
-
From the root directory of the project, run:
docker compose up --build
-
Open your web browser to
http://localhost:5173.
The database test accounts (admin, doctors, staff, patients) are automatically seeded. All default passwords are test1234.
To wipe the database and start fresh, run: docker compose down -v