Chat with your friends and family with your own React app in 3 easy steps
Create a new React app✌
- ant-design - It is a React UI library that contains many icons for making UI interactive.
- Axios - It is a Java Script library to make HTTP requests
- react-chat-engine- It is a chat API without which we cannot make our chat app.
Install all these using a single command:
npm install @ant-design/icons axios react-chat-engine
1. Go to https://chatengine.io/ and create a new project by clicking on New Project. Give your project a name. I have named it as chat-blog.
2. After the project has been created, it provides us a unique Project ID for each project.
As we can see from the above screenshot, now the chatengine.io shows the steps to setup your project(on left). Follow step 1 to add as many users as you want. Enter username and secret key. Secret is your password, confirm it and you can also enter the email, first name, last name and can also set the profile picture of that username in avatar. You can do the same for any number of users.
3. Step 3 shows the code to be embedded in your React app. Copy it and paste that code in your app's App.js file.
Run The App:
Use the command: npm start
Your app will run on localhost:3000 by default. If you have an app already running on localhost:3000, it will run on any other port.
Really awesome article
ReplyDeleteReact vs React Native