/hospital

demo project simulating a hospital's patient record management system built with dotnet 6

Primary LanguageHTML

what is this

demo project simulating a hospital's patient record management system.
Built with

  • dotnet 6
  • razor html
  • mysql

how to run locally

setup db (one-off)

  1. start db
cd <project-root>
docker-compose -f ./docker-compose.yml up
  1. using docker desktop, access to container's terminal
  2. in terminal, setup db
# sign in. password is 123456 when prompted
mysql -u root -p

# init db & tables
CREATE DATABASE IF NOT EXISTS hospital;
USE hospital;
CREATE TABLE IF NOT EXISTS patient (
    id INT AUTO_INCREMENT PRIMARY KEY,
    name VARCHAR(255) NOT NULL,
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
);
CREATE TABLE IF NOT EXISTS hospital (
    id INT AUTO_INCREMENT PRIMARY KEY,
    name VARCHAR(255) NOT NULL,
    address TEXT,
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
);
CREATE TABLE IF NOT EXISTS hospital_staff (
    id INT AUTO_INCREMENT PRIMARY KEY,
    name VARCHAR(255) NOT NULL,
    email VARCHAR(255) NOT NULL,
    hashed_password VARCHAR(255) NOT NULL,
    hospital_id INT,
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
);

start server

cd <project-root>
dotnet watch

# navigate to http://localhost:5175/ in browser

common commands

# start project with hot reload
dotnet watch