A demo app using Svelte as frontend and GoLang as backend. This app provides an web-based GUI for nurses to manage patient's health notes.
** not implemented
Svelte is used to compile frontend into static html/css/js pages that can be served over HTTP(S). JWT is used to authenticate client (web browser), as well as validate client session using stateless servers.
One advantage of using svelte is its extremely small and fast compiled size. Site built with svelt can fun very fast and require little resources, this can be advantageous especially in context of mobile devices. Browser compatibility of the target mobile device should be investigated.
Internationalization possibiles will not be address; if needed, it should be possible to achieve localization using plugins such as svelte-i18n.
A single goLang backend service is used to authenticate and serve all api requests. The backend will be used to authenticate client session by providing JWT tokens.
if/when the need arises to separate the backend into individual microserves, the backend folder structure is designed to make this process relatively simple. Some code refactoring may need to be done, for example, the session service may be updated to call user service endpoint instead of accessing it directly
Data is persisted by backend using postgres sql using (SQLBoiler)[https://github.com/volatiletech/sqlboiler]
also refer to api/README.md for sample request/response
auth service
user service
/api/v1/users
/api/v1/user?user-id=
dao user
patient service
/api/v1/patients
/api/v1/patient?patient-id=
/api/v1/patient-notes?patient-id=
/api/v1/patient-note?note-id=
dao patient
dao patient-note
(not implemented) code lint, unit testing, gui testing in ci/cd. Dockerfiles provided to facilitate build, test, and service execution environments.
frontend website can deployed as static website; CDN may be utilized. Backend services can be deployed as stateless containerized (K8S) or serverless cloud architecture, using L7 cloud load balancers with TLS termination. A reverse proxy (or load balancer with path-based-routing support) may be used to scale different APIs individually, even if the codebase for different APIs is not separated.
frontend can be instrumented with services such as Google Analytics. backend goLang services can be instrumented for Prometheus using official go client, and for OpenTracing using OpenTracing API for Go
to run frontend in developer mode, see frontend/README.md
# (re)build images & start
docker-compose up --build
# surf http://localhost:5000/
# stop
docker-compose down