OmniWard is a Clojure application for managing patient data. It provides a CRUD API for patient records and is built with Clojure and PostgreSQL.
Before running the application locally, make sure you have the following installed:
Docker Clojure
Follow the steps below to set up and run the OmniWard application locally:
- Clone the GitHub repository:
git clone https://github.com/kruzabasi/omniward.git
- Change into the project directory:
cd omniward
- Start the PostgreSQL database:
docker-compose -f omniward.yaml up
This command will start the PostgreSQL container, which is required for running the application. Ensure that the database is running and accessible before proceeding.
- Create the required databases (this should be run from the postgres containers terminal):
psql -U admin
This command opens the PostgreSQL shell. Run the following commands within the shell to create the omniward and omniward_test databases:
CREATE DATABASE omniward;
CREATE DATABASE omniward_test;
- Start the application in development mode:
clj -M:dev
This command starts the application in development mode. In the running REPL, execute:
(start-server)
to start the server. The project should now be running on port 8081. Create the patients table: In the REPL, execute the following command to create the patients table in the database:
(require '[omniward.postgres.db :as db])
(db/create-patients-table (get-db))
This step is necessary for managing patient records.
- Run tests: To run the tests for the OmniWard application, use the following command:
clj -M:test
This will execute the tests and provide feedback on the test results.
- Build an Uber JAR: To build an Uber JAR of the application, use the following command:
clj -T:build uber
This command will create a standalone JAR file that contains all the necessary dependencies to run the application.
Contributions are welcome! Feel free to open issues or submit pull requests for any improvements or bug fixes.