# Table of Contents - [The Truman Platform | The Truman Platform](#the-truman-platform-the-truman-platform) - [Demo | The Truman Platform](#demo-the-truman-platform) - [Installing Truman | The Truman Platform](#installing-truman-the-truman-platform) - [Initial Experimental Design | The Truman Platform](#initial-experimental-design-the-truman-platform) - [Defining your Simulation | The Truman Platform](#defining-your-simulation-the-truman-platform) - [Exporting Study Data | The Truman Platform](#exporting-study-data-the-truman-platform) - [Developing your Simulation | The Truman Platform](#developing-your-simulation-the-truman-platform) - [Best practices for simulation building | The Truman Platform](#best-practices-for-simulation-building-the-truman-platform) - [People | The Truman Platform](#people-the-truman-platform) - [Frequently Asked Questions | The Truman Platform](#frequently-asked-questions-the-truman-platform) - [Citation and Papers | The Truman Platform](#citation-and-papers-the-truman-platform) - [Launching Your Study | The Truman Platform](#launching-your-study-the-truman-platform) - [Contact us | The Truman Platform](#contact-us-the-truman-platform) - [Basic simulation components | The Truman Platform](#basic-simulation-components-the-truman-platform) - [Setting up Truman locally | The Truman Platform](#setting-up-truman-locally-the-truman-platform) - [Installing the prerequisites | The Truman Platform](#installing-the-prerequisites-the-truman-platform) - [Simulation components | The Truman Platform](#simulation-components-the-truman-platform) - [File Directory | The Truman Platform](#file-directory-the-truman-platform) - [Deploying Truman Online | The Truman Platform](#deploying-truman-online-the-truman-platform) --- # The Truman Platform | The Truman Platform [NextDemo](/the-truman-platform/demo) Last updated 9 months ago [](#introduction) Introduction ----------------------------------- The Truman Platform (Truman) is a **complete, open-source social media simulation**, which can be used as a testbed to explore different research questions. For example, how do social norms spread on social media through a behavioral contagion process? How to encourage people to be upstanders when encountering cyberbullying? How to mitigate the effects of misinformation prevalence in social media? [](#try-it-out) Try it out! -------------------------------- Explore the look, features, and functionality of The Truman Platform [here](https://truman-2023-82f66bc03792.herokuapp.com/) ! You may enter a random 6-digit ID when prompted to provide a Mechanical Turk ID. Or check out our video demo! [](#what-is-the-truman-platform) What is The Truman Platform? ------------------------------------------------------------------ Named after the 1998 film, _The Truman Show_, the Truman Platform is a social media simulation platform created by [The Cornell Social Media Lab](https://socialmedialab.cornell.edu/) to provide researchers a community research infrastructure to conduct social media experiments in ecologically-valid realistic environments. Researchers can create different social media environments with a repertoire of features and affordances that fit their research goals and purposes, while ensuring participants have a naturalistic social media experience. Specifically, researchers can: * Simulate realistic and interactive timelines and newsfeeds, by curating, creating, and controlling every "actor" (a simulated user on the website), post, like, comment, notification, and interaction that appears on the platform * Customize the social media simulation platform's interface and functionality * Create experiments with random assignment and exposure of participants' to different experimental conditions * Collect a variety of participant behavioral metrics on the platform (including how they interact with posts and comments, how long they are on the site, and more.) The Truman Platform manages parallel simulations for all study participants. So, study participants don't connect or interact with any other real participant on the website, even though they believe they do, and all participants receive the same social media experience, except for variations controlled by the experimental condition of the study and the participant's own posting behavior. As a result, The Truman Platform gives researchers lab-like control over study conditions while maintaining a realistic, naturalistic, ecologically-valid social media setting, making Truman a great tool for social scientists to study different research questions. [](#want-to-install-truman) Want to install Truman? -------------------------------------------------------- Start exploring our codebase and the steps on how to deploy your version of The Truman Platform: [](#want-to-explore-more) Want to explore more? ---------------------------------------------------- Curious to see how you can use it for your experiment? Jump in to our start docs: đŸ’» [Installing Truman](/the-truman-platform/setting-up-truman/installing-truman) [Initial Experimental Design](/the-truman-platform/getting-started/initial-experimental-design) [Demo](/the-truman-platform/demo) ![](https://truman.gitbook.io/~gitbook/image?url=https%3A%2F%2F797468930-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FOR396HK0xjvBHL78w6Qi%252Fuploads%252Fp9GSuany5p5deLNvQuOY%252Fprojects1.jpg%3Falt%3Dmedia%26token%3D1cfbd428-ab20-46bc-a9ee-4e8fad23a6f4&width=768&dpr=4&quality=100&sign=471db04a&sv=2) --- # Demo | The Truman Platform [PreviousThe Truman Platform](/the-truman-platform) [NextInitial Experimental Design](/the-truman-platform/getting-started/initial-experimental-design) Last updated 9 months ago Explore the look, features, and functionality of The Truman Platform [here](https://truman-2023-82f66bc03792.herokuapp.com/) ! You may enter a random 6-digit ID when prompted to provide a Mechanical Turk ID. Or check out our demo below! The demo shows the normal experience of a research participant on Truman and highlights the different features of the platform. --- # Installing Truman | The Truman Platform [PreviousCitation and Papers](/the-truman-platform/getting-started/citation-and-papers) [NextInstalling the prerequisites](/the-truman-platform/setting-up-truman/installing-truman/installing-the-prerequisites) Last updated 9 months ago The Truman Platform (Truman) is a web application that uses the Node.js framework. The following pages will help walk you through: 1. Installing the prerequisite software for running Truman, 2. Creating your own project codebase and MongoDB database, and 3. Setting up a local version of your project on your local computer. At the very end of the tutorial, you should have a running version of the project on your local computer. Throughout this tutorial, you will be using the Terminal (for Mac) or the Command Prompt (for Windows). To access these: * On **Mac:** Click the search “magnifying glass” icon at the top right of your desktop (or use the shortcut: command + spacebar to open up the search field), and enter “terminal” into it and select it. * On **Windows:** In the Windows search bar, enter "Command Prompt" and select "Run as administrator". ![](https://truman.gitbook.io/~gitbook/image?url=https%3A%2F%2F797468930-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FOR396HK0xjvBHL78w6Qi%252Fuploads%252FQzqWGCtpsMiowLaBrc8T%252Fimage.png%3Falt%3Dmedia%26token%3Dbf80a28e-5041-4a17-a80b-6bd5d04ab37c&width=768&dpr=4&quality=100&sign=9e321920&sv=2) ![](https://truman.gitbook.io/~gitbook/image?url=https%3A%2F%2F797468930-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FOR396HK0xjvBHL78w6Qi%252Fuploads%252FVYigqd6wXFhSyUP1hRU6%252Fimage.png%3Falt%3Dmedia%26token%3Db0f3cf56-68c0-4359-99cb-961e115537b4&width=768&dpr=4&quality=100&sign=8efe688&sv=2) --- # Initial Experimental Design | The Truman Platform As a researcher, you can manipulate features of The Truman Platform to fit the needs of your research. [](#research-question) Research Question --------------------------------------------- The Truman Platform can be used to study a variety of research questions. You can view past research that have used Truman [here](/the-truman-platform/getting-started/citation-and-papers) . Once you have decided on your research question, begin to think about how The Truman Platform can be used to facilitate studying your research question. ### [](#independent-variable) Independent Variable The variable that you manipulate is considered the **independent variable (IV)**. Components of The Truman Platform that can be readily manipulated for your experiment are: * the identities of the simulated people on the platform (called actors) * the actors' posts and comments * the interactions between actors * and the interactions between actors and the research participant. See more in [Defining your Simulation](/the-truman-platform/setting-up-truman/defining-your-simulation) for instructions and details. You may also manipulate the interface of the environment; however, coding experience is needed to change the user interface or user experience according to experimental groups. Note that the user interface of the current version of Truman largely resembles the web interface of Instagram. ### [](#dependent-variables) **Dependent Variables** The variables that are affected by the independent variable are known as the **dependent variables (DV)**. On Truman, the DVs that are typically measured are the responses of research participants and/or their resulting behavior on the platform. Depending on your independent variable, dependent variables can include what the participants post, like, comment, or flag. It can also be the time they spend on the website or the frequency of pages or profiles they click on, etc. A brief summary of the default data collected on The Truman Platform is listed below. Decide which behaviors are applicable to your research question to measure as dependent variables: * All interactions with posts and comments (including likes, flags, view times) * Participants' posting behavior * Actor based interactions (Block, report, follow, profile view) * Site log (time on site) * Page log (pages visited) * Participant information (MTurkID, username, experimental condition, profile) A script is provided in the project folder that readily exports the above default data from your database into a readable csv file. You may also measure behaviors other than the ones listed above on the platform as your dependent variables, but coding experience will be needed to add those functionalities to Truman. [](#other-considerations) Other Considerations --------------------------------------------------- ### [](#cover-story) Cover Story Building a cover story for The Truman Platform is extremely important for reinforcing the realism of the platform. Typically, we use a cover story about beta testing a new social media application, called **EatSnap.Love**, where people share, like, and react to pictures of food. As a result, The Truman Platform's base template's simulation content is centered around food. You can change this when [defining the content of your simulation](/the-truman-platform/setting-up-truman/defining-your-simulation/simulation-components) . ### [](#ethics) Ethics Getting ethical approval for Truman studies is essential as Truman studies deal with deceiving participants into believing the actors on the site are real users of the site. A key element to getting ethical approval is to have a clear debrief in the post survey at the end of your study and allowing participants to make an informed consent after this debrief. [PreviousDemo](/the-truman-platform/demo) [NextDeveloping your Simulation](/the-truman-platform/getting-started/developing-your-simulation) Last updated 1 month ago --- # Defining your Simulation | The Truman Platform A Truman simulation is the simulated social media environment that a research participant experiences. Each individual Truman simulation is based around the moment the participant joins the site. T₀ is when they joined. Every post, comment, or actor behavior on the site is in reference to this point in time. For example, a behavior can be defined to happen at -12:30, which is 12 hours and 30 minutes before they joined, or 62:31, which is 62 hours and 31 minutes after they joined. As a result, participants will always receive the same Truman Simulation (negating any manipulations based on experimental conditions and the participant's own posting behavior) since the simulation is based on the relative time to when a participant created their account and not based on absolute time. Therefore, you will also have many parallel simulations during the study. [PreviousSetting up Truman locally](/the-truman-platform/setting-up-truman/installing-truman/setting-up-truman-locally) [NextBasic simulation components](/the-truman-platform/setting-up-truman/defining-your-simulation/basic-simulation-components) Last updated 9 months ago --- # Exporting Study Data | The Truman Platform [](#exporting-the-data) Exporting the Data ----------------------------------------------- During the study, participants' behavioral data on the website is recorded in the MongoDB database that you have set up. MongoDB is a NoSQL Server in which data is stored in BSON (Binary JSON) documents and each document is built on a key-value pair structure. The details of this are not too important if you are not familiar with MongoDB. Instead, a script (`data-export.js`) is provided in The Truman Platform project folder that when run, exports basic variables and information about the participants' behavioral metrics on Truman into a readable csv file. This eliminates the need for you to go into the database (which can be overwhelming) and allow you to easily analyze participants' behavioral data at the end of your study. ### [](#how-to-export-data-into-readable-csv-file) How to export data into readable csv file To run `data-export.js` to export participants' behavioral metrics data into a csv file: 1. Ensure the value to the key **MONGODB\_URI=** in the `.env` file is the MongoDB URL connection string to your database. If you followed the instructions to installing Truman, this should already be set to the correct value. 2. Create a folder named `./outputFiles` in your base project directory. Exported csv files will go in this folder. 3. Next, enter `node data-export.js` in your terminal/command prompt from your project directory. A new exported csv file is generated each time you enter this command and run the script. 4. When the script is completed, you will find the csv file with the data in the folder `./outputFiles/truman-dataExport-.........csv`. 5. To understand this file, see below. ### [](#data-exported) Data exported In general, these are the types of behaviors calculated/ exported by the `data-export.js` file. * All interactions with posts and comments (including likes, flags, view times) * Participants' posting behavior * Actor based interactions (Block, report, follow, profile view) * Site log (time on site) * Page log (pages visited) * Participant information (MTurkID, username, experimental condition) Below is a more detailed breakdown and description of each variable. In the outputted csv file, each row is one participant and the value in a column corresponds to the variable column name. Variable Name Description Id Participant's provided Mechanical Turk ID ResponseID Username Participant's username Condition Participant's condition NumUserPostsCreated Number of posts _made_ by the participant NumUserCommentsCreated Number of comments _made_ by the participant NumActorPostsLiked Number of actor posts _liked_ by the participant NumActorPostsFlagged Number of actor posts _flagged_ by the participant NumActorCommentsLiked Number of actor comments _liked_ by the participant NumActorCommentsFlagged Number of actor comments _flagged_ by the participant UserPostsCreated Metadata of the participant-made posts, including: - text of the post - which day of the study the post was made (ex: 1, 2, 3, etc., where the day number is defined in 24-hour periods of the study) Formatted like: __, on Day __ UserCommentsCreated Metadata of the participant-made comments, including: - text of the comment - id of the post the comment was left on - which day of the study the comment was made (ex: 1, 2, 3, etc., where the day is defined in 24-hour periods of the study) Formatted like: __, on Post __, on Day __ ActorPostsLiked List of ids of the actor posts the participant liked ActorPostsFlagged List of ids of the actor posts the participant flagged ActorCommentsLiked List of ids of the actor comments the participant liked ActorCommentsFlagged List of ids of the actor comments the participant flagged ActorsBlocked List of actor usernames the participant blocked ActorsReported List of actor usernames the participant reported, and the reason for reporting Formatted like: __, Reported for __ ActorsFollowed List of actor usernames the participant followed TimeOnSite Total amount of time (in seconds) participant spent on site PageLog List of page URLs the participant visited [](#analyzing-the-data-and-paying-participants) Analyzing the Data and Paying Participants ----------------------------------------------------------------------------------------------- You can use programs like R or other analyzing tools to analyze the data, find interesting trends and statistical significance, and compare different conditions. The key that unites the participants' data with any Qualtrics pre-study surveys or Qualtrics post-study surveys results that you have used in your study is the ResponseID (see [Integrating Truman with Qualtrics](/the-truman-platform/getting-started/launching-your-study#integrating-truman-with-qualtrics) for more details) You may also use the Mechanical Turk ID value of participants and the exported data to identify and help with payments/ rewards after the study. [PreviousLaunching Your Study](/the-truman-platform/getting-started/launching-your-study) [NextCitation and Papers](/the-truman-platform/getting-started/citation-and-papers) Last updated 9 months ago (if applicable) Participant's provided Qualtrics ResponseID (see for more details) [Integrating Truman with Qualtrics](/the-truman-platform/getting-started/launching-your-study#integrating-truman-with-qualtrics) --- # Developing your Simulation | The Truman Platform [](#installing-truman) Installing Truman --------------------------------------------- After you have completed translating your research question into an experimental design, you can begin developing your simulation based on your design. Begin by [installing Truman](/the-truman-platform/getting-started/developing-your-simulation#installing-truman) on your local computer. [](#understanding-the-timeline) Understanding the timeline --------------------------------------------------------------- The Truman Platform looks and feels like a real social networking site, because it is a social networking site. Researchers can curate, create, and control every actor, post, like, comment, notification, and interaction on the social networking site. Every one of these interactions and behaviors is defined around _the moment the participant joins the site_, so each participant has their own individual timeline within the study. For example, when simulating posts to be on the website, you define when a research participant will perceive the post to have been posted. Anything given a negative time (ex: -12:30) is viewed as something posted in the past or before the participant joined the site (ex: 12 hours and 30 minutes before), while anything with a positive time (5:30) is viewed as something posted in the future or after the participant joined the site (5 hours and 30 minutes after). These posts are staggered throughout the duration of the study (with some negative times) to emulate a real experience. As a result, the Truman platform manages parallel simulations for all study participants. Study participants don’t connect or interact with any other real participant on the site, even though they believe they do, and all participants are exposed to the same social interactions, posts, and responses (except for variations controlled by the experimental condition of the study and the participant's own posting behavior) within a controlled environment that looks and feels realistic. [](#creating-a-simulation-how-to-translate-your-design-into-simulations) Creating a Simulation: How to translate your design into simulations -------------------------------------------------------------------------------------------------------------------------------------------------- A Truman simulation is the simulated social media environment that a research participant experiences. Here is what you need to build your own simulation: * **Actors**: Actors are the simulated users on the platform that research participants believe are real people. You’ll create personas for all actors in the simulation. This includes information such as usernames, names, bios, and profile photos. * **Posts**: Posts are the simulated posts on the platform feed/timeline. All posts include images and text. When defining the simulated posts, you will need to consider the timing of the posts (as described [above](/the-truman-platform/getting-started/developing-your-simulation#understanding-the-timeline) ) and the comments left by other actors on the posts. * **Notifications:** Notifications are the behavioral feedback of the actors in response to a research participant's behavior on the platform. For example, when a participant makes a post on the feed, you can define notifications that are sent to the participant that indicate other actors on the site viewed or liked the post. This reinforces the realism of the platform and signals to the participant that there are other "people" on the website too. See [](https://docs.google.com/document/d/1GHOmo3c-t7Xhzb53DsQdd52zJ73x68fwch9-yn7dvss/edit) [Defining your Simulation](/the-truman-platform/setting-up-truman/defining-your-simulation) for more details on creating the simulation. ### [](#displaying-different-simulation-content-for-different-experimental-conditions) Displaying different simulation content for different experimental conditions Researchers can readily display different simulation _content_ (specifically, different actors, posts, comments, notifications) for different experimental conditions by labeling them in the Truman Platform infrastructure. See [](https://docs.google.com/document/d/1GHOmo3c-t7Xhzb53DsQdd52zJ73x68fwch9-yn7dvss/edit) [Defining your Simulation](/the-truman-platform/setting-up-truman/defining-your-simulation) for more details on how to display different simulations for different experimental conditions. ### [](#displaying-different-simulation-interfaces-for-different-experimental-conditions) Displaying different simulation interfaces for different experimental conditions Researchers can also display different simulation _interfaces_ for different experimental conditions; however, coding experience is needed and requires the researcher to make changes to the codebase to develop the different interfaces and logic for display. [PreviousInitial Experimental Design](/the-truman-platform/getting-started/initial-experimental-design) [NextLaunching Your Study](/the-truman-platform/getting-started/launching-your-study) Last updated 25 days ago --- # Best practices for simulation building | The Truman Platform [](#best-practices-for-simulation-building) Best Practices for Simulation Building --------------------------------------------------------------------------------------- * Create the actors first. * Be creative but not TOO creative. Aim for believability. * Remember who your target audience and participants will be. * Be consistent! * Use profile images that are not easily found on Google Images. * Don’t be too perfect! Most people don’t fill everything out completely. * Then, create posts for your actors. * Use (or get) your own images that look “real” and not easily found online. * Be consistent! Two bots can’t have the same kitchen if you haven’t stated somewhere that they live together, etc. * Be fun and create a story for your bot. What is their day like? What do they post? What do they like? * Spread out the timing of posts and follow the same rules you listed for participants (remember these bots should look and act like other participants in the study). * Create some spam/political infighting/internet drama/web trash as no site is perfect. * Think about “likes” the posts get, what is popular on the site, what is not. * After creating posts, create comments on these posts. * Be quick and short. * Positive but not too positive. * Role play as your actor, do all your comments for one actor at a time, role-playing as that actor. * Have some small conversations between actors in the comments. * This is where we create “community”. * Define actor behaviors (liking, reading, commenting) in response to participant behavior. * When making comments in response to a participant's posts, make it super generic. It should be a comment that could apply to ANY photo. * Make a few, but not too much (no more than what you have created as normal for other posts on the site already). * Write together as a research team. * If you are creating and writing a simulation collaboratively, upload the CSV files to Google Docs or Box. Makes it much easier to edit together. * Test test test! * Live in your simulation and experience what feels real or fake. * Test with those who have not used your simulation before, and get their opinion on the realism and believability of the simulation. [PreviousSimulation components](/the-truman-platform/setting-up-truman/defining-your-simulation/simulation-components) [NextFrequently Asked Questions](/the-truman-platform/setting-up-truman/defining-your-simulation/frequently-asked-questions) Last updated 4 months ago --- # People | The Truman Platform [PreviousDeploying Truman Online](/the-truman-platform/setting-up-truman/deploying-truman-online) [NextContact us](/the-truman-platform/contact-us) Last updated 9 months ago A multidisciplinary team of researchers and developers throughout the years have worked on and made significant contributions to the conception, design, development, and testing of The Truman Platform. This across-discipline collaboration makes the platform what it is today. ### [](#current-team-members) Current Team Members ### [](#past-team-members) Past Team Members **Dominic DiFranzo** Assistant Professor, Department of Computer Science & Engineering _LeHigh University_ **Natalie Bazarova** Professor, Department of Communication _Cornell University_ **Qian Yang** Assistant Professor, Department of Information Science _Cornell University_ **Winice Hui** Applications Programmer, Department of Communication _Cornell University_ **Philipp Masur** Assistant Professor, Department of Communication Science _Vrije Universiteit Amsterdam_ **Marie Ozanne** Assistant Professor, Nolan School of Hotel Administration _Cornell University_ **Beichen Ma** Current Master of Science student ('25), Department of Computer Science _Cornell University_ **Jessie Jia** Current Undergraduate student ('26), Department of Computer Science _Cornell University_ **Asad Nabi** Current Undergraduate student ('25), Department of Computer Science _Cornell University_ **Pengfei Zhao** Current Ph.D. student, Department of Communication _Cornell University_ **Inhwan Bae** Current Ph.D. student, Department of Communication _Cornell University_ **Eunice Han** Social Media Lab Lab Manager, Department of Communication _Cornell University_ --- # Frequently Asked Questions | The Truman Platform [PreviousBest practices for simulation building](/the-truman-platform/setting-up-truman/defining-your-simulation/best-practices-for-simulation-building) [NextFile Directory](/the-truman-platform/setting-up-truman/file-directory) Last updated 25 days ago I uploaded my new simulation pictures into the project file directory `**/input**` and the file names in my csv files exactly match the file names of my pictures, but I still don't see the new pictures loaded in my simulation. What should I do?[](#i-uploaded-my-new-simulation-pictures-into-the-project-file-directory-input-and-the-file-names-in-my) Check that you have defined the CDN URL value properly. Navigate to the `.env` file: 1. If you are not using a CDN, remove the line `CDN=https://d35ayucabfexcy.cloudfront.net`. 2. If you are using a CDN, replace the URL with your CDN URL. 3. If you do not know if you are using a CDN or not, you are likely not using one, so remove the line of code. Save the file, then restart your local environment. In the Terminal/Command prompt: 1. If the application is already running, enter CTRL+C, then Y to stop the application. 2. Start your application again by entering `npm run dev` . I updated the simulation content by changing the csv files in the project file directory `**/input**`, but I don't see the new content in my simulation. What should I do?[](#i-updated-the-simulation-content-by-changing-the-csv-files-in-the-project-file-directory-input-but-i) Make sure you have repopulated the database with the new simulation content by entering the command in the terminal/command prompt: `node populate.js`, which runs the script populate.js. Note: Every time you make any changes to the csv files, you will need to repopulate your databases with the csv content (whether that is the database you are using for your local Truman or your deployed Truman). This is because the simulation gets the simulation content from the database, and not the csv files. How do I use emojis in the simulation content?[](#how-do-i-use-emojis-in-the-simulation-content) To see emojis in your csv files and to use emojis in your simulation content, you will need to ensure your csv files are opened and saved as a CSV UTF-8 (Comma delimited) (\*.csv) file format. More information about this is found under the note _"How to edit the csv files..."_ on the page. A participant emailed me saying they have forgotten their account password. What should I do?[](#a-participant-emailed-me-saying-they-have-forgotten-their-account-password.-what-should-i-do) All passwords are hashed when saved in the database. They are never saved "as is", to ensure the privacy and security of all Truman users. Therefore, no one knows their password, even the researcher. So, the only way to assist them is to reset their account with a new temporary password and to send them the new temporary password. To do this, you will need to run the script **updatePassword.js,** which connects to the database defined in the **.env** file, finds the right user, and updates their password. To run this script, enter in the terminal/command prompt from the root directory of your project: `node updatePassword.js ` . Replace and with the email associated with the desired account and the new password (for example: `node updatePassword.js johndoe@gmail.com 12345`). Ensure that that you run this command on your server if the account you are changing the password to is for your _deployed_ application (so that it finds and changes the account in the right database). Afterwards, you will need to send the participant their new temporary password. Please remind them that they will need to change the password again for their own security and privacy by going to the **Update My Profile** page on the website. How do I display different simulations for different experimental conditions?[](#how-do-i-display-different-simulations-for-different-experimental-conditions) You can readily display different _**simulation content**_ (example: actors, posts, comments, notifications) for different experimental conditions by using the `**.env**` file and the input csv files. In the `.env` file, 1. Define the environmental variable `NUM_EXP_CONDITIONS` with the # of experimental conditions you have. For example: Copy NUM_EXP_CONDITIONS=5 2. Define the environmental variable `EXP_CONDITIONS_NAMES` with the names of your experimental conditions. Each name should be separated with a comma, with no spaces in between. For example: Copy EXP_CONDITIONS_NAMES=marginal,unambig_flag,troll,ambig_flag,unambig_none See [here](/the-truman-platform/setting-up-truman/defining-your-simulation/basic-simulation-components) for more information about the environmental variables and how to change them. Then, in the input csv files, use the column **condition** to label which condition certain simulation content should be displayed in. The labels in this column must exactly match one of the experimental conditions names listed in `EXP_CONDITIONS_NAMES` in the `.env` file. However, displaying different _**interfaces**_ for different experimental conditions will require coding experience. You will need to make changes in the codebase to develop the different interfaces and logic for display. How do I bring in new updates that have been made to the original Truman GitHub repository into my own GitHub repository?[](#how-do-i-bring-in-new-updates-that-have-been-made-to-the-original-truman-github-repository-into-my-o) On occasion, we push new code updates or bug fixes to the [Truman GitHub repository](https://github.com/cornellsml/truman_2023) . This may happen after you have forked your own GitHub repository from this repository, in which case you would like to bring in these new code changes into your repository. To do this, follow the instructions here: [https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork) It is possible that as you do this, you will need to resolve merge conflicts (i.e. differences in code) manually. [How to define the simulation components](/the-truman-platform/setting-up-truman/defining-your-simulation/simulation-components#how-to-define-the-simulation-components) --- # Citation and Papers | The Truman Platform [PreviousExporting Study Data](/the-truman-platform/getting-started/exporting-study-data) [NextInstalling Truman](/the-truman-platform/setting-up-truman/installing-truman) Last updated 7 months ago The Truman Platform was first created in 2018 by [Dominic DiFranzo](https://difranzo.com/) and [Natalie Bazarova](https://cals.cornell.edu/natalie-bazarova) to study [bystander interventions on cyberbullying](https://dl.acm.org/doi/10.1145/3173574.3173785) . Since then, the platform has been generalized to provide social scientists a research infrastructure to explore and study a variety of research questions and topics. Below are papers and studies that have used The Truman Platform (though not an exhaustive list) that may be helpful to understand how The Truman Platform has been used. ### [](#papers) Papers Zhao, P., Bazarova, N. N., DiFranzo, D., Hui, W., Kizilcec, & Margolin, D. (2024). [Standing up to problematic content on social media: which objection strategies draw the audience’s approval?](https://doi.org/10.1093/jcmc/zmad046) _Journal of Computer-Mediated Communication_, 29(1). ([GitHub repository](https://github.com/cornellsml/truman_objection/tree/study-1-official-code) , [Demo site](https://truman-objections-v1-5d359188df22.herokuapp.com/feed_no?off_id=0&obj_t_id=0&obj_m_id=0) ) Agha, Z., Park, J., Wan, R., Ali, N.S., Wang, Y., DiFranzo D., Badillo-Urquiola, K., & Wisniewski, P.J. (2024). [Tricky vs. Transparent: Towards an Ecologically Valid and Safe Approach for Evaluating Online Safety Nudges for Teens.](https://doi.org/10.1145/3613904.3642313) In _Proceedings of the 2024 ACM Conference on Human Factors in Computing Systems (CHI’24)_. Aghajari, Z., Baumer, E., Lazard, A., Dasgupta N., & DiFranzo, D. (2024). [Investigating the Mechanisms by which Prevalent Online Community Behaviors Influence Responses to Misinformation: Do Perceived Norms Really Act as a Mediator?](https://doi.org/10.1145/3613904.3641939) In _Proceedings of the 2024 ACM Conference on Human Factors in Computing Systems (CHI’24)_. Aghajari, Z., Baumer, E., & DiFranzo, D. (2023). [What’s the Norm Around Here? Individuals’ Responses Can Mitigate the Effects of Misinformation Prevalence in Shaping Perceptions of a Community.](https://dl.acm.org/doi/10.1145/3544548.3580946) In _Proceedings of the 2023 ACM Conference on Human Factors in Computing Systems (CHI'23)_. ([GitHub repository](https://github.com/ZhilaAghajari/truman_norm) , [Demo site](https://truman-socialnorms-misinfo-b5026dae9ab0.herokuapp.com/) ) Bhandari, A., Ozanne, M., Bazarova, N. N., & DiFranzo, D. (2021). [Do you care who flagged this post? Effects of moderator transparency on bystander behavior.](https://doi.org/10.1093/jcmc/zmab007) _Journal of Computer-Mediated Communication_, 26(5), 284-300. ([GitHub repository](https://github.com/cornellsml/truman_content_moderation) , [](https://github.com/cornellsml/truman_content_moderation) [Demo site](https://truman-content-moderation.herokuapp.com/) ) Masur, P., DiFranzo, D., & Bazarova, N. (2021). [Behavioral contagion on social media: Effects of social norms, design interventions, and critical media literacy on self-disclosure.](https://doi.org/10.1371/journal.pone.0254670) _PLoS ONE 16(7)_, e0254670. ([GitHub repository](https://github.com/difrad/social_norms_truman) , [](https://github.com/difrad/social_norms_truman) [Demo site](http://truman-socialnorms.herokuapp.com/) ) Taylor, S., DiFranzo, D., Choi, Y. H., Sannon, S., and Bazarova, N. (2019). [Accountability and empathy by design: Encouraging bystander intervention to cyberbullying on social media](https://dl.acm.org/doi/abs/10.1145/3359220) . _Proceedings of the ACM on Human Computer Interaction Journal (PACM CHI Journal)_, 3, 1-26. ([GitHub repository](https://github.com/difrad/truman_esl_empathy) , [Demo site](http://truman-esl-empathy.herokuapp.com/) ) DiFranzo, D., Choi, Y.H., Purington, A., Taft, J.G., Whitlock, J., Bazarova, N.N. (2019). [Social Media TestDrive: Real-World social media education for the next generation](https://dl.acm.org/doi/10.1145/3290605.3300533) . In _Proceedings of the 2019 ACM Conference on Human Factors in Computing Systems (CHI’19)_. Glasgow, UK. ([GitHub repository](https://github.com/social-media-testdrive/truman_testdrive) ) DiFranzo, D., Taylor, S. H., Kazerooni, F., Wherry, O. D., & Bazarova, N. N. (2018). [Upstanding by Design: Bystander intervention in cyberbullying](https://dl.acm.org/doi/10.1145/3173574.3173785) . In _Proceedings of the 2018 ACM Conference on Human Factors in Computing Systems (CHI’18)._ ([GitHub repository](https://github.com/difrad/truman_ESL_cyberbully) , [Demo site](https://truman-esl-cyberbully.herokuapp.com/) ) DiFranzo, D. & Bazarova, N. N. (2018). [The Truman Platform: Social media simulation for experimental research](https://socialmedialab.cornell.edu/files/2020/10/Truman_ICWSM_workshop.pdf) . Workshop paper presented at The 12th International Conference on Web and Social Media (ICWSM ’18), Stanford, CA. [](#citing-the-truman-platform-in-your-research-paper) Citing The Truman Platform in your research paper ------------------------------------------------------------------------------------------------------------- You may use the following citation when citing The Truman Platform in your research paper: DiFranzo, D. & Bazarova, N. N. (2018). [The Truman Platform: Social media simulation for experimental research](https://socialmedialab.cornell.edu/files/2020/10/Truman_ICWSM_workshop.pdf) . Workshop paper presented at The 12th International Conference on Web and Social Media (ICWSM ’18), Stanford, CA [](#sharing-your-findings-with-us-through-email) Sharing your findings with us through email ------------------------------------------------------------------------------------------------- We would love to hear about your study findings and contribution to the research community. Please email us a study report after you have completed your study to [cornellsocialmedia@gmail.com](mailto:cornellsocialmedia@gmail.com) . ![](https://truman.gitbook.io/~gitbook/image?url=https%3A%2F%2F797468930-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FOR396HK0xjvBHL78w6Qi%252Fuploads%252F14vcQkcP9qdMsmTIrx2O%252Fimage.png%3Falt%3Dmedia%26token%3D99b3d00f-8146-42ce-8cc1-9d2057788e70&width=768&dpr=4&quality=100&sign=1e95bdc8&sv=2) --- # Launching Your Study | The Truman Platform Deploying Truman Online After developing and testing your simulation on your local computer, you are ready to begin testing it publicly. To test, pilot, and launch your Truman application with other people (outside of your laptop), you will need to create a public facing version of Truman, i.e. deploy your Truman application. Deploying your Truman application requires some server skills, but we have provided instructions on where and how to deploy a public facing Node.js application like Truman without much server skills. See [Deploying Truman Online](/the-truman-platform/setting-up-truman/deploying-truman-online) for instructions on how to deploy Truman publicly. ### [](#other-things-to-change) Other things to change Before deploying your application online, there may be some additional things you would like to consider changing: * Site logo: Instructions on how to change the site logo can be found [here](/the-truman-platform/setting-up-truman/defining-your-simulation/basic-simulation-components#how-to-change-these-components) . * Site name: Instructions on how to change the site name can be found [here](/the-truman-platform/setting-up-truman/defining-your-simulation/basic-simulation-components#how-to-change-these-components) . * Link to your post survey: Instructions on how to change the post survey link can be found [here](/the-truman-platform/setting-up-truman/defining-your-simulation/basic-simulation-components#how-to-change-these-components) . * Welcome page and platform community rules: You may change these in the `/views/info.pug` and `/views/com.pug` file respectively. * The look and feel of the site: You may change these with css in the `/public/css/ui_layout.css` file. It is important to modify your study’s interface (including logo, name, look, and feel of the website) sufficiently so that it does not look absolutely identical to [past Truman projects](/the-truman-platform/getting-started/citation-and-papers#papers) (or the default EatSnap.Love cover story project). [](#testing) Testing ------------------------- It is important that you test out your application before launching it as a study. Make sure you test it out with yourself and with other researchers. Some things you want to look out for when testing include: * salience of your experimental manipulation * interface design issues * technical bugs or broken functionalities * consistency and cohesiveness of the simulation To effectively make use of testing, try to test every experimental condition in your study for one entire duration of the study. Make sure that the condition is displaying the appropriate simulation content or interface that you want. Also, while Truman automatically manages the time scope of the study, it doesn’t hurt to double check that the simulation ends when it is supposed to end. [](#piloting) Piloting --------------------------- In addition to testing, it’s good to run a few pilot studies. Pilot studies are condensed/smaller versions of the actual study. They’re meant to find and sort out bugs and kinks before running the actual study with participants. They can also inform you if you need to make any necessary adjustments to your current study design. The more you test the design of the study in the beginning, the less you have to worry about problems down the line. It is helpful to run your pilot study from beginning to end (including any pre-surveys and post-surveys). This will help guarantee that the actual study will run as smoothly as possible. Pilot with both participants that you can meet and interview (so that you can get more information about the experience of the experiment) and with your anticipated participation pool (such as on MTurk, testing all the parts of the study on a small sample before you launch for a full study). [](#participant-workflow) Participant workflow --------------------------------------------------- Below is a flowchart mapping the typical workflow of a research participant. [](#running-the-study-participant-recruitment-and-qualtrics) Running the Study: Participant Recruitment & Qualtrics ------------------------------------------------------------------------------------------------------------------------ Once you are satisfied with your simulation, it is time to run the study. ### [](#recruiting-participants) **Recruiting Participants** The easiest way to recruit research participants is through the use of crowdsourcing platforms. Amazon’s Mechanical Turk (MTurk), CloudResearch, and Prolific are some such platforms. Using MTurk or CloudResearch, your study can be posted as a “HIT” (Human Intelligence Task) on MTurk’s database, giving you access to tens of thousands of possible participants (similarly with Prolific). Participants can be compensated for different requirements, like payment at the time of total completion or payment for total number of hours/ days spent on the Truman instance. Note: Participants will never interact with other participants, so their personal information is never displayed to others. It is only saved in the database, which only the researcher has access to. Passwords to their accounts are also always hashed. ### [](#integrating-truman-with-qualtrics) **Integrating Truman with Qualtrics** It is common for researchers to launch a Truman simulation alongside a pre-study survey and a post-study survey for their study. The pre-study survey is typically given to the research participant prior to their access of Truman and is used to gather information about the participant before they begin the study. At the end of the pre-survey, the participant is usually then directed to The Truman Platform via a provided link (your Truman application's website URL). The post-study survey is typically given to the research participant after they have completed their study time on Truman. The post-survey is used to gather further data for the study. When pre-study surveys and post-study surveys are used, it is essential to be able to match participant survey responses with their behavior on The Truman Platform. The Truman Platform currently has infrastructure to do this with Qualtrics. The _ResponseID_ is an ID Qualtrics uses to identify each survey response in the database. This value is unique and automatically exported in Qualtrics datasets. This value can be passed to Truman and attached to a participant's account at initial account signup via passing the value in as a URL query parameter `r_id`(see [Passing information from a Qualtrics Survey](https://www.qualtrics.com/support/survey-platform/survey-module/survey-flow/standard-elements/passing-information-through-query-strings/#PassingInformationFromASurvey) for more information). This same value can then be passed to a post-study survey and recorded as an embedded data variable in Qualtrics as well (see [Passing information to a Qualtrics Survey](https://www.qualtrics.com/support/survey-platform/survey-module/survey-flow/standard-elements/passing-information-through-query-strings/#PassingInformationIntoASurvey) for more information). As a result, you can then match a participant's pre-study survey response (with`ResponseID`), behavioral data on Truman (with `ResponseID`), and post-study survey response (with the variable of your embedded data) together. Below is a diagram that describes how to integrate Qualtrics with The Truman Platform and outlines this mechanism more in detail: [PreviousDeveloping your Simulation](/the-truman-platform/getting-started/developing-your-simulation) [NextExporting Study Data](/the-truman-platform/getting-started/exporting-study-data) Last updated 25 days ago ![](https://truman.gitbook.io/~gitbook/image?url=https%3A%2F%2F797468930-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FOR396HK0xjvBHL78w6Qi%252Fuploads%252Fup9j5qOsfe4VtQBRcrPU%252FTruman%2520Participant%2520workflow.jpg%3Falt%3Dmedia%26token%3De921e0a0-c4c6-429f-bae8-f4ed48009fc9&width=768&dpr=4&quality=100&sign=312a537f&sv=2) ![](https://truman.gitbook.io/~gitbook/image?url=https%3A%2F%2F797468930-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FOR396HK0xjvBHL78w6Qi%252Fuploads%252FjFpV8liH4jjDOg670JTg%252FTruman%2520%2526%2520Qualtrics%2520workflow%2520%283%29.png%3Falt%3Dmedia%26token%3Db63ab657-e646-47e3-a962-b472f05c4640&width=768&dpr=4&quality=100&sign=250e5099&sv=2) --- # Contact us | The Truman Platform Please feel free to send us an email at [cornellsocialmedia@gmail.com](mailto:cornellsocialmedia@gmail.com) (Cornell Social Media Lab) if you have any questions or feedback. We would love to help and connect with you! [PreviousPeople](/the-truman-platform/people) Last updated 1 year ago --- # Basic simulation components | The Truman Platform [PreviousDefining your Simulation](/the-truman-platform/setting-up-truman/defining-your-simulation) [NextSimulation components](/the-truman-platform/setting-up-truman/defining-your-simulation/simulation-components) Last updated 1 month ago Before you begin defining the simulation content (such as actors, posts, comments, notifications), you may want to change other components of the simulation. Below are some simulation components that can be changed via the environment variables `.env` file. These include the site name and logo, the number and names of the experimental conditions on your site, and feed order. See the table below for a list and description of these components. Environment Variable Description `POST_SURVEY` (Optional) _The URL to the post-study survey_. You may want participants to complete a survey when they have completed the study. If yes, define this variable with your survey link. It is shown when the participant tries to log in to their account after their study is complete. `POST_SURVEY_WITH_QUALTRICS` `IDENTIFIER` `RESEARCHER_EMAIL` `NUM_DAYS` _Study duration (a numerical value; in # of days)._ This indicates how long the simulation should last for participants. So, after the specified number of days has passed since a participant creates their account, their account will be deactivated, and they will not be able to access the site after. 1 day is 24 hours. `SITE_NAME` _Platform Name._ This is shown throughout the platform. `SITE_LOGO` _File path to the platform logo._ This is shown throughout the platform, specifically via the header. `SITE_PICTURE` `NUM_EXP_CONDITIONS` _The number of experimental conditions in the experiment._ This variable works in conjunction with the variable below. Participants are randomly assigned to an experimental condition upon account creation. This variable defines how many conditions there should be. `EXP_CONDITIONS_NAMES` _The names of the experimental conditions in the experiment._ Separate the names with a comma, but no spaces (ex: var1,var2,var3). This variable works in conjunction with the variable above. Participants are randomly assigned to an experimental condition upon account creation. This variable defines the labels (names) of these experimental conditions. The names as they appear here are also how they appear in the database. `FEED_ORDER` _Indicates how you would like the feed to be shown._ Available values include: * CHRONOLOGICAL: The posts will be shown chronologically on the feed/timeline. * SHUFFLE: The feed posts will be shuffled on the feed/timeline. `CDN` (Optional) _CDN URL_. A content delivery network (CDN) is a network of interconnected servers that caches content near end users. Using a CDN can speed up webpage loading for data-heavy applications. In The Truman Platform, a CDN can be used to deliver your actor profile pictures and post pictures. In the default `.env` file, a CDN URL is provided, but it is for the default simulation. Therefore, **if you change the simulation content** (i.e. define new actors, posts, comments, etc.), **you will need to:** 1. **Remove this line from the** `**.env**` **file** or 1. **Change the CDN URL to point to the CDN you are personally using to deliver the static content (pictures).** Note: When setting up your CDN, ensure that the bucket that contains your content has a folder `./post_pictures` (where all the post pictures are placed in) and a folder `./profile_pictures` (where all the profile pictures are placed in). `REMOVE_FLAGGED_CONTENT` _TRUE/FALSE_ When _TRUE_, flagged content (posts and comments) are entirely from timeline. When _FALSE_, flagged content appear with an overlay and gives participant the option to unflag the content. ### [](#how-to-change-these-components) How to change these components These components can be changed in the `.env` file found in the project folder. It looks like the following when opened with a text file editor: To change or define a variable, replace the value after the equals sign of the corresponding variable with your desired value. * For example: * If you would like to change the site name to “FootballForums”, then you will need to change the line: * `SITE_NAME=eatsnap.love` to `SITE_NAME=FootballForums` When changing variable names, there should be no spaces between the variable name, equals sign, and variable value. The following **will not work** because of spacing between the equals sign**.** * `SITE_NAME= FootballForums` * `SITE_NAME = FootballForums` If your variable _value_ has a space, enclose the value with quotes. For example: `SITE_NAME="Football Forums"` If you'd like to integrate this post-study survey with Qualtrics, see . Remember to append **?r\_id=** to the end of your survey link and set `POST_SURVEY_WITH_QUALTRICS` to `TRUE`. If no, remove this variable from the `.env` file by removing the line from the file. _TRUE/FALSE_ This label indicates if you would like to integrate a Qualtrics post-study survey with your study. See for more information. _Label for participant unique identifier._ This label is shown on the form on the _Sign Up_ page. It prompts participants to provide their unique identifier. _The contact email of the researcher._ This is shown on the _Forgot Your Password_ page so that participants' may contact you for their password to be reset. See for more information on what to do if a participant has forgotten their password. _File path to the platform picture._ This is shown on the _Login_ and _Sign Up._ [Integrating Qualtrics with Truman](/the-truman-platform/getting-started/launching-your-study#integrating-truman-with-qualtrics) [FAQs](/the-truman-platform/setting-up-truman/defining-your-simulation/frequently-asked-questions) [Integrating Qualtrics with Truman](/the-truman-platform/getting-started/launching-your-study#integrating-truman-with-qualtrics) ![](https://truman.gitbook.io/~gitbook/image?url=https%3A%2F%2F797468930-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FOR396HK0xjvBHL78w6Qi%252Fuploads%252FG1EazYsGOIXiCEH6LZP5%252Fimage.png%3Falt%3Dmedia%26token%3Deb62d919-5e0c-4551-8bc2-202413a73d42&width=300&dpr=4&quality=100&sign=e9da9856&sv=2) ![](https://truman.gitbook.io/~gitbook/image?url=https%3A%2F%2F797468930-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FOR396HK0xjvBHL78w6Qi%252Fuploads%252Fa5GP5UAripdATVjhlsIL%252Ftempsnip.png%3Falt%3Dmedia%26token%3D194b8565-5bde-4ed0-8e0a-7d6b5ded202a&width=300&dpr=4&quality=100&sign=4c7bd28f&sv=2) ![](https://truman.gitbook.io/~gitbook/image?url=https%3A%2F%2F797468930-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FOR396HK0xjvBHL78w6Qi%252Fuploads%252FqUEJjfRk0fydpYPgogaY%252Ftempsnip.png%3Falt%3Dmedia%26token%3D74d7f255-364f-424f-93eb-73ca45906b71&width=300&dpr=4&quality=100&sign=5602b2db&sv=2) ![](https://truman.gitbook.io/~gitbook/image?url=https%3A%2F%2F797468930-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FOR396HK0xjvBHL78w6Qi%252Fuploads%252FLDGo5Bo7N3uTb1NH7jfy%252Fimage.png%3Falt%3Dmedia%26token%3D6f74bb0e-f024-4c2f-b363-e23603e0c5ad&width=768&dpr=4&quality=100&sign=1fb92045&sv=2) --- # Setting up Truman locally | The Truman Platform The following steps will guide you through how to set up your own version of The Truman Platform. At the end, you should have a running version of the project on your local computer. Below is a brief overview of the steps you will take to set up Truman locally: 1. [Creating a MongoDB database instance](/the-truman-platform/setting-up-truman/installing-truman/setting-up-truman-locally#creating-a-mongodb-database-instance) 2. [Downloading the code from GitHub](/the-truman-platform/setting-up-truman/installing-truman/setting-up-truman-locally#downloading-the-code-from-github) 3. [Setting up Truman](/the-truman-platform/setting-up-truman/installing-truman/setting-up-truman-locally#setting-up-truman) The instructions for each step are outlined below. * * * [](#creating-a-mongodb-database-instance) Creating a MongoDB database instance ----------------------------------------------------------------------------------- The Truman Platform uses MongoDB as its database system. It is where participant data, simulation data, and more is stored. MongoDB Atlas is a managed cloud database service that hosts MongoDB databases. We will be using MongoDB Atlas to easily set up a free MongoDB database. ### [](#step-1-create-an-account-on-mongodb-atlas) Step 1: Create an account on MongoDB Atlas 1. Go to [https://www.mongodb.com/atlas/database](https://www.mongodb.com/atlas/database) . 2. Click the green **Try Free** button in the top right of the header. 3. Sign up for an account by filling in your new account information and then clicking the **Create your Atlas account** button. After verifying your account, sign into your new account. 4. Upon signing in, you should be directed to the **Database Deployments** page. ### [](#step-2-create-a-mongodb-database) **Step 2: Create a MongoDB database** 1. Click the green **Build a Database** button. You will be redirected to a selection page. 1. Choose the free database available. 2. Choose AWS as the provider. 3. Choose a region within the United States (ex: 'N. Virginia (us-east-1)'). 4. Give your Cluster a name (ex: 'truman'; the default is 'Cluster0'). 5. You do not need to change any of the other selected default options. 6. Click on the green **Create** button. 2. Wait for a while as your cluster is created (might take 5-8 minutes). 3. After the cluster is created, you will be redirected to the **Security Quickstart** page. Instead of defining Database Access and Network Access here, we will do it another way. 4. First, create a new MongoDB user. 1. Navigate to **Security** \> **Database Access** via the left navigation panel. 2. Click the green **Add a New Database User** button. 3. Choose the authentication method: **Password**. 4. Under Password Authentication, create a username and password for the MongoDB User. You will need to remember both of these values. 5. Under **Database User Privileges**, choose the built in role: **Atlas Admin**. 6. You do not need to complete or select anything else. Click the green **Add User** button. 5. Afterwards, you will set up Network Access to your database. 1. Navigate to **Security** \> **Network Access** via the left navigation panel. 2. Click the green **Add IP Address** button. 3. Click **Allow Access from Anywhere**. This will add 0.0.0.0/0 to the field **Access List Entry**. Click **Confirm** to save the 0.0.0.0/0 whitelist. 6. Afterwards, navigate to the Clusters page by clicking **Deployment** \> **Database** via the left navigation panel. Then, click on the **Connect** button under the name of your cluster (the default name was Cluster0, if you did not change it). A screen should then appear. 1. Under **Connect Your Application**, choose the connection security **Drivers**. 2. In the new screen: 1. Select **Node.js** as the Driver and Version **5.5 or later** in Step 1. 2. Ignore Step 2. 3. Copy the URL Connection String in Step 3. Then: 1. Replace __ in this connection string with the password you used when creating the MongoDB user in Step 4 earlier (hint: replace ALL of , including the < and > with the value of your password). 2. Between the backslash ('/') and question mark ('?'), insert the name of your cluster (the default name was Cluster0, if you did not change it). 3. Keep this URL Connection String handy (record it somewhere, but do not share it online) as you will use it later in your application code to connect Truman to this database. 3. (optional) Download [MongoDB Compass](https://www.mongodb.com/products/tools/compass) 1. MongoDB Compass is the GUI for MongoDB. It is a free interactive tool that lets you easily see the objects/data in the database. It is also helpful for querying, optimizing, and analyzing MongoDB data. 2. This is an optional step only if you want to easily see the objects in the database, which is helpful for testing purposes (you can skip this step if you would like). [](#downloading-the-code-from-github) Downloading the code from GitHub --------------------------------------------------------------------------- The most recent codebase for The Truman Platform can be found here: [https://github.com/cornellsocialmedialab/truman\_2023](https://github.com/cornellsocialmedialab/truman_2023) . This repository contains the most recent code (last updated in September 2023), which includes a variety of updates since the original project (which was created in 2019). We recommend using this repository. However, if you would like to use the original project repository, you can find it here: [https://github.com/cornellsml/truman](https://github.com/cornellsml/truman) . ### [](#step-1-create-your-own-truman-repository-codebase-using-the-most-recent-codebase) **Step 1: Create your own Truman repository (codebase) using the most recent codebase** You will use the Truman codebase as a template to create your own code repository of Truman. This allows you to create your own projects without affecting the main Truman source code. 1. Go to [GitHub](https://github.com/) , and sign into your account. 2. Then, go to [https://github.com/cornellsocialmedialab/truman\_2023](https://github.com/cornellsocialmedialab/truman_2023) . 3. Click the green button that says **Use This Template**. Then, click **Create a new repository**. 1. You should be redirected to a new page with a form to create a new repository. Complete this form: 1. Give your repository a name (for example: "truman-socialnormsproject"). 2. Set a description for your repository (optional). 3. Select the "Public" option to make your repository public. 4. Click **Create repository**. You now have your own version of Truman on your own GitHub account! ### [](#step-2-cloning-your-truman-project-onto-your-local-computer) **Step 2: Cloning your Truman project onto your local computer** Now that you have a version of Truman on your own GitHub account, clone this codebase onto your local machine. Cloning creates a local copy of the code on your own laptop. Having a local copy of the code on your laptop allows you to make changes to the code and test and observe them locally before pushing them publicly to the repository or for deployment. 1. For instructions on how to clone your repository, see [here](https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository) . You can either use (1) the terminal/command prompt (as seen in the above instructions) or (2) the GitHub Desktop application, which you downloaded earlier (see [here](https://help.github.com/en/desktop/contributing-to-projects/cloning-a-repository-from-github-to-github-desktop) for instructions on how). If you are unfamiliar with using the terminal/command prompt, we recommend using the GitHub Desktop application. 2. Be sure to remember which file directory you cloned the repository to on your local computer. [](#setting-up-truman) Setting up Truman --------------------------------------------- Now that you have a local copy of the Truman codebase on your own laptop, we will complete some steps and configuration to get it running. ### [](#step-1-install-the-project-package-dependencies) Step 1: Install the project package dependencies 1. Open the terminal/command prompt. 2. `cd` (change directory) into the file directory you cloned the repository to by entering the command `cd ` and replacing with the file directory path. For example, if you cloned the repository into C:\\Users\\JohnDoe\\Documents\\GitHub\\truman you would enter `cd C:\Users\JohnDoe\Documents\GitHub\truman` in the terminal/command prompt. 3. Next, enter `npm install` in the terminal/command prompt. This installs all the external node libraries for Truman . You are going to see a bunch of lines of code come and go on the screen. This is completely normal. This may take a few minutes as the project needs to download and install a lot of libraries. Afterwards, you should see a screen similar to the one below, with a message like “added XXXX packages
.”, indicating the installation was successful. Note: If the installation prompts you to update npm, you can update npm. However, it is not necessary. ### [](#step-2-create-and-edit-the-environment-file-.env) Step 2: Create and edit the environment file (.env) The purpose of the **.env** (environment) file is to locally store environment-specific variables (with the format KEY=VALUE) on the machine rather than on the cloud server. This is important for sensitive information such as the MongoDB connection string, since we don't want to be visible to the public or else others could have access to the database. An example **.env** file is provided in the codebase (**.env.example**) to help you create this .env file. You will now create the **.env** file and add the MongoDB URL connection string that you saved earlier. This will connect your project with the database you created earlier. 1. Copy the **.env.example** file: MacWindows 1. Enter the following command in the terminal (in the file directory of your project): `cp .env.example .env` This creates a copy of the file **.env.example** to **.env**. 2. You should now have a **.env** file, with all the environment variables in the .env.example copied over. 1. Enter the following command in the command prompt (in the file directory of your project): `copy .env.example .env` This creates a copy of the file **.env.example** to **.env.** 2. You should now have a **.env** file, with all the environment variables in the .env.example copied over. **NOTE:** DO NOT copy the **.env.example** file by copying, pasting, and renaming the file in the File Directory/Explorer. You will encounter errors if you do this. 1. Update the environment variables (specifically the MongoDB URL connection string) in your newly created **.env** file: MacWindows 1. Edit the .env file with nano by entering `nano .env` in the terminal. 2. Replace the value of the key **MONGODB\_URI=** with the URL that you recorded down earlier to tell the application which database to connect to (i.e. replace the value to the right of the equals signs with the connection string; see the screenshot below as an example). Make sure that there are no spaces between the key and the connection string. 3. Exit the nano window with **CTRL+X.** 4. Before exiting, you will be asked if you want to save your changes to the file. Press **Y** and hit **Enter** to save. 5. Next, you will be asked to give the file a name. You do not need to give the file a new name, so simply hit **Enter** again. 1. Edit the .env file with a text editor by entering `.env` in the command prompt. This should open the file in a text editor. 2. Replace the value for the key **MONGODB\_URI=** with the URL that you recorded down earlier to tell the application which database to connect to. Make sure that there are no spaces between the variable and the connection string. (See screenshot below). 3. Then save the file. ### [](#step-3-populate-your-database) Step 3: Populate your database Now that you have indicated in your project which database to connect to, it is time to populate the database with the simulation content. 1. Enter `node populate.js` in the terminal/command prompt. This command runs the script **populate.js**, which connects to the MongoDB database you just defined in the **.env** file and uploads the simulation data found in the csv files in the **./input** folder in the project directory to the MongoDB database you created. 2. You should see something printed similar to this. 1. After the script is done running, go to [https://cloud.mongodb.com/](https://cloud.mongodb.com/) to look at the database you just populated. 1. Click **Database > Clusters** via the left navigation panel. 2. Click on the name of your cluster (the default name was Cluster0, if you did not change it). 3. Under Collections, you should now see 3 new collections in your database, called “actors”, “scripts”, “notifications”. These are the objects that form the simulation (actors, posts, comments, notifications etc.) Note: If you downloaded MongoDB Compass earlier (an optional step), you can also view your database via MongoDB Compass. This may be an easier interface to use than the web browser interface if you plan to manipulate and check the objects in your database often: Open MongoDB Compass on your local machine. When it prompts you to enter a connection string, enter your MongoDB Connection String and click **Connect**. You should then see a very similar interface as the picture above. [](#using-truman-for-the-first-time) Using Truman for the first time! -------------------------------------------------------------------------- 1. Now that everything is installed, we can now run Truman on your local device! Enter `npm run dev` in the terminal/command prompt. This starts your server. 2. Then, go to **http://localhost:3000/** in the browser of your choice. 3. You should be able to see a screen like the one below. 4. Congratulations! You now have your own version of Truman running on your local computer! Create a new account and try out Truman for yourself. [PreviousInstalling the prerequisites](/the-truman-platform/setting-up-truman/installing-truman/installing-the-prerequisites) [NextDefining your Simulation](/the-truman-platform/setting-up-truman/defining-your-simulation) Last updated 4 months ago ![](https://truman.gitbook.io/~gitbook/image?url=https%3A%2F%2Flh4.googleusercontent.com%2Fm1VeYDN_BoJRKbhd-F2bGhiUJyMokOzzerX67DsJpRAZL2TIuJNZ6XI33AGYvPhoUGc0gLOwBSbZE_86y-JGKWguautKn9CNZKWp5-QvWg594Q2o0WxuxjP1fVpUj_jN_r0yQi58AOvaj33ElIKk0Do&width=768&dpr=4&quality=100&sign=cc7e197a&sv=2) ![](https://truman.gitbook.io/~gitbook/image?url=https%3A%2F%2F797468930-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FOR396HK0xjvBHL78w6Qi%252Fuploads%252F1LsZ8tBj9HQOE1pzTmNW%252Fimage.png%3Falt%3Dmedia%26token%3Db24166f7-9783-47fb-900c-54eec8f02297&width=768&dpr=4&quality=100&sign=306e5ac&sv=2) ![](https://truman.gitbook.io/~gitbook/image?url=https%3A%2F%2F797468930-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FOR396HK0xjvBHL78w6Qi%252Fuploads%252FUaFGehekcCVNnFY7CZxG%252Fimage.png%3Falt%3Dmedia%26token%3D0bbeb183-0cfa-4fcd-b76e-dcc79ee25faf&width=768&dpr=4&quality=100&sign=323f1499&sv=2) ![](https://truman.gitbook.io/~gitbook/image?url=https%3A%2F%2F797468930-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FOR396HK0xjvBHL78w6Qi%252Fuploads%252FVfQiHcN3EK8GC8frm7tz%252Fimage.png%3Falt%3Dmedia%26token%3D1ba7b9db-eda4-4edc-a888-1836aab1127f&width=768&dpr=4&quality=100&sign=230f54ad&sv=2) ![](https://truman.gitbook.io/~gitbook/image?url=https%3A%2F%2F797468930-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FOR396HK0xjvBHL78w6Qi%252Fuploads%252FndndQAe3p1k1Xt1erGBv%252Fimage.png%3Falt%3Dmedia%26token%3D5994b0b5-a2cf-4182-b4fa-ae01d04caf04&width=768&dpr=4&quality=100&sign=b26dfca&sv=2) ![](https://truman.gitbook.io/~gitbook/image?url=https%3A%2F%2F797468930-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FOR396HK0xjvBHL78w6Qi%252Fuploads%252F6VSylWT008LkDNQZ939v%252Fimage.png%3Falt%3Dmedia%26token%3D1f1fe488-4d04-42fe-af6e-7bb78b9376ec&width=768&dpr=4&quality=100&sign=e2d43ef0&sv=2) ![](https://truman.gitbook.io/~gitbook/image?url=https%3A%2F%2F797468930-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FOR396HK0xjvBHL78w6Qi%252Fuploads%252F9FkGKT4hHaOOQe42S0gX%252Fimage.png%3Falt%3Dmedia%26token%3Dc027824c-80c8-4a12-a55a-b944fcd510e7&width=768&dpr=4&quality=100&sign=81398d04&sv=2) ![](https://truman.gitbook.io/~gitbook/image?url=https%3A%2F%2Flh4.googleusercontent.com%2Fbo9jg3Q_HFUKBx2X7L4cGnpGyyJJPNxxhp6l55EeJ2zZHTQ_pNyk7lNOfYj0_tS-NWvPmKcx41WKk7fPcCrCsTse9BpmCxB0EeTBtglzpL0rrllm8rT8-5tYk_BpApDp1UmVKCZ9dsfDHTH5A7G3hUs&width=768&dpr=4&quality=100&sign=efb9b309&sv=2) ![](https://truman.gitbook.io/~gitbook/image?url=https%3A%2F%2Flh3.googleusercontent.com%2FHjFo0Vf_j_xkbxVtX_bcIkH-UJlNDFufE8dEBoNtRqE-u95wJ8tZYjjghX4j7b3KvNf0YSfrZcjQkQBBGhzRO25838c6nXJKOw9GKpTSR2HmE-P8eHVQveenRb1jY45tKJYhaKqN3ob32Xn-3htkaEE&width=768&dpr=4&quality=100&sign=77a38e4e&sv=2) ![](https://truman.gitbook.io/~gitbook/image?url=https%3A%2F%2Flh4.googleusercontent.com%2FvIY4TGbqDkPK4wZArMZNCp9bkhPDQ-CJgn0xQMSxAYs6Bz9ofzYyKmjUB-lEKAXUp5eHZ3YB6l6EhXJzD2FIccIWx7sQKPR58-3zG7iusstCR9z3iKe3Frz_V_osrw5c2modK3jwakPPeXQ1HSySR24&width=768&dpr=4&quality=100&sign=e9735f11&sv=2) ![](https://truman.gitbook.io/~gitbook/image?url=https%3A%2F%2Flh5.googleusercontent.com%2Fw3lyT2OTZ0DL9bIWF3aowRtByQbAOt-QVCreapT1a4-ZgrODO236BT-e2heskfOpho9CWRh2s6e_j0AqR45w1NM7bnxPPLZ9KxTJXi0spn29e7gA59z6ToxA_AFXwj4o5y-fgi8RwKHCKGypcPWD6is&width=768&dpr=4&quality=100&sign=995b058b&sv=2) ![](https://truman.gitbook.io/~gitbook/image?url=https%3A%2F%2Flh6.googleusercontent.com%2Fg-aj9jBadnVeuWX6P-YTHM3SsBKYJ8Xzoyz-pARXrnSs7BKTG22moLu_hgfg7fx4Qw6QQ12e8x9_qa0LL2wcDFIdVgjeQ8LA7hkhLX1BA_TJxOvAdtfxNdg6rcSBtWlt-HSZj613ijPio5El63Lg0wo&width=768&dpr=4&quality=100&sign=f662b564&sv=2) --- # Installing the prerequisites | The Truman Platform [PreviousInstalling Truman](/the-truman-platform/setting-up-truman/installing-truman) [NextSetting up Truman locally](/the-truman-platform/setting-up-truman/installing-truman/setting-up-truman-locally) Last updated 4 months ago Before beginning to use Truman, you will need to download all the prerequisite software necessary for running Truman on your local device. Below is a list of all the software you will need to download: 1. [Homebrew](/the-truman-platform/setting-up-truman/installing-truman/installing-the-prerequisites#homebrew-mac-only) (Mac Only) 2. [Node Version Manager (nvm)](/the-truman-platform/setting-up-truman/installing-truman/installing-the-prerequisites#node-version-manager-nvm) 3. [Node.js and Node Package Manager (npm)](/the-truman-platform/setting-up-truman/installing-truman/installing-the-prerequisites#node.js-and-node-package-manager-npm) 4. [GitHub Desktop](/the-truman-platform/setting-up-truman/installing-truman/installing-the-prerequisites#github-desktop) 5. [Visual Studio Code](/the-truman-platform/setting-up-truman/installing-truman/installing-the-prerequisites#visual-studio-code) The instructions on how to install each prerequisite can be found below. * * * [](#homebrew-mac-only) Homebrew (Mac Only) ----------------------------------------------- Follow the instructions here to install Homebrew: [http://brew.sh](http://brew.sh) . Homebrew is a free and open-source software package management system, and it simplifies software installation on Apple's macOS. You will use Homebrew in the later steps to install the rest of the required software. This does not work for Windows. [](#node-version-manager-nvm) Node Version Manager (nvm) ------------------------------------------------------------- Node Version Manager (nvm) allows you to install multiple versions of Node.js and to easily change between the versions. This is extremely useful if you use different versions of Node.js for different projects (for example: one project runs Node.js v.14.16.0, while another projects runs Node.js v.10.16.0). If you already have Node.js installed on your local computer and you do not want to use a node version manager, you can skip this step. Otherwise, follow the instructions below. 1. First, check if Node.js is already installed by entering the following command in the terminal/command prompt: `node --version` If a version number is printed in the terminal/command prompt (ex: something like v10.16.0 will appear), it means you have Node.js installed. You will need to uninstall it. 2. To uninstall: MacWindows Enter the following command in the terminal: Uninstall any versions of Node.js you currently have: Copy brew uninstall --force node Follow the instructions in the first answer here: [https://stackoverflow.com/questions/20711240/how-to-completely-remove-node-js-from-windows](https://stackoverflow.com/questions/20711240/how-to-completely-remove-node-js-from-windows) . 1. Then, install nvm. MacWindows Enter the following commands in the terminal: Install NVM via Homebrew: Copy brew install nvm Create NVM's working directory if it doesn't exist: Copy mkdir ~/.nvm Add the following to your shell profile e.g. ~/.profile or ~/.zshrc: Copy export NVM_DIR="$HOME/.nvm" [ -s "$HOMEBREW_PREFIX/opt/nvm/nvm.sh" ] && \. "$HOMEBREW_PREFIX/opt/nvm/nvm.sh" # This loads nvm [ -s "$HOMEBREW_PREFIX/opt/nvm/etc/bash_completion.d/nvm" ] && \. "$HOMEBREW_PREFIX/opt/nvm/etc/bash_completion.d/nvm" # This loads nvm bash_completion 1. Download the **nvm-setup.zip** file for the most recent release [here](https://github.com/coreybutler/nvm-windows/releases) . 2. Once downloaded, open the zip file, then open the **nvm-setup.exe** file. 3. The Setup-NVM-for-Windows installation wizard will walk you through the setup steps, including choosing the directory where both nvm-windows and Node.js will be installed. 1. Confirm you have NVM installed by entering `nvm -v` in the terminal/command prompt. A version number should be printed if it has been installed properly. Node.js is a server-side JavaScript runtime environment built on top of Google Chrome V8 JavaScript engine. It allows JavaScript code to run outside of a web browser and on a server, and therefore is typically used to easily and quickly build web applications on the server-side (back end). Node Package Manager (npm) is the standard package manager for Node.js that makes downloading and managing the dependencies of Node.js packages easy. It is not too important to understand what both of these things do. If you already have Node.js installed on your local computer, you can skip this step. Otherwise, follow the instructions below. Truman was created in 2019 with Node.js v.10.x.x. Since then, it has had a few updates. The most recent version of Truman runs on Node.js v.18.17.0, so we will install Node.js v.18.17.0. 1. To install Node.js v.18.17.0, enter the following command in the terminal/command prompt: `nvm install 18.17.0` If it installed properly, you should see "Installation complete. If you want to..." printed in the terminal/command prompt. 2. Then, tell the computer to use Node.js v.18.17.0 by entering the following command in the terminal/command prompt: `nvm use 18.17.0` Git is a version control system that tracks changes in computer files. It is typically used to coordinate work among programmers who are collaboratively developing source code during software development. GitHub Desktop is an application that provides an easy interface to use Git. If you already have a workflow for pulling/pushing code from GitHub, you can skip this step. Otherwise, follow the instructions below. 1. Download GitHub Desktop here: [https://desktop.github.com/](https://desktop.github.com/) . 2. In your computer's `Downloads` folder, double-click the **GitHub Desktop** **setup** file. This will install the application. 3. GitHub Desktop will launch after installation is complete. It will prompt you to sign in to your GitHub account. If you do not have a GitHub account, sign up for one [here](https://github.com/) . 4. After signing into your GitHub account, you will be prompted by the application to allow access to your GitHub repositories. Allow access to all repositories (Public and Private) and then click the green **Authorize desktop** button. Visual Studio Code is a source-code editor, making it easier to make changes to the code in the codebase. If you already have a source-code editor that you use to (like Atom, Sublime Text), you can skip this step. Additionally, if you do not plan to make any changes to the code, you can also skip this step. 1. Follow the instructions here to download Visual Studio Code: [https://code.visualstudio.com/](https://code.visualstudio.com/) . [](#node.js-and-node-package-manager-npm) Node.js and Node Package Manager (npm) ------------------------------------------------------------------------------------- [](#github-desktop) GitHub Desktop --------------------------------------- [](#visual-studio-code) Visual Studio Code ----------------------------------------------- ![](https://truman.gitbook.io/~gitbook/image?url=https%3A%2F%2F797468930-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FOR396HK0xjvBHL78w6Qi%252Fuploads%252FO1B253S12AwSAPXHsnco%252Fimage.png%3Falt%3Dmedia%26token%3D61e19204-bccf-405d-b0bf-ed902eab7b69&width=26&dpr=4&quality=100&sign=632379a9&sv=2) ![](https://truman.gitbook.io/~gitbook/image?url=https%3A%2F%2F797468930-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FOR396HK0xjvBHL78w6Qi%252Fuploads%252FbbNd7YHRSzPn8JAW1Cys%252Fimage.png%3Falt%3Dmedia%26token%3D07ad8f8a-92b0-4757-8229-cecf7e306d72&width=113&dpr=4&quality=100&sign=666193f5&sv=2) ![](https://truman.gitbook.io/~gitbook/image?url=https%3A%2F%2F797468930-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FOR396HK0xjvBHL78w6Qi%252Fuploads%252FjDKKGBaKRyiDykR8IlPm%252Fimage.png%3Falt%3Dmedia%26token%3Dcab74500-e93d-4336-86a9-d4d46da26d51&width=35&dpr=4&quality=100&sign=3807755e&sv=2) ![](https://truman.gitbook.io/~gitbook/image?url=https%3A%2F%2F797468930-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FOR396HK0xjvBHL78w6Qi%252Fuploads%252FPxrhUPslbfopTw57GTqN%252Fimage.png%3Falt%3Dmedia%26token%3Dfd6a2ed6-f872-415d-afaf-89569da2361a&width=40&dpr=4&quality=100&sign=ae6fb529&sv=2) ![](https://truman.gitbook.io/~gitbook/image?url=https%3A%2F%2F797468930-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FOR396HK0xjvBHL78w6Qi%252Fuploads%252F4Ye0Ez5HmmdZU0AwmkIm%252Fimage.png%3Falt%3Dmedia%26token%3D01a83fd1-ad03-4c2a-94a2-d09b77b16afa&width=40&dpr=4&quality=100&sign=ad0b23f0&sv=2) ![](https://truman.gitbook.io/~gitbook/image?url=https%3A%2F%2F797468930-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FOR396HK0xjvBHL78w6Qi%252Fuploads%252FC9IqfcqDmrR9CK3kbw0A%252Fimage.png%3Falt%3Dmedia%26token%3D6c4aec9f-b690-486b-816c-81ee858781e8&width=768&dpr=4&quality=100&sign=16381768&sv=2) --- # Simulation components | The Truman Platform [PreviousBasic simulation components](/the-truman-platform/setting-up-truman/defining-your-simulation/basic-simulation-components) [NextBest practices for simulation building](/the-truman-platform/setting-up-truman/defining-your-simulation/best-practices-for-simulation-building) Last updated 1 month ago [](#simulation-components) Simulation Components ----------------------------------------------------- There are 3 primary components to a simulation: 1. **Actors:** Actors are the simulated users on the website that the participant believes are real. 2. **Posts:** These are the simulated posts that the simulated actors have "posted"/"made", which appear on the timeline/feed. 3. **Notifications, or actors' simulated responses to a participant's behavior on the platform:** These are simulated behaviors from actors in response to a research participant's behavior. For example: if a participant posts a picture, you may simulate other actors liking, viewing, or commenting on their post. This component of the simulation reinforces the realism of the platform and keeps the user engaged. Specifically, there are three types of actors' behaviors. 1. Liking a participant's post or comment (called: ‘like’) 2. Reading a participant's post or comment (called: ‘read’) 3. Commenting on a participant's post (called: ‘reply’) ### [](#how-to-define-the-simulation-components) How to define the simulation components These components are defined in the csv files found in the project file directory `**/input**`. Below is a breakdown of each csv, their columns, and a description of what simulation component the file defines. **Note: If you change any simulation content involving pictures** (ex: actors' profile pictures or post pictures), **you will need to change the** `**CDN**`**value in the**`**.env**`**file**. See the row with variable name`CDN`in the table on the [Additional simulation components page](/the-truman-platform/setting-up-truman/defining-your-simulation/basic-simulation-components) for more information. **How to edit the csv files in Google Sheets (Recommended)** 1. Import the desired csv file by navigating to File > Import > Upload File in the header of a new Google Sheet file. 2. When prompted, designate where you would like to import the csv file. We recommend having a single Google Sheet file with 5 sheets (one for each csv file) for easy use and for easy collaboration with other researchers. 3. When you are done editing the csv files, you will need to download each csv sheet and replace the corresponding existing one in the project file directory `**/input**`with your new one, ensuring the name of the file is still the same. * * * **How to edit the csv files in Microsoft Excel** 1. Import the desired csv file by navigating to Data > From text/CSV > Select File in the header. 2. When prompted on how to load the data, choose the follow values: 1. File Origin: _65001: Unicode (UTF-8)_ 2. Delimiter: _Comma_ 3. Then click 'Load'. This will load the content of the csv files with emojis and other values. 4. When you save the file, save the file as a CSV UTF-8 (Comma delimited) \*.csv file. To do this, go to File > Save As > Select CSV UTF-8 (Comma delimited) (\*.csv). `**input/actors.csv**`[](#input-actors.csv) The `**actors.csv**` file defines the **simulation actors**. One row in the csv file corresponds to one actor. To define an actor, go to the `actors.csv` file. For each actor, add a new row, and define the following fields under their respective columns: * **username** is the _unique_ username of the actor. This username is used to associate posts and behaviors with the actor. (required field) * Note: No 2 actors can share the same username. * **name** is the actor's display name. (optional) * **gender** is the actor's gender. (optional) * **age** is the actor's age. (optional) * **location** is the actor's location. (optional) * **bio** is the actor's bio. (optional) * **picture** is the file path/ file name of the actor's profile photo, relative to the folder `/profile_pictures`. See below for more information: * Place all actor profile photos into the `/profile_pictures` folder. When filling out the `actors.csv` file, the value that is inputted into the 'picture' column for an actor should **exactly match** the file path and file name of the same actor's profile photo, relative to the folder `/profile_pictures`. See the current csv file for examples. * The Truman template currently has 76 profile photos in the `/profile_pictures` folder and more to choose from in the subfolder `/profile_pictures/unused`. * **class** can be used as a label for experimental purposes. For example, you can label certain actors as "bully" or "victim". (optional) The Truman project base template currently defines 76 actors. `input/posts.csv`[](#input-posts.csv) The `**posts.csv**` file defines the basic content of the **simulation posts** (such as the caption text, picture, actor, etc.). Simulation posts are associated with [actors](/the-truman-platform/setting-up-truman/defining-your-simulation/simulation-components#input-actors.csv) (the actor who creates the post). One row in the csv file corresponds to one post. To define a post, go to the `posts.csv` file. For each post, add a new row, and define the following fields under their respective columns: * **id** is the _unique_ identifier id of the post. These are numerical values. They could be any arbitrary number, but the base template has assigned posts with ids sequentially starting from 0. (required field) * Note: No 2 posts can share the same id. * **body** is the caption text of the post. It is displayed under the post's photo on the Truman Platform, similar to Instagram. (required field) * **picture** is the file path/ file name of the post's photo, relative to the folder `/post_pictures`. (required field) See below for more information: * Place all post photos into the `/post_pictures` folder. When filling out the `posts.csv` file, the value that is inputted into the 'picture' column for a post should **exactly match** the file path and the file name of the same post's photo, relative to the folder `/post_pictures`. See the current csv file for examples. * The Truman template currently has about 280 photos in this folder and more to choose from in the subfolder `/post_pictures/unused`. * **actor** is the username of the actor who "posts" this post. This value must exactly match a username value in `/input/actors.csv`. (required field) * **likes** is the # of likes this post is simulated to have. If a value is not given, then a random value will be generated for the post. (optional) * **time** is the timestamp the post should be simulated to have been posted. This timestamp is defined in reference to the moment the participant joined the website. It can be defined as before or after the participant joined using the format (+/-)HH:MM. (required field) * For example: * \-12:30 will simulate the post to have been posted \[12\] hours \[30\] minutes _before_ the participant joined the website. * 62:31 will simulate the post to appear \[62\]hours and \[31\] minutes _after_ the participant joined the website. * **condition** indicates which experimental condition this post should be displayed in. If this value is left blank, this post will be displayed in **all** experimental conditions. Otherwise, this post will be displayed only participants in the defined experimental condition. Ensure that the value here exactly matches one of the experimental conditions labels as defined in the `**.env**` file variable `EXP_CONDITIONS_NAMES` (see [here](/the-truman-platform/setting-up-truman/defining-your-simulation/basic-simulation-components) for more info). * **class** can be used as an internal label for researcher. It is not used in the database. For example, you can label certain posts as "bully" or "victim". (optional) Note: the _comments_ on a post are not defined here but in `input/replies.csv`. `input/replies.csv`[](#input-replies.csv) The `**replies.csv**` file defines the **comments** on the simulation posts. One row in the csv file corresponds to one comment. To define a comment on a post, go to the `replies.csv` file. For each comment, add a new row, and define the following fields under their respective columns: * **id** is the _unique_ identifier id of the comment. These are numerical values. They could be any arbitrary number, but the base template has assigned comments with ids sequentially starting from 0. (required field) * Note: No 2 comments can share the same id. * **body** is the text of the comment. (required field) * **actor** is the username of the actor who "posts" this comment. This value must match a username value in `/input/actors.csv` exactly. (required field) * **postID** is the ‘id’ of the post that the comment will appear on. This value must match a id value in /input/posts.csv exactly. (required field) * **likes** is the # of likes this comment is simulated to have. If a value is not given, then a random value will be generated for the comment. (optional) * **time** is the timestamp the comment should be simulated to have been posted, relative to the moment the participant joined the website. It can be defined as before or after the participant joined using the format (+/-)HH:MM. (required field) * For example: * \-12:30 simulates the comment's posting time to be 12 hours and 30 minutes before the participant joined the website * 62:31 simulates the comment's posting time to be 62 hours and 31 minutes after the participant joined the website * When defining comments, ensure that comments always appear "after" a post is made, for continuity purposes. So for example, if a post is simulated to appear at 04:10 (4 hours and 10 minutes after a participant creates their account), all comments on this post should be simulated to appear after 04:10 (i.e. times after 04:10). * **condition** indicates which experimental condition this comment should be displayed in. If this value is left blank, this comment will be displayed in **all** experimental conditions. Otherwise, this comment will be displayed only participants in the defined experimental condition. Ensure that the value here exactly matches one of the experimental conditions labels as defined in the `**.env**` file variable `EXP_CONDITIONS_NAMES` (see [here](/the-truman-platform/setting-up-truman/defining-your-simulation/basic-simulation-components) for more info). * **class** can be used as a label for experimental purposes. It is not used in the database. For example, you can label certain comments as "bully" or "victim". (optional) `input/notifications (read, like).csv`[](#input-notifications-read-like-.csv) The `**notifications (read, like).csv**` file defines the **read** and **like** **actor responses to a participant's post or comment on the platform**. One row in the csv file corresponds to one response. This file is named "notifications" because participants receive notifications of the actor's behavior when they happen. To define a behavior, go to the `**notifications (read, like).csv**` file. For each behavior, add a new row, and define the following fields under their respective columns: _**NOTE**__: For each row, only define userPostID or userReplyID (not both). This is because each row corresponds to only one actor response._ * **userPostID** is the id indicating which participant's _**post**_ the actor should perform the behavior on. (required field, mutually exclusive with userReplyID) * This is a numerical value, where **0** corresponds to the participant's **first post**, 1 corresponds to the participant's second post, and so on. **OR** * **userReplyID** is the id indicating which participant's _**reply**_ the actor should perform the behavior on. (required field, mutually exclusive with with userPostID) * This is a numerical value, where **0** corresponds to the participant's **first reply**, 1 corresponds to the participant's second reply, and so on. * **type** ('`read`' or '`like`') is the type of actor response to the participant's post or comment. * **actor** is the username of the actor who performs this response/behavior. This value must match a username value in `/input/actors.csv` exactly. * Note: There is an actor called `generic-joe` defined in the `actors.csv`. You may use this actor for multiple '`read`' rows to indicate and signal many people have read their post, since this actor will not appear in the profile photos of the notification (see below). * **time** is the timestamp the behavior should be simulated to happen. This timestamp is defined in reference to when the participant made the post or comment. Therefore, it is always positive, using the format (+)HH:MM. (required field) * For example: * 00:04 (and userPost is `0`, and type is '`like'`) simulates the actor to read the participant's first post 4 minutes after it has been posted. * **condition** indicates which experimental condition this notification should be displayed in. If this value is left blank, this notification will be displayed in **all** experimental conditions. Otherwise, this notification will be displayed only participants in the defined experimental condition. Ensure that the value here exactly matches one of the experimental conditions labels as defined in the `**.env**` file variable `EXP_CONDITIONS_NAMES` (see [here](/the-truman-platform/setting-up-truman/defining-your-simulation/basic-simulation-components) for more info). * **class** can be used as a label for experimental purposes. It is not used in the database. For example, you can label certain comments as "bully" or "victim". (optional) `input/notifications (reply).csv`[](#input-notifications-reply-.csv) The `**notifications (reply).csv**` file defines the **reply behaviors of actors in response to a participant's post on the platform**. This file is named "notifications" because participants receive notifications of the actor's behavior when they happen. To define a reply behavior, go to the `**notifications (reply).csv**` file. For each reply, add a new row, and define the following fields under their respective columns: * **id** is the _unique_ identifier id of the comment. These are numerical values. They could be any arbitrary number, but the base template has assigned comments sequentially starting from 0. (required field) * Note: No 2 comments can share the same id. * **userPostID** is the id indicating which participant's _**post**_ the actor should reply to. (required field) * This is a numerical value, where **0** corresponds to the participant's **first post**, 1 corresponds to the participant's second post, and so on. * **body** is the text of the comment. * **actor** is the username of the actor who "posts" this comment. This value must match a username value in `/input/actors.csv` exactly. * **time** is the timestamp the comment should be simulated to be posted on the post, defined in reference to when the participant made the post. Therefore, it is always positive, using the format (+)HH:MM. (required field) * For example: * 00:04 simulates the actor to comment on the participant's post 4 minutes after it has been posted. * **condition** indicates which experimental condition this notification should be displayed in. If this value is left blank, this notification will be displayed in **all** experimental conditions. Otherwise, this notification will be displayed only participants in the defined experimental condition. Ensure that the value here exactly matches one of the experimental conditions labels as defined in the `**.env**` file variable `EXP_CONDITIONS_NAMES` (see [here](/the-truman-platform/setting-up-truman/defining-your-simulation/basic-simulation-components) for more info). * **class** can be used as a label for experimental purposes. It is not used in the database. For example, you can label certain comments as "bully" or "victim". (optional) ### [](#populate-your-database-with-your-simulation) Populate your database with your simulation After defining all the 3 components to the simulation using the 5 .csv files above, populate this information to the database so that the changes will be made to your simulation: 1. Ensure all of the above .csv files are located in the `/input` folder with the right file name. 2. Ensure that the `MONGODB_URI` value in your `.env` file is set to your database (See [here](/the-truman-platform/setting-up-truman/installing-truman/setting-up-truman-locally#step-2-create-and-edit-the-environment-file-.env) for instructions again. If you followed the instructions to installing Truman, this should already be set to the correct value.).[](/the-truman-platform/setting-up-truman/installing-truman/setting-up-truman-locally#step-2-create-and-edit-the-environment-file-.env) 3. In your project directory in your terminal/ command prompt: enter `node populate.js`. This will connect to the MongoDB database you defined in the .env file and upload the simulation data found in the csv files in the ./input folder in the project directory to the MongoDB database you created. You should see green and yellow lines printed in the console indicating the progress of the database population. 4. After it is complete, you have now completed populating your definitions for your simulation into the database! Run your project locally, visit the feed/timeline, and observe your changes! ![](https://truman.gitbook.io/~gitbook/image?url=https%3A%2F%2F797468930-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FOR396HK0xjvBHL78w6Qi%252Fuploads%252FkSHzt2HmkMSvCIqegDH4%252Ftempsnip.png%3Falt%3Dmedia%26token%3D27761eae-e333-4da0-9805-cc214194d7c7&width=768&dpr=4&quality=100&sign=90d863f2&sv=2) ![](https://truman.gitbook.io/~gitbook/image?url=https%3A%2F%2F797468930-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FOR396HK0xjvBHL78w6Qi%252Fuploads%252FXPC2yU0pA5sxE9MeHDoT%252Ftempsnip.png%3Falt%3Dmedia%26token%3Ddccb28f7-93d6-4ad6-b11f-f3f52876a156&width=768&dpr=4&quality=100&sign=23e60001&sv=2) ![](https://truman.gitbook.io/~gitbook/image?url=https%3A%2F%2F797468930-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FOR396HK0xjvBHL78w6Qi%252Fuploads%252FaHWWeXIRDWeM3u0hUx1o%252Fimage.png%3Falt%3Dmedia%26token%3Df6e29724-7575-49d9-ae70-83eb2a343c21&width=768&dpr=4&quality=100&sign=9f964239&sv=2) --- # File Directory | The Truman Platform The skeleton of Truman actually comes from the outline of another Node.js project ([https://github.com/sahat/hackathon-starter](https://github.com/sahat/hackathon-starter) ). That repository has a lot of helpful and relevant information on the libraries, organization, setup, and FAQs on web development. Feel free to read through their README.md as well for a more expansive understanding of the project structure. The Truman Platform (Truman) is a web application that uses a Node.js, MongoDB, Express.js and Pug templating engine webstack. [](#the-model-view-controller-mvc-framework) The Model View Controller (MVC) framework ------------------------------------------------------------------------------------------- The project follows a basic MVC (Model View Controller) framework. The [**Model-View-Controller (MVC)**](https://www.geeksforgeeks.org/mvc-design-pattern/) framework is an architectural/design pattern that separates an application into three main logical components: **Model**, **View**, and **Controller**. Each architectural component is built to handle specific development aspects of an application. * The **View** components handles all the user interface logic for the application. It generates the user interface for the user. * The **Model** components handles all the database schemas, i.e. it defines what the database "structure" looks like and defines what information is stored. * The **Controller** components handles the interaction between the views and the models (i.e. between what appears to a user of an application and the database). The controller components act as intermediaries. * The controller receives input from the view, uses logic to translate the input to a demand for the model, the model grabs the data, then the controller passes data from the model back to view for the user to see in a nice display. More information about the MVC framework can be found online if you are interested. [](#project-structure) Project Structure --------------------------------------------- The main node application (that defines the express server, connects to the MongoDB, and defines all the routes) is in **app.js**. Below is a breakdown of the project files, with the name of each file and a brief description of each file's purpose. Name Description **config**/passport.js Passport Local and OAuth strategies, plus login middleware. Handles login authentication of email and passwords. **controllers**/actors.js Controller for actors. **controllers**/helpers.js Helper Controller methods. **controllers**/notification.js Controller for platform notifications. **controllers**/script.js Controller for feed and user behavior. **controllers**/user.js Controller for user. **models**/Actor.js Mongoose schema and model for Actor. **models**/Notification.js Mongoose schema and model for Notification. **models**/Script.js Mongoose schema and model for Script. **models**/User.js Mongoose schema and model for User. **input**/actors.csv **input**/notification (read, like).csv **input**/notification (reply).csv **input**/posts.csv **input**/replies.csv **post\_pictures** Directory containing all the files of the post photos **profile\_pictures** Directory containing all the files of the actor profile photos **public**/ Static assets (fonts, css, js, img). **public**/**css**/notification.css Main stylesheet for notifications. **public**/**css**/script.css Main stylesheet for the social media timeline / feed (ex:posts). **public**/**css**/ui\_layout.css Main stylesheet for the app. **public**/**js**/actor.js Client-side JavaScript for actor profile pages. **public**/**js**/main.js Client-side JavaScript for the app. **public**/**js**/notification.js Client-side JavaScript specific to the notification components and functionalities. **public**/**js**/postFunctionalities.js Client-side JavaScript specific to post interactions (ex: liking/disliking and flagging posts and comments, adding comments). **public**/**js**/profile.js Client-side JavaScript for profile forms (on _Sign Up_ and _Update Your Profile_ pages) **public**/**js**/script.js Client-side JavaScript for feed/timeline **views**/**account** Folder containing the templates to pages related to a user's/participant's account **views**/**account**/forgot.pug Template for _Forgot your Password_ page **views**/**account**/login.pug Template for _Login_ page **views**/**account**/profile.pug Template for user's _Update My Profile_ page **views**/**account**/signup\_info.pug Template for _Tell Us a Little More About Yourself_ page, shown initially upon user's sign up **views**/**account**/signup.pug Template for _Sign_ _Up_ page **views**/**partials** Folder containing the templates of partial components. These components are not complete pages, but rather components of the interface that appear in multiple places or repeatedly. Defining the components in one file and then including it with the code "include " when needed reduces code redundancy and maintains consistency across components. **views**/**partials**/actorPost.pug Partial template for an actor post **views**/**partials**/ui\_flash.pug Partial template for error, info and success flash notifications. **views**/**partials**/ui\_header.pug Partial template for header (navigation bar) **views**/**partials**/userCard.pug Partial template for user card (displayed on timeline and displayed on user's _Profile_ page) **views**/**partials**/userPost.pug Partial template for a user's post **views**/actor.pug Template for an actor's Profile **views**/actors.pug Template for the _Actor Directory_ page. Only accessible to admin users. **views**/com.pug Template for the _Community Rules_ page. **views**/completed.pug Template for the _Completed_ page. **views**/error.pug Template for the _Error_ page. **views**/info.pug Template for the _Welcome to EatSnap.Love!_ page **views**/me.pug Template for the _Welcome to EatSnap.Love!_ page **views**/notification.pug Template for the _Notifications_ page **views**/script.pug Template for the _Timeline/Feed_ page **views**/test.pug Template for the _Test Timeline/Feed_ page (same as above). Can be used for testing purposes. **views**/tos.pug Template for the _Terms of Services_ page **views**/ui\_layout.pug Base template. All templates extends (or are based off of) this template. .dockerignore Folder and files ignored by docker usage. .env.example Example template of .env file (to be copied and Your API keys, tokens, passwords and database URI. .env .gitignore Folder and files ignored by git. app.js The main application file. data-export.js JavaScript file that exports basic user information for each user on the site, into a readable csv file. docker-compose.yml Docker compose configuration file. Dockerfile Docker configuration file. package.json NPM dependencies. package-lock.json Contains exact versions of NPM dependencies in package.json. populate.js JavaScript file that populates the database with the csv files in the `/input` folder. **Below are libraries that Truman uses and references to each library’s documentation.** **Pug.js:** [https://pugjs.org/api/getting-started.html](https://pugjs.org/api/getting-started.html) * Why do we use Pug? * Pug.js is a templating language rather than raw HTML. Most sites use some kind of templating language rather than raw HTML. * Using a templating language decreases the likelihood of bugs and security risks. It also is easier to write code in this templating language than in raw HTML. **Semantic UI:** [https://semantic-ui.com/](https://semantic-ui.com/) * Semantic UI is a front-end development framework that helps create beautiful, responsive layouts using human-friendly HTML. Almost all of our components are borrowed and customized from Semantic UI. [PreviousFrequently Asked Questions](/the-truman-platform/setting-up-truman/defining-your-simulation/frequently-asked-questions) [NextDeploying Truman Online](/the-truman-platform/setting-up-truman/deploying-truman-online) Last updated 4 months ago csv file defining the simulation actors (see ) csv file defining the simulation notifications (see ) csv file defining the simulation notifications (see ) csv file defining the simulation posts (see ) csv file defining the simulation comments on the posts (see ) Environment variables file, where , and are defined. [here](/the-truman-platform/setting-up-truman/defining-your-simulation#input-actors.csv) [here](/the-truman-platform/setting-up-truman/defining-your-simulation#input-notifications-read-like-.csv) [here](/the-truman-platform/setting-up-truman/defining-your-simulation#input-notifications-reply-.csv) [here](/the-truman-platform/setting-up-truman/defining-your-simulation#input-posts.csv) [here](/the-truman-platform/setting-up-truman/defining-your-simulation#input-replies.csv) [database URI](/the-truman-platform/setting-up-truman/installing-truman/setting-up-truman-locally#step-2-create-and-edit-the-environment-file-.env) [other simulation components](/the-truman-platform/setting-up-truman/defining-your-simulation/basic-simulation-components) ![](https://truman.gitbook.io/~gitbook/image?url=https%3A%2F%2F797468930-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FOR396HK0xjvBHL78w6Qi%252Fuploads%252FXt9tizm2kPbBelJNmz0S%252Fimage.png%3Falt%3Dmedia%26token%3D10cad131-95ef-4d39-9ebe-2a3db8fe5f5d&width=300&dpr=4&quality=100&sign=171001e5&sv=2) ![](https://truman.gitbook.io/~gitbook/image?url=https%3A%2F%2F797468930-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FOR396HK0xjvBHL78w6Qi%252Fuploads%252FbGsRAyHxxMTmyOg4ThgH%252Fimage.png%3Falt%3Dmedia%26token%3Dac355792-d351-49f2-8a21-7cf90d56f28a&width=300&dpr=4&quality=100&sign=db728325&sv=2) ![](https://truman.gitbook.io/~gitbook/image?url=https%3A%2F%2F797468930-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FOR396HK0xjvBHL78w6Qi%252Fuploads%252F2R8nfMKbVbviFYtq9V4u%252Fimage.png%3Falt%3Dmedia%26token%3D07e82948-617a-4a46-9216-da7efefd885b&width=300&dpr=4&quality=100&sign=aafb84ec&sv=2) ![](https://truman.gitbook.io/~gitbook/image?url=https%3A%2F%2F797468930-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FOR396HK0xjvBHL78w6Qi%252Fuploads%252FJOIHqGpPJDo5bu2vUsnS%252Fimage.png%3Falt%3Dmedia%26token%3Df287b5b9-d4c1-4df0-92e0-be1006f1c10d&width=300&dpr=4&quality=100&sign=d74da12d&sv=2) ![](https://truman.gitbook.io/~gitbook/image?url=https%3A%2F%2F797468930-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FOR396HK0xjvBHL78w6Qi%252Fuploads%252F3NN2qFw0GOlJgmn4LuoO%252Fimage.png%3Falt%3Dmedia%26token%3Dcc38297f-699a-40a5-9e78-b89a5288e0de&width=300&dpr=4&quality=100&sign=11f0ba2f&sv=2) ![](https://truman.gitbook.io/~gitbook/image?url=https%3A%2F%2F797468930-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FOR396HK0xjvBHL78w6Qi%252Fuploads%252FqW7p2v9jlQjfcw93F7Uu%252Fimage.png%3Falt%3Dmedia%26token%3D366abdc9-1351-44c6-b52f-d7896a4399fe&width=300&dpr=4&quality=100&sign=ffca2c0c&sv=2) ![](https://truman.gitbook.io/~gitbook/image?url=https%3A%2F%2F797468930-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FOR396HK0xjvBHL78w6Qi%252Fuploads%252FVAkdOeFF4PypV3pJW4Z1%252Fimage.png%3Falt%3Dmedia%26token%3Df11c90af-11f6-4ba8-8b81-99af05a5e839&width=300&dpr=4&quality=100&sign=49b08ed1&sv=2) ![](https://truman.gitbook.io/~gitbook/image?url=https%3A%2F%2F797468930-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FOR396HK0xjvBHL78w6Qi%252Fuploads%252FOQIwvxDsBZYkQi2sd3nQ%252Fimage.png%3Falt%3Dmedia%26token%3D2ed44c73-ffc9-43e5-aaf5-a92cdd88a433&width=300&dpr=4&quality=100&sign=2d7eaf59&sv=2) ![](https://truman.gitbook.io/~gitbook/image?url=https%3A%2F%2F797468930-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FOR396HK0xjvBHL78w6Qi%252Fuploads%252F8DVLXOKiF1xbMTEQHIRv%252Fimage.png%3Falt%3Dmedia%26token%3Dd653de1c-179e-45dd-9461-48be2b32ef32&width=300&dpr=4&quality=100&sign=c68fc7c7&sv=2) ![](https://truman.gitbook.io/~gitbook/image?url=https%3A%2F%2F797468930-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FOR396HK0xjvBHL78w6Qi%252Fuploads%252FzXOte3AM28aWUOWRrSIR%252Fimage.png%3Falt%3Dmedia%26token%3Ddb991f92-cbf2-4f44-83e2-2b634bdd59c4&width=300&dpr=4&quality=100&sign=5e372358&sv=2) ![](https://truman.gitbook.io/~gitbook/image?url=https%3A%2F%2F797468930-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FOR396HK0xjvBHL78w6Qi%252Fuploads%252FeVeLGaoRtZdycUop6jZL%252Fimage.png%3Falt%3Dmedia%26token%3D90c07f5a-f47c-4dee-8e9b-6330d6a08265&width=300&dpr=4&quality=100&sign=32142adb&sv=2) ![](https://truman.gitbook.io/~gitbook/image?url=https%3A%2F%2F797468930-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FOR396HK0xjvBHL78w6Qi%252Fuploads%252FTewxwJS7I7ki9iAToGXC%252Fimage.png%3Falt%3Dmedia%26token%3Dc2158ad1-3d35-4655-bb70-ea469059e627&width=300&dpr=4&quality=100&sign=b5bfe316&sv=2) ![](https://truman.gitbook.io/~gitbook/image?url=https%3A%2F%2F797468930-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FOR396HK0xjvBHL78w6Qi%252Fuploads%252Fiy8VfTOJo4sMAAVdzpym%252Fimage.png%3Falt%3Dmedia%26token%3D9c95a662-264d-425f-bbc6-1c0a5fd44570&width=300&dpr=4&quality=100&sign=8dc79284&sv=2) ![](https://truman.gitbook.io/~gitbook/image?url=https%3A%2F%2F797468930-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FOR396HK0xjvBHL78w6Qi%252Fuploads%252FnuneVcVKznrFf94jkbQa%252Fimage.png%3Falt%3Dmedia%26token%3D9ac025ab-afc4-42fd-b206-69c63ccbfee7&width=300&dpr=4&quality=100&sign=518729b0&sv=2) ![](https://truman.gitbook.io/~gitbook/image?url=https%3A%2F%2F797468930-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FOR396HK0xjvBHL78w6Qi%252Fuploads%252FkhFFXj8ivi11Gd2b40a9%252Fimage.png%3Falt%3Dmedia%26token%3Dc2368eec-80c2-49c7-b78d-d39e76c508e9&width=300&dpr=4&quality=100&sign=604aa125&sv=2) ![](https://truman.gitbook.io/~gitbook/image?url=https%3A%2F%2F797468930-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FOR396HK0xjvBHL78w6Qi%252Fuploads%252FEpzUqvTFsXv2MgipMRIJ%252Fimage.png%3Falt%3Dmedia%26token%3D8d1ad839-a2cc-4906-8f27-bfe8bf681c41&width=300&dpr=4&quality=100&sign=2a4a3f4b&sv=2) --- # Deploying Truman Online | The Truman Platform [PreviousFile Directory](/the-truman-platform/setting-up-truman/file-directory) [NextPeople](/the-truman-platform/people) Last updated 5 months ago After developing your simulation on your local computer, you are ready to deploy it online (to the public). This is important to do so that you can test and pilot your Truman application with other people and to launch your study. You will need to deploy your application online to a cloud hosting platform. These are not the only choices, but are a few options to choose from. [](#user-content-deployment-to-render) Deployment to Render ---------------------------------------------------------------- Render provides a free Node.js hosting option for repositories on GitHub and GitLab. Set-up is relatively seamless. However, you would likely need to 1. Sign up for a free Individual account at [https://render.com](https://render.com/) . If you use your GitHub account to sign up, you will skip the later step of linking your GitHub account to your Render account. 2. On the dashboard, select **New Web Service** to create a new web service. 3. When prompted **How you would like to deploy your web service?**, select **Build and deploy from a Git repository**. 4. When prompted to **Connect a Repository**, select **Connect GitHub** and connect your GitHub account. While connecting your GitHub account, you can select which repositories you want Render to have access to. You can give Render access to all your repositories or just the repository for your Truman project. 5. After connecting your GitHub account, choose **Connect** for the repository of your Truman project. 6. Afterwards, you will be prompted to set up your web service. 1. Give your web service a **Name**. The value you assign here will appear in the default domain name provided by Render. For example, if you name your web service 'truman', then the domain name may be truman.onrender.com. 2. You may keep **Region**, **Branch**, and **Root Directory** as the default values provided by Render. 3. For **Runtime**, select **Node** from the dropdown options. 4. For **Instance Type**, select the **Free** instance type to launch a free web service. This is sufficient if you would like to merely run a demo or test your website. If you are planning to run a research study, you will likely need to select a paid instance type. Note: Free instance types scale down when inactive. So when the website has not been visited recently, it will take a longer time to load. 5. Open the **Advanced** settings. Here, you will add your environmental variables that were defined in your `.env` file locally. Select **Add Environment Variable**. This should trigger a row to save a **Key** and **Value**. For each environment variable in your `.env` file, add an environment variable to the interface, where the **Key** is the value to the left of the equals sign in your `.env` file and the **Value** is the value to the right of the equals sign in your `.env` file. It should look like the following: 6. When you are done, click **Create Web Service**. Your Truman application should then begin deploying. This may take a few minutes. 7. When your application is done deploying, you should be brought to your application's dashboard and you should see (in the **Events** tab) a green cloud icon with the description "Deploy Live for..." Congratulations! Your Truman app is publicly deployed online now! 8. To visit your Truman application, go to the URL that Render provides. It can be found at the top of the dashboard under your Web Service name and details. You should now see your Truman application. [](#user-content-deployment-to-render-1) Deployment to Amazon LightSail ---------------------------------------------------------------------------- The instructions below are adapted from a variety of tutorials & documentation ([link](https://www.youtube.com/watch?v=rtshCulV2hk) , [link](https://www.youtube.com/watch?v=iohBEVf4uIQ) , [link](https://docs.bitnami.com/aws/infrastructure/nodejs/administration/create-custom-application-nodejs/) , [link](https://docs.bitnami.com/aws/how-to/generate-install-lets-encrypt-ssl/) ). #### [](#step-1-creating-your-aws-lightsail-instance) STEP 1: CREATING YOUR AWS LIGHTSAIL INSTANCE 1. Sign up for an AWS account at [https://aws.amazon.com/](https://aws.amazon.com/) if you do not already have one. Then, sign in to your AWS account. 2. Navigate to **AWS Lightsail** from the AWS Console Home. You can do this either 1) by going to [https://lightsail.aws.amazon.com/](https://lightsail.aws.amazon.com/) or 2) by searching for and clicking on **Lightsail** in the AWS Console Home search bar. You should be brought to AWS Lightsail’s console home. 3. Create a Lightsail instance for your Truman application by clicking **Create instance**. 4. Select the following options when creating your instance: 1. Under **Instance Location**: You may use the default instance location that AWS assigns, or select your own AWS region and availability zone. 2. Under **Pick your instance image**: **Select a platform:** Choose **Linux/Unix**. **Select a blueprint:** Choose **MEAN**. 3. Under **Choose your instance plan:** **Select a network type:** Choose **Dual-stack** **Select a size:** Choose an instance that matches your server requirements. In general, an instance with **4 GB Memory, 2 vCPUs Processing, 80 GB SSD Storage, and 4 TB Transfer is sufficient**. It should cost around $24/ month. 4. Under **Identify our instance:** Name your instance with an identifiable name (example: _truman-test_). You should only need to make one instance, so enter **1** in the box indicating quantity. 5. When you are done, click **Create instance**. 5. It will take a few minutes for your instance to launch. When it is done launching, you should see it running on your AWS Lightsail’s console home (the text should display **Running** not **Pending
**). 6. To continue setting up your instance for your application, SSH into the instance. To SSH into the instance via the AWS Lightsail console home, click the **orange square** `**>_**` **icon** of your Lightsail instance. This should bring up a popup window: #### [](#step-2-downloading-your-code-from-github) STEP 2: DOWNLOADING YOUR CODE FROM GITHUB 1. First, clone your code from your GitHub repository to your AWS Lightsail instance: 1. Change directory (`cd`) into the `/htdocs` directory by entering the command `cd htdocs` 2. Delete the default project code in the instance by entering the command `rm -rf *` 3. Clone your Truman project code from GitHub by entering the command `git clone REPLACE-WITH-YOUR-GITHUB-REPOSITORY-CLONE-HTTPS-LINK` (example: `git clone https://github.com/cornellsml/truman_2023.git`). You can find this link by navigating to your GitHub repository in your browser, clicking the **green** `**<> Code**`**button**, and copying the web URL under HTTPS. If your repository is private, you may be prompted to enter your GitHub credentials. cd . Ensure that your GitHub Repository is up to date before you clone your project so that the most recent code is downloaded onto your AWS Lightsail instance. 2. Change directory into your cloned GitHub repository by entering the command `cd REPLACE-WITH-YOUR-GITHUB-REPOSITORY-NAME` (example: `cd truman_2023`). 3. Install your external node libraries by entering the command `npm install`. This may take a few seconds. A message will be displayed indicating if installation was successful. #### [](#step-3-setting-up-truman) STEP 3: SETTING UP TRUMAN 1. Next, you will set up your MongoDB database: 1. Change directory into the root folder of your instance: If you are in your project directory, enter the command `cd ..` 2. In this directory, there is a file **bitnami\_application\_password** that holds the password to Mongo. To see this password, enter the command `cat bitnami_application_password`. The password should then be printed in the command prompt. 3. Next, using the MongoDB Shell, mongosh, log in to Mongo. Enter the command `mongosh admin --username root -p` (the username is root) You will be prompted to enter the password. Enter the printed password from the step above. 4. If the login is successful, you should see your cursor next to `**admin>**` . 5. Next, you will need to create a database that your Truman application will use. This database is similar to the database that you set up in MongoDB Atlas, but while that database was used for your local application, this new database will be used for your deployed application. It will similarly be used storing your Truman simulation information and storing your research participant’s behavioral data. 1. Enter the command `use REPLACE-WITH-DATABASE-NAME` (example: `use truman`). 2. Create a user in your database by entering the command `db.createUser({ user: “REPLACE-WITH-USERNAME”, pwd: “REPLACE-WITH-PASSWORD”, roles: [“dbOwner”]})` 1. This creates a user in the database with the username and password you provided, and gives this user the database owner rule (access and abilities). 2. The user is successfully added if you see `“{ ok: 1}”` printed in the command prompt. 6. To connect to the database later on, you will need the MongoDB connection URI: **mongodb://:@127.0.0.1:27017/?authMechanism=SCRAM-SHA-1&authSource=** Replace __ and __ with the username and password of the user you just created, and replace __ with the name of the database you created above. Keep this URL Connection String handy (record it somewhere, but do not share it online) as you will use it later in your application code to connect Truman to this database. 7. Exit the database by entering the command `exit`. 2. Next, you will need to set up your environmental variables. These steps are very similar to the steps you followed when setting up your project locally. 1. `cd` (change directory) into your project folder. If you are the root folder, you may do this by entering the command `cd htdocs`. Then `cd REPLACE-WITH-YOUR-GITHUB-REPOSITORY-NAME`. 2. Copy the **.env.example** file to a new **.env** file by entering the command `cp .env.example .env` 3. Update the environment variables in your newly created **.env** file: 1. Enter the command `vi .env`. This opens the **.env** file in the editor. 2. Make sure you do not press any other keys. Only press the key **i** . This allows you to edit the file. 3. Afterwards, use the left and right arrow keys to navigate through the file and change your environment variables. 4. Replace the value of the key `MONGODB_URI=` with the URL that you just recorded earlier to tell the application which database to connect to. 5. Replace the value of any of the other keys with the appropriate values of your application. Since you likely have tested your application locally already, use the values you have defined in your .env file on your local computer. 6. Make sure that there are no spaces between the keys and their values. 4. Once you are done, press the **Esc** key. Then, enter `:wq!` This will save your changes and close the editor. 3. Now you can populate your database. In your project folder, enter the command `node populate.js`. Do not close the terminal window yet (you will need it again). #### [](#step-4-setting-up-your-lightsail-instance) STEP 4: SETTING UP YOUR LIGHTSAIL INSTANCE 1. You will now need to set up the rest of your instance. Navigate back to the AWS Lightsail Console home. Click on your instance. This should bring you to your instance’s settings. 2. Click on the tab **Networking**. 3. Under **IPv4 Firewall**, click **Add Rule**. Create a **Custom** rule, Protocol **TCP**, Port **3000**. Then click **Create**. This should automatically create the same rule under **IPv6 Firewall**. You can delete this later. 4. You will need to create a custom virtual host to route all traffic on port 80 and port 443 to port 3000, since that is where our Node.js application runs. The Bitnami installation comes with predefined HTTP and HTTPS virtual hosts for connecting to a Node.js application running at port 3000. To enable them, go back to the terminal window and enter the following the commands: 1. Copy the following files to remove the .disabled suffix: `sudo cp /opt/bitnami/apache/conf/vhosts/sample-vhost.conf.disabled /opt/bitnami/apache/conf/vhosts/sample-vhost.conf` `sudo cp /opt/bitnami/apache/conf/vhosts/sample-https-vhost.conf.disabled /opt/bitnami/apache/conf/vhosts/sample-https-vhost.conf` 2. Update the copied files with your application's directory. 1. Update the first file: 1. Enter the command `vi /opt/bitnami/apache/conf/vhosts/sample-vhost.conf`. This opens the file in the editor. 2. Make sure you do not press any other keys. Only press the key **i** . This allows you to edit the file. 3. Afterwards, use the left and right arrow keys to navigate to the line: `DocumentRoot /opt/bitnami/projects/sample`. Replace `/opt/bitnami/projects/sample` with your project root directory. Your project root directory is `"/home/bitnami/htdocs/"`. 4. Use the left and right arrow keys to then navigate to the line: ``. Similarly, replace `"/opt/bitnami/projects/sample"` with your project root directory. 5. Once you are done, press the **Esc** key. Then, enter `:wq!` This will save your changes and close the editor. 2. Update the second file: 1. Enter the command `vi /opt/bitnami/apache/conf/vhosts/sample-https-vhost.conf`. This opens the file in the editor. 2. Make sure you do not press any other keys. Only press the key **i** . This allows you to edit the file. 3. Similarly, use the left and right arrow keys to navigate to the line: `DocumentRoot /opt/bitnami/projects/sample`. Replace `/opt/bitnami/projects/sample` with your project root directory. 4. Use the left and right arrow keys to then navigate to the line: ``. Replace `"/opt/bitnami/projects/sample"` with your project root directory. 5. Once you are done, press the **Esc** key. Then, enter `:wq!` This will save your changes and close the editor. 3. Restart Apache for the changes to be taken into effect. Enter the command: `sudo /opt/bitnami/ctlscript.sh restart apache` 5. Now, if you navigate back to your terminal at your project folder and enter the command `node app.js`, then your application should run publicly. You can find your application at the public IPv4 address of your AWS Lightsail instance, which can be found under **Public IPv4 address**. Copy this address and paste it into your browser. You should then be able to see your Truman application. #### [](#step-5-final-steps) STEP 5: FINAL STEPS 1. To keep your application online and always running (even when you close the terminal window), you will use PM2 (a daemon process manager). Back in your terminal in your project folder, enter the command `sudo npm install -g pm2`. This installs the package globally. Then enter `pm2 start app.js`. This starts and daemonizes your application. 2. Now you can close your terminal and go to the Public IPv4 Address. You should be able to access your application now! 3. (Optional, but highly recommended): We highly recommend purchasing a domain name and attaching it to your application. 4. Congratulations, your Truman application is now publicly deployed and available! #### [](#step-6-attaching-a-domain-name-optional-but-highly-recommended) STEP 6: ATTACHING A DOMAIN NAME (Optional, but highly recommended) 1. It is recommended that you use a domain name (a web address people type into their browser to access a website) for your application so that others may easily find and access your website, to establish credibility to your site, and to allow you to install a SSL certificate with Let's Encrypt (see below) later on. 2. You will first need to purchase a domain name if you do not already have one. Domain names can be purchased through a variety of domain registrars (ex: Namecheap, GoDaddy, SquareSpace, BlueHost, etc.). They can cost around $14-20/year, depending on the domain name you choose. 3. After you've purchased a domain name, you will need to configure your domain name's DNS record to point to the public IPv4 address of your application. To do this, add an A record in your DNS record and route traffic of the public IPv4 address, and save. 4. It may take about a minute for this change to propagate. Afterwards, you should be able to go to **http://YOUR-DOMAIN-NAME** and see your application. #### [](#step-7-generating-and-installing-a-lets-encrypt-ssl-certificate-optional-but-highly-recommended) Step 7: GENERATING AND INSTALLING A LET'S ENCRYPT SSL CERTIFICATE (Optional, but highly recommended) 1. It is recommended that you use a SSL certificate (a digital certificate that verifies a website's identity and encrypts communication between a user's device and the website) for your website. This enables HTTPS, ensures secure data transmission, and builds trust with website users. 2. The Bitnami HTTPS Configuration Tool is a command line tool for configuring mainly HTTPS certificates on Bitnami stacks and is available to use with your application. To launch this tool, enter the following command: `sudo /opt/bitnami/bncert-tool`. 3. You will be promoted to enter the domain(s) that you are trying to obtain certificates for. Enter your domain (ex: truman.com). If you have more than one, list them all with a space separating each. Press **Enter**. 4. The tool will ask if you'd like to include the www. domain name as well. You can if you'd like (Enter **Y**). If not, Enter **N.** 5. Continue through the process, pressing **Enter** when prompted. 6. When prompted **Enable HTTP to HTTPS redirection \[Y/n\]**, enter **Y**. 7. When prompted **Do you agree with these changes?**, enter **Y.** 8. When prompted for an email address, enter one that you would like to be contacted at and have associated with the SSL Certificate. 9. If the generation of the certificate is successful, you will see **Success** printed in the terminal. Afterwards, you should be able to go to **https://YOUR-DOMAIN-NAME** and see your application. [](#deployment-to-heroku) Deployment to Heroku --------------------------------------------------- 1. Sign up for a free account at [https://heroku.com/](https://heroku.com/) . 2. Follow these instructions to deploy the website: [https://devcenter.heroku.com/articles/git](https://devcenter.heroku.com/articles/git) . Amazon LightSail offers an easy way for users to get started with building and hosting their applications without much hassle. On average, it should cost about $20/ month to host your site. Heroku is also among one of the fastest ways to deploy an application without infrastructure headaches, hassle-free deployment, scaling, and management. ![](https://truman.gitbook.io/~gitbook/image?url=https%3A%2F%2F797468930-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FOR396HK0xjvBHL78w6Qi%252Fuploads%252FWQcFhFOR1S3dmVB3jaTg%252Fimage.png%3Falt%3Dmedia%26token%3Dae21402d-8290-4d9e-a0fc-acb730dbfaa2&width=300&dpr=4&quality=100&sign=44450e2c&sv=2) ![](https://truman.gitbook.io/~gitbook/image?url=https%3A%2F%2F797468930-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FOR396HK0xjvBHL78w6Qi%252Fuploads%252FDNftATbS8Xv33wJgf6nq%252Fimage.png%3Falt%3Dmedia%26token%3D2d2ebddf-c4ca-4dfa-98a3-27eda31cc262&width=300&dpr=4&quality=100&sign=e6f96811&sv=2) ![](https://truman.gitbook.io/~gitbook/image?url=https%3A%2F%2F797468930-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FOR396HK0xjvBHL78w6Qi%252Fuploads%252FaQU7c6IEdGEP6nDtcR22%252Fimage.png%3Falt%3Dmedia%26token%3Df4d6ebc8-f0aa-49d2-a296-9f630b6727f2&width=768&dpr=4&quality=100&sign=6b09f0ac&sv=2) ![](https://truman.gitbook.io/~gitbook/image?url=https%3A%2F%2F797468930-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FOR396HK0xjvBHL78w6Qi%252Fuploads%252FeeqfTSz4tdenSBPUFxK1%252Fimage.png%3Falt%3Dmedia%26token%3Db3a803c9-c968-4d67-9080-1a0a36c0e3ed&width=768&dpr=4&quality=100&sign=da746d39&sv=2) ![](https://truman.gitbook.io/~gitbook/image?url=https%3A%2F%2F797468930-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FOR396HK0xjvBHL78w6Qi%252Fuploads%252FVeKfzhmjTvBaZCb3p0Ee%252Fimage.png%3Falt%3Dmedia%26token%3D27629e8c-928c-4b51-890a-4817d98738b1&width=768&dpr=4&quality=100&sign=64e1863b&sv=2) ![](https://truman.gitbook.io/~gitbook/image?url=https%3A%2F%2F797468930-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FOR396HK0xjvBHL78w6Qi%252Fuploads%252FSiKPs2wFUhvZ1FmwwE1v%252Fimage.png%3Falt%3Dmedia%26token%3D19af6452-801c-46c5-8707-0326f1664ea4&width=768&dpr=4&quality=100&sign=342bd727&sv=2) ![](https://truman.gitbook.io/~gitbook/image?url=https%3A%2F%2F797468930-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FOR396HK0xjvBHL78w6Qi%252Fuploads%252FJeYlZe8m9BR2pIp9JK12%252Fimage.png%3Falt%3Dmedia%26token%3D0f7b9c85-93e2-495c-82cc-5557129f66d8&width=768&dpr=4&quality=100&sign=45011388&sv=2) ![](https://truman.gitbook.io/~gitbook/image?url=https%3A%2F%2F797468930-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FOR396HK0xjvBHL78w6Qi%252Fuploads%252FnUdTRdby7EYWLX0lubqv%252Fimage.png%3Falt%3Dmedia%26token%3D887380b0-adde-4f73-9c56-a10536ce0f5a&width=768&dpr=4&quality=100&sign=bff6d426&sv=2) ![](https://truman.gitbook.io/~gitbook/image?url=https%3A%2F%2F797468930-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FOR396HK0xjvBHL78w6Qi%252Fuploads%252FLmdpyq7bT5uNNqNKBWDo%252Fimage.png%3Falt%3Dmedia%26token%3D88f6c668-4c51-450d-8e4e-e3261858d49a&width=768&dpr=4&quality=100&sign=72c97dc8&sv=2) ![](https://truman.gitbook.io/~gitbook/image?url=https%3A%2F%2F797468930-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FOR396HK0xjvBHL78w6Qi%252Fuploads%252FWkNDgbhLqfmWtL0Y2TXb%252Fimage.png%3Falt%3Dmedia%26token%3Ddec2680e-2333-4d17-835e-fb78d52b7c63&width=768&dpr=4&quality=100&sign=2ddd0d54&sv=2) ![](https://truman.gitbook.io/~gitbook/image?url=https%3A%2F%2Flh7-us.googleusercontent.com%2Fdocsz%2FAD_4nXfbqcXfy7tv69Sl59P0wFfmgoASLMVsOzAMhTOGxb24EoX0aEcms7wuWWQCRe6qqBtHQFdb9uVqQxyp75nTklV_E0wLxjnKLOoqMkKrY3MLB-E0OVN7P9LR0CX8IgkxxnofhOqk_QpvjtDleet0hBLPYZcx%3Fkey%3DCuHd-J6LmOwh-TcFrysiuQ&width=768&dpr=4&quality=100&sign=f14fc78c&sv=2) ---