How To Install Chat App
1. Backend launch
To start the backend you need to install docker
and docker-compose
How to install docker and How to install docker-compose
The entire backend is launched with a single command. Run the command in the root directory
$ docker-compose -f docker-compose.development.yml up --build
And then you need to wait until all the images are downloaded and build After executing this command, will run redis
, mongodb
, socker server
and api server
After launch, you will have available services http://localhost:5000/graphql (api) http://localhost:4000 (socket server)
For start with production configuration use command
$ docker-compose -f docker-compose.production.yml up --build
To run only redis
and mongodb
use command
redis
and mongodb
use command$ docker-compose -f docker-compose.environment.yml up --build
Go to
messenger-api/src/config.ts
and change development configuration.(replacemongoURI
withmongodb://localhost:27017/messenger
andredis.host
withlocalhost
)Go to
messenger-socket/src/config.js
and change development configuration. (replaceredis.host
withlocalhost
)In
messenger-api
directory run command:$ yarn install
$ yarn start
In
messenger-socket
directory run command:$ yarn install
$ yarn start
2. Messenger App launch
In messenger-app
directory run command
$ yarn install
$ yarn start
And in terminal press i
for run on iOS Simulator or press a
for run on Android Emulator (make sure you are already running emulator)
Note: If you run API Server in development configuration you can login and register with any phone number and with any code from SMS, in this mode the twilio does not work
For launch with a production configuration see here. And How to build
You can also use applications without an expo, more details here.
3. Configure AWS S3 for upload photo
Go to messenger-api/src/config.ts
and put your AWS Account data
const AWS = {
bucket: '',
accessKey: '',
secretKey: '',
region: ''
};
Paste this policy
{
"Version": "2012-10-17",
"Id": "Policy1478209136055",
"Statement": [
{
"Sid": "Stmt1478209120479",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:*",
"Resource": "arn:aws:s3:::<your-bucket-name>/*"
}
]
}
Replace <your-bucket-name>
4. Configure Twilio for send SMS Authentication
Go to messenger-api/src/config.ts
and put your twilio data. See more
production: {
...
twilio: {
sid: '<sid>',
token: '<token>',
from: '<phone number>' // From which number will SMS be sent
},
...
},
Last updated
Was this helpful?