https://github.com/saransridatha/hospital_db
A hospital patient records application built as a college project using Go, Fyne, and MySQL. It enables users to add, view, search, and remove patient details, helping healthcare workers manage records efficiently.
https://github.com/saransridatha/hospital_db
fyne go golang mysql mysql-database sql
Last synced: 4 months ago
JSON representation
A hospital patient records application built as a college project using Go, Fyne, and MySQL. It enables users to add, view, search, and remove patient details, helping healthcare workers manage records efficiently.
- Host: GitHub
- URL: https://github.com/saransridatha/hospital_db
- Owner: saransridatha
- Created: 2024-10-28T18:19:00.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-10-29T06:14:14.000Z (over 1 year ago)
- Last Synced: 2025-12-18T06:49:11.302Z (7 months ago)
- Topics: fyne, go, golang, mysql, mysql-database, sql
- Language: Go
- Homepage:
- Size: 291 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# **Hospital DB:** A Hospital Patient Records Application
This is a college project for managing hospital patient records. The application allows users to add, fetch, and remove patient records from a MySQL database.
## Features
- Add new patient records
- Fetch and display existing patients
- Remove patient records by ID
- Search for patients by name
## Prerequisites
Before running the application, ensure you have the following installed:
- [Go](https://golang.org/doc/install) (version 1.22 or later)
- [MySQL](https://dev.mysql.com/doc/refman/8.0/en/installing.html)
## Installation Steps
#### ***Note:*** *This application is built and tested on a Linux machine(Fedora 40), it might not work the same on Windows/MacOS.*
### 1. Install MySQL
Follow the official MySQL installation guide for your operating system. Ensure you have a running MySQL server and have created a database named `hospital_db`.
### 2. Set Up the Database
Execute the SQL commands in the `database.sql` file to create the necessary tables. You can run the script using the MySQL command line:
```bash
mysql -u -p hospital_db < database.sql
```
Replace `` with your MySQL username.
Enter your MySQL password if you've set already, else leave it empty and hit enter.
Incase if root password for MySQL is not set,
1. Enter this command in terminal:
```bash
mysql -u root -p
```
2. Then enter the following command:(change the `root-password` parameter to your actual password which you want to set)
```mysql>
ALTER USER 'root'@'localhost' IDENTIFIED BY 'root-password';
```
### 3. Install Go Dependencies
Navigate to the project directory and run the following command to install the required Go dependencies:
```bash
go mod init hospital_db
go get fyne.io/fyne/v2
go get fyne.io/fyne/v2/internal/svg@v2.5.2
go get fyne.io/fyne/v2/internal/painter@v2.5.2
go get fyne.io/fyne/v2/storage/repository@v2.5.2
go get fyne.io/fyne/v2/lang@v2.5.2
go get fyne.io/fyne/v2/widget@v2.5.2
go get fyne.io/fyne/v2/internal/driver/glfw@v2.5.2
go get fyne.io/fyne/v2/app@v2.5.2
go get github.com/go-sql-driver/mysql
```
### 4. Run the Application
1. After installing the dependencies, in the `hospital_app.go` file change the `` to your actual MySQL username and `` to your actual MySQL password.
2. After changing these two parameters, you can run the application with the following command:
```bash
go run hospital_app.go
```
## Screenshots