CSIemail is a Shiny web application built for ACS Cyprus to automate the processing and distribution of financial reports across store locations.
The app is organized into four main sections:
- Upload consolidated Cash Sales Invoice (CSI) or Ticket Hour Sales reports (
.xlsx/.xls) - Validate file format and content
- Automatically split data by store
- Preview and download per-store data
- Select stores from the detected list
- Generate per-store Excel attachments
- Send reports via SMTP to store email contacts
- Track send status with in-app notifications
- Load and consolidate multiple statement types:
- Cashier per Store — daily cash/card totals by courier/cashier
- Moneygram Statements — money transfer transactions
- VIVA Statements — card payment transactions (CSV)
- Generate Excel monitoring workbooks with reconciliation summaries
- Email consolidated reports to city-level cashier groups
- Maintain store-to-email mappings (CRUD)
- Manage city-level cashier group emails
- Organise cashier group/department structures
| Category | Packages |
|---|---|
| Framework | shiny, golem, shinydashboard, shinymanager |
| Data Processing | dplyr, tidyr, purrr, stringr, readxl, openxlsx |
| Database | DBI, RSQLite |
blastula, keyring |
|
| UI / UX | shinyjs, shinyFeedback, waiter, reactable, DT |
- R >= 2.10
- Dependencies are managed with
renv. Restore the project library with:
renv::restore()CSIemail::run_app()In production, the app runs on an ACS Windows Server. It is launched via
Windows Task Scheduler, which calls Rscript.exe to source
launch_on_browser.R.
That script:
- Detects the server's local IP address via
ipconfig - Starts the Shiny app on port 3846, bound to the server IP (no browser launch)
- Redirects error output to
error_log.Routfor diagnostics
Once running, the app is accessible on the local network at:
http://<server-ip>:3846/
App behaviour is controlled by inst/golem-config.yml using the config package.
Set the R_CONFIG_ACTIVE environment variable to switch environments:
| Environment | Description |
|---|---|
default |
Development — uses test SMTP credentials |
production |
Production — uses ACS official SMTP account |
dev |
Dev variant with local file paths |
Sys.setenv(R_CONFIG_ACTIVE = "production")
CSIemail::run_app()Email credentials are managed via the keyring package. Register credentials
before running in production:
blastula::create_smtp_creds_key(
id = "acs",
user = "accounts@acscyprus.com",
provider = "office365" # adjust as needed
)CSIemail/
├── R/
│ ├── app_ui.R / app_server.R # App entry points
│ ├── mod_*.R # Shiny modules (one per feature tab)
│ └── fct_*.R # Helper / processing functions
├── inst/
│ └── golem-config.yml # Environment configuration
├── data-raw/ # Excel templates and store config files
├── DB/ # SQLite databases (emails, users)
├── SampleData/ # Test/sample input files
├── Scripts/ # Utility and testing scripts
├── renv/ # renv project library
├── renv.lock # Dependency lockfile
├── launch_on_browser.R # Production launcher (Windows Task Scheduler)
└── app.R # Standard Shiny entry point
Lefkios Paikousis — lefkiospaikousis@yahoo.com