Create a bonFHIR app
Usage
The create
command can initialize a new FHIR application from a template.
This command can be invoked 2 different ways:
Using this package
npx @bonfhir/cli@latest create
Or using the create package for a nice shorthand syntax:
npm create bonfhir@latest
The
@latest
is important as it makes sure that you are always using an up-to-date package.
Flags
-n
/--name
: the name of the project to create (which is alos the directoy name); must not contains any space (e.g.my-awesome-fhir-project
)-t
/--template
: the template to use-p
/--package-manager
: the package manager to use (e.g.npm
,yarn
orpnpm
)
Available templates:
We currently offer the following templates:
- playground: A simple playground to get started playing with bonFHIR core; this create a somewhat REPL-like environment to play with bonFHIR Core
- vite: A Vite React app with BonFHIR React components and React-Router
- lambda: An AWS Lambda serverless application
- next: A Next.js app with BonFHIR React components, a Subscription API, with NextAuth integration
- monorepo: A Monorepo with a Web app (Vite), an AWS Lambda API, and supporting packages - This for more advanced projects
Included development FHIR server
All projects comes with a local FHIR server setup that can be used for development (if you have Docker installed). Simply use the following command to launch it:
- npm
- Yarn
- pnpm
npm run fhir:start-server
yarn fhir:start-server
pnpm run fhir:start-server
Wait for a few minute for the server to start (you can look in the docker logs for a Server started
statement).
Then open http://localhost:8100 and login using the default credentials:
- Username:
admin@example.com
- Password:
medplum_admin
- Project: "Default Project"
The following command will also launch the import of synthetic patient data into the FHIR server
- using it while the server is running:
- npm
- Yarn
- pnpm
npm run fhir:add-sample-data
yarn fhir:add-sample-data
pnpm run fhir:add-sample-data