Installation

This guide describes how to install the application and server solely to run on an emulator. To run the application on a real device, you need to start your server and specify the hosts of your server in Config file. To start your server, you need to install everything as described in this guide and start the server using the flag production See here.

Installation and running on localhost

Solely for testing purposes on a real device, you can use the hosts of my server, use them in the configuration file

1. Socket Server

Socket server uses Redis for messaging between API and socket server

First we need to install and run Redis. You can use Redis installation guide

Starting Redis

You can set a password for Redis, after which you will need to enter the Redis password into config file socket server and api server. See Config file

In socket-server directory

Next

2. API Server

First install MongoDB. Installation Guide.

Starting MongoDB

In messenger-api directory

3. Setup AWS S3

How to create bucket

How to add Policy

When my-bucket is your bucket name

Put your AWS S3 data into config file. More here

4. Messenger Application.

In messenger-app directory

Running on Production

To run Socket Server and API server, uses the package PM2.

To start the process PM2, you can use commands: yarn production this will launch a server with configurations for production, yarn staging this will launch a server with configurations for staging. See Config file.

To run you need to change config files

Socket server

API Server

Messenger Application

Just set production mode. See here. This will launch Expo with a production configuration.

Note

Also for Socket Server and API Server there is a command yarn start-as-prod. This starts the server with configuration settings for production without build and PM2. It is needed to develop an application on the localhost using the production configuration

To run all the commands you can also use npm run

Last updated

Was this helpful?