emr hospital
Ekemini Thompson is a Machine Learning Engineer and Data Scientist, specializing in AI solutions, predictive analytics, and healthcare innovations, with a passion for leveraging technology to solve real-world problems.
Step 1: Create a Folder on Desktop
Create Folder:
Right-click on your Desktop and select New > Folder.
Name the folder
MyFullStackApp(or any name you prefer).
Step 2: Clone the GitHub Repository
Open Command Prompt (CMD):
- Press
Win + R, typecmd, and press Enter.
- Press
Navigate to the Folder: In the Command Prompt, type the following to navigate to your folder (if your folder is on the desktop):
cd Desktop\MyFullStackAppClone the GitHub Repository: You’ll clone the repository from GitHub. Assuming you have the repository URL (
https://github.com/light2023/3RH_EMR.git), type this:git clone https://github.com/light2023/3RH_EMR.gitAfter running this command, you'll see output like: (if youre asked for password, go to step 6)
Counting objects: 100% (33/33), done. Delta compression using up to 4 threads Compressing objects: 100% (17/17), done. Writing objects: 100% (17/17), 84.97 KiB | 14.16 MiB/s, done. Total 17 (delta 14), reused 0 (delta 0) remote: Resolving deltas: 100% (14/14), completed with 14 local objects. To https://github.com/light2023/3RH_EMR.git 0f97cb2..53dbb66 master -> masterThis means the repository has been successfully cloned into your folder.
Step 3: Set Up PostgreSQL
Create the PostgreSQL Database and User:
Open pgAdmin (or use the command line
psql).Log in as superuser
postgres:Open CMD and type:
psql -U postgres
Create the database and user: Run these commands to create the database and user with the same name
renewal_ridge_emr:CREATE DATABASE renewal_ridge_emr; CREATE USER renewal_ridge_emr WITH PASSWORD 'renewal_ridge_emr'; GRANT ALL PRIVILEGES ON DATABASE renewal_ridge_emr TO renewal_ridge_emr;Exit the PostgreSQL command line by typing:
\q
Confirm Database and User: You can verify the database creation and user setup by logging back in and checking:
psql -U postgres \l -- lists databases \du -- lists users
Step 4: Set Up the Backend (FastAPI)
Navigate to the Backend Folder: Assuming the FastAPI backend is in a folder called
backendwithin the cloned repository, navigate to it:cd 3RH_EMR/backendCreate a Virtual Environment (Optional but Recommended): To isolate dependencies for the Python backend, it's best to create a virtual environment.
python -m venv venvTo activate the virtual environment:
On Windows:
.\venv\Scripts\activate
Install Python Dependencies: Install all the required dependencies from the
requirements.txtfile that came with the repository:pip install -r requirements.txtConfigure Database URL in FastAPI: Open the FastAPI configuration file (usually
config.pyorsettings.py) and update the database URL to match your PostgreSQL setup:SQLALCHEMY_DATABASE_URL = "postgresql://renewal_ridge_emr:your_password@localhost/renewal_ridge_emr"Run FastAPI Backend: Run the FastAPI app:
uvicorn main:app --reloadThe backend should now be running at
http://127.0.0.1:8000.
Step 5: Set Up the Frontend (React)
Navigate to the Frontend Folder: Now, go to the frontend directory, which should be within the cloned repository:
cd ../frontendInstall React Dependencies: Before running the React app, install the required packages using npm:
npm install
Run React Development Server: To start the React app:
npm startReact should now be running at
http://localhost:3000.
Step 6: Set Up GitHub Authentication with Personal Access Token
If you're asked to enter a GitHub password for Git operations (push, pull, etc.), you’ll need to generate a Personal Access Token from GitHub.
Generate Personal Access Token:
Go to GitHub Developer Settings.
Click on Generate new token.
Select the necessary scopes (e.g.,
repo,workflow).Click Generate token, and copy the token. You will not be able to see it again.
Use Token for Git Authentication: When you run a
git pushorgit pull, you’ll be prompted for a password. Paste the token instead of your GitHub password.
Step 7: Run and Test Your Full-Stack Application
Backend (FastAPI): Open a browser and go to
http://127.0.0.1:8000to verify that the FastAPI backend is working correctly. You should see the FastAPI documentation.Frontend (React): Open a browser and go to
http://localhost:3000to check if the React app is running. It should be able to communicate with the FastAPI backend.