A software to help nurses manage medical records. This project is developed using Golang, PostgreSQL, and Docker. We use Gofiber as the main web framework for this project, pgx as the main PostgreSQL driver and golang-migrate for the migration.
To run this project, you need to have Docker installed on your machine. If you don't have Docker installed, you can download it here. For Mac users, we recommend using Orbstack to run your Docker containers since we have a better experience using it.
For the ease of local development, we utilize Docker Compose and Air for hot-reloading. Docker Compose is installed by default if you are using either Docker Desktop or Orbstack on your machine. Please follow through the Air's documentation to install Air on your machine and Docker Compose installation manual if you need to install it manually.
You can run the project using the following command:
docker compose up
Please make sure that the required environment variables was set before running the project. You can set the variables on the .env
(.env.dev
for local development) file.
You will also need to make sure that golang-migrate is installed on your machine. Please refer to the documentation for more details.
At this stage, you will need to run the migration manually to create the tables on the database. You won't need to do this manually in the next stage. Please use the following command to run the migration:
migrate -database "postgresql://[USER]:[PASSWORD]@[HOST]:[PORT]/[DB_NAME]?connect_timeout=10&application_name=[APP_NAME]&sslmode=disable" -path db/migrate/primary/ up
To add a new migration, you can run the following command:
migrate create -ext sql -dir ./db/migrate/primary/ -tz "Asia/Jakarta" [MIGRATION_NAME]