Welcome to the POS Admin developer guide! This document was written so that rails developers who work for Cru can easily get up to speed developing inside the POS Admin project.
One of the primary products of the FamilyLife ministry is the Weekend to Remember getaway event for couples. Many of these events happen throughout the year, and hundreds of couples attend each event in efforts to strengthen their marriage.
- At each event, various products and educational materials are sold by FamilyLife staff and volunteers.
- The primary system of record for FamilyLife sales data is WooCommerce.
- The Point of Sale (POS) system used to sell materials is called Lightspeed (Retail POS R-Series). It is unrelated to WooCommerce, and no known plugin exists as of this writing. Lightspeed is a SaaS product.
- The inventory system that instructs the warehouse about how many products are sold and which ones to replenish is accessed through SalesForce.
So then, if sales are made in Lightspeed POS, and WooCommerce and SalesForce are separate systems, how does this data flow from Lightspeed into WooCommerce and SalesForce?
A custom app was developed that uses the Lightspeed API to read sales data for each weekend event, and write that data to two targets:
-
The Product_Sale__c object in the FamilyLife instance of SalesForce. \
-
A Google Sheet that contains all necessary information to construct sales in WooCommerce.
This app is managed by Server Application Engineering. At the time of this writing, the SAE team is led by Lee Braddock. It was originally developed by Jon Watson and Justin Sabelko, completed in February of 2025.
Mona Horton owns the product and business rules, and serves as the business interface between FamilyLife Staff and USTECH.
- Lightspeed Operators: Deb Gulbranson and Sherri Oehme work with various other staff and volunteers to keep the Lightspeed product properly configured for each event.
- Process Admins: Chad Donley and Patrick Jones are responsible for using the POS Admin tool and insuring the quality of data as it flows into SalesForce and WooCommerce respectively.
- SalesForce Admin: Tim Jones is responsible for the sales inventory processing after the sales inventory report has been written to SalesForce.
Chad Donley is responsible for starting the process once an event over the previous weekend has occurred. Chad starts this process by logging into the POS Admin tool and creating a new “job” in the POS Admin tool. This act does two things: \
-
Creates a new “SF Import” job. This job will extract sale inventory data from Lightspeed and write it to the Product_Sale__c object in SalesForce. Once this job is created, no human intervention is required. \
-
Creates a new “LS Export” job. This job will extract all sale line data for a particular event from Lightspeed and write it to a new tab in a designated Google Sheet.
Once Chad’s part is done, Patrick Jones looks over the sheet for data integrity issues and ensures that the data is ready to be imported into WooCommerce. When Patrick is done, he changes a single “Status” field in the sheet from “IN REVIEW” to “READY FOR WOO IMPORT”.
The POS Admin product looks at all tabs in this sheet every 30 minutes to see if any new sheets are ready to be processed. If it finds a sheet that is marked as ready, it will import it into WooCommerce.
Concern | Technology Used |
Source Control | Github (fl-pos-admin) |
Code Framework | Ruby on Rails (rails version 8) |
Caching | SolidCache |
Job Handler | Sidekiq |
Asset Pipeline | Propshaft |
End-to-End JS Integration | turbo |
CSS Framework | Bootstrap 5 |
Secrets | AWS secrets accessed as environment variables |
Database | Postgres |
Integrations |
|
Server Configuration | Terraform |
The SalesForce integration requires the following, and is managed by Tim Jones.
Secret Name | Description |
SF_INSTANCE_URL | SalesForce URL for the FamilyLife Tenant in SalesForce. |
SF_HOST | The FQDN from the SF_INSTANCE_URL |
SF_LOGIN_URL | The SalesForce login URL. Must be included even if it is the same as the SF_INSTANCE_URL. |
SF_PASSWORD | The service account user’s password that will be logging in. |
SF_TOKEN | The service account user’s API login token that will be added to the end of the password. |
SF_USERNAME | The service account’s user name. |
SF_VERSION | The version of the SalesForce API to use. Version 58.0 was used originally. |
SF_CLIENT_ID | The Client ID for the API connection. |
SF_CLIENT_SECRET | The Client Secret for the API connection. |
The SalesForce connection tends to be very straight forward from a developer perspective. The SalesForce team manages credentials for API access. If you need specific access, Tim Jones is your contact.
Lightspeed has a custom REST API implementation that has some notable restrictions: \
-
API Tokens are provided on a per-user basis. \
-
API Tokens must be registered through a special process involving an obscure form used to request a new client on a per-user basis. Each Client configuration must belong to a unique email address.
IMPORTANT: Read the above linked instructions carefully. This process will result in a Client ID and Secret that will then allow you to generate access tokens through an OAuth web interface. \ -
Therefore, the process of acquiring a new token must be integrated into a web-based application, and cannot be automated using a headless server environment.
Each environment should have its own Lightspeed API Client credentials. Follow the instructions above if you are setting up a local development environment.
- Clone the project from the repository linked in the Technology Stack description above.
- Contact a fellow developer to get a copy of their .env.local file and copy it to your project work area.
- Create a new Postgres database accessible locally on your computer and configure the name of that database to correspond to the names expected by the project configuration.
- Record your database configuration variables in your local copy of .env.local AND .env.test.local (so your unit tests will work).
- Do
bundle install
,bin/rails css:install:bootstrap
, andbin/dev
, and you should be cooking with gas. - For help getting your development work area set up, contact Justin Sabelko.
- Production: https://fl-pos-admin.cru.org/
- Stage: https://fl-pos-admin-stage.cru.org/