This is the administration dashboard for the Structured Eligibility Criteria Proof of Concept (SEC POC) project.
Before continuing here, please review the main SEC POC README for an overview of the project, database setup, and environment configuration.
This admin dashboard is an R/Shiny application for managing user access and monitoring the SEC POC system. It is built with shinymanager, which provides authentication and user management via an encrypted SQLite database by default.
The dashboard connects to the main SEC PostgreSQL database to generate statistics and update structured eligibility criteria.
-
Local Development:
User credentials are stored in an encrypted SQLite database.
To initialize a fresh user database for local testing, runinit_user_db.R:source("init_user_db.R")This script creates a default admin user and sets up the database using an encryption passphrase to be referenced in
config.yml. -
Production:
Thelocaldb/users.sqlitefile is deployed to production and updated live as users interact with the site.
⚠️ Important: Before deploying a new app version, always download the latestusers.sqlitefrom the admin dashboard to ensure you have the most up-to-date user data. If you do forget this step, Posit Connect has a feature to rollback to a previous deployment which will have the latest users.sqlite file. -
Migration to PostgreSQL:
Migrating from SQLite to PostgreSQL is recommended since it's less error prone than working directly with the SQLite users database.- See c30bbc5 as a starting point for the migration.
- The app connects to the main SEC PostgreSQL database for application data and statistics.
- Database connection settings are managed in
config.ymland can be set via environment variables.
- Install R 4.5.1 and renv.
- Restore dependencies:
renv::restore()
- Set environment variables as described in the main SEC POC README.
- Initialize the user database (see above).
- Run the app:
Rscript app.R # or R -e "shiny::runApp()"
- Update user database:
Download the latestusers.sqlitefrom the admin dashboard and store it aslocaldb/users.sqlitebefore deploying. - Deploy code:
Follow the deployment process (see the main SEC POC README for details).
- Do not store secrets in the repository. Use Posit Connect UI to set environment variables securely.
- Conduct periodic backups of users.sqlite the user database. The latest backup is in the FHIR AWS Account under s3://sec-poc-archive/shinymanager-sql-2025-10-08.sqlite
- Consider migrating to PostgreSQL for improved security and scalability.