Skip to main content

Testing the LAMP Platform

Once you've deployed the LAMP-server and LAMP-database, you'll be able to use the mindLAMP app (either on your mobile device or in a desktop browser) to connect to your instance.

All data is encrypted before communication between your browser or the app to and from your newly deployed server. No data will be communicated with any other server, including the default API server at or other third party services.

  1. Verify the status of the database.

    curl -k


    mongo 'mongodb://username:password@databaselocation:port/databasename'

    If the mongo command cannot be found, you can also try mongosh

  2. Verify the status of the LAMP Platform API Server.

    curl -k
    • Check the Docker service logs for LAMP_server to locate your generated server administrator password.

      docker service logs LAMP_server

      The logs will only print the administrator password once. Restarting the service will not reveal the password again. If you did not save the password when you initialized the database, you can find the password by decrypting the secret key found in the credential collection using your root key. See the decryption script below this page.

    • Verify that the newly generated password (GENERATED_PASSWORD_HERE) works.

      curl -k -H 'Authorization: Basic admin:GENERATED_PASSWORD_HERE'

Create a Researcher and a Participant using the browser management user interface to verify the setup works as expected. To jumpstart your instance of the LAMP Platform and test surveys or other activities, follow the instructions in Create Surveys and import the file below into the Researcher you just created.

[lamp_example_survey_battery_export.json](Testing the LAMP Platform/export.json)

If any of the above steps fails to complete successfully you will not be able to reach this step.

Password encrypt/decryption script

If you need to manually encrypt/decrypt your secret key, see the below script. You can execute this script via terminal with node <script_name> <encrypt:decrypt> <secret_key>. Please replace <ROOT_KEY> with the root key used in your lamp-server service.

#!/usr/bin/env node

const crypto = require('crypto')
const mode = (process.argv[2] || '')
const input = (process.argv[3] || '')
let output = 'Usage: passcrypt.js <encrypt | decrypt> <string to encrypt or decrypt>'

try {
if (mode === 'encrypt') {
let ivl = crypto.randomBytes(16)
let cipher = crypto.createCipheriv('aes-256-cbc', Buffer.from(PRIVATE_KEY, 'hex'), ivl)
output = Buffer.concat([
cipher.update(Buffer.from(input, 'utf16le')),
} else if (mode === 'decrypt') {
let dat = Buffer.from(input, 'base64')
let cipher = crypto.createDecipheriv('aes-256-cbc', Buffer.from(PRIVATE_KEY, 'hex'), dat.slice(0, 16))
output = Buffer.concat([
} catch(e) {
console.log('*** ERROR: Could not ' + mode + ' the string. ***')