Repository: tabvn/nodejs-reactjs-chatapp
Branch: master
Commit: 4ff49c675885
Files: 45
Total size: 131.9 KB
Directory structure:
gitextract_xpe_08_e/
├── .gitignore
├── README.md
├── app/
│ ├── .gitignore
│ ├── Dockerfile
│ ├── README.md
│ ├── docker-compose.yml
│ ├── package.json
│ ├── public/
│ │ ├── index.html
│ │ └── manifest.json
│ └── src/
│ ├── components/
│ │ ├── app.js
│ │ ├── messenger.js
│ │ ├── search-user.js
│ │ ├── user-bar.js
│ │ ├── user-form.js
│ │ └── user-menu.js
│ ├── config.js
│ ├── css/
│ │ ├── .sass-cache/
│ │ │ └── c6c61f1d3471adfa6b4f36ea934cb8d28f43b0b7/
│ │ │ ├── _font.scssc
│ │ │ ├── _variable.scssc
│ │ │ └── app.scssc
│ │ ├── _font.scss
│ │ ├── _variable.scss
│ │ ├── app.css
│ │ └── app.scss
│ ├── helpers/
│ │ ├── index.js
│ │ └── objectid.js
│ ├── index.js
│ ├── realtime.js
│ ├── registerServiceWorker.js
│ ├── service.js
│ └── store.js
├── deployment-to-digitalocean-hosting.md
└── server/
├── Dockerfile
├── docker-compose.yml
├── package.json
└── src/
├── app-router.js
├── database.js
├── helper.js
├── index.js
├── models/
│ ├── channel.js
│ ├── connection.js
│ ├── index.js
│ ├── message.js
│ ├── token.js
│ └── user.js
└── www/
└── index.html
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitignore
================================================
.idea
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local
npm-debug.log*
yarn-debug.log*
yarn-error.log*
server/node_modules
app/node_modules
server/dist
server/package-lock.json
app/node_modules
app/package-lock.json
================================================
FILE: README.md
================================================
# nodejs-reactjs-chatapp
Create messenger chat application use Nodejs Expressjs, Reactjs.
## Screenshot:
## Server
```
cd server
```
```
npm install
```
```
npm run dev
```
### Reactjs App development
```
cd app
```
```
npm start
```
### Reactjs App development using docker-compose
The docker-compose files are located in the two different application folders app and server. To run all the functions using docker run the follow commands:
```
cd server
```
```
docker-compose up
```
At this moment the server application side will be running.
Now it's time to run application front end. Open a new terminal (window or tab) and in the project folder use the following commands:
```
cd app
```
```
docker-compose up
```
Attention: Deppending on the way you have installed the docker in your compile you may use **sudo** command to run docker, for example:
```
sudo docker-compose up
```
For more docker informations and how to install access https://www.docker.com/ .
## Tutorials
* Checkout the video toturials list: https://www.youtube.com/playlist?list=PLFaW_8zE4amPaLyz5AyVT8B_wfOYwd8x8
* My Facebook: https://www.facebook.com/TabvnGroup/
* Youtube Chanel: https://youtube.com/tabvn
## Deploy Node.js React.js to DigitalOcean.com Ubuntu 16.04 Cloud VPS
* Document
* Video: https://www.youtube.com/watch?v=wJsH45eWNBo
================================================
FILE: app/.gitignore
================================================
# See https://help.github.com/ignore-files/ for more about ignoring files.
# dependencies
/node_modules
# testing
/coverage
# production
/build
# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local
npm-debug.log*
yarn-debug.log*
yarn-error.log*
================================================
FILE: app/Dockerfile
================================================
FROM node:11.12.0
# Install a bunch of node modules that are commonly used.
#ADD package.json /usr/app/
ADD . /usr/app/
EXPOSE 80
ENV BIND_HOST=0.0.0.0
CMD ["npm", "start"]
WORKDIR /usr/app
RUN npm install
================================================
FILE: app/README.md
================================================
## Start app
```
npm install
```
```
npm start
```
================================================
FILE: app/docker-compose.yml
================================================
version: '3'
services:
app:
build: .
ports:
- "3000:3000"
command: npm start
================================================
FILE: app/package.json
================================================
{
"name": "my-app",
"version": "0.1.0",
"private": true,
"dependencies": {
"axios": "^0.17.1",
"classnames": "^2.2.5",
"immutable": "^3.8.2",
"lodash": "^4.17.4",
"moment": "^2.19.2",
"react": "^16.1.1",
"react-dom": "^16.1.1",
"react-scripts": "1.0.17"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
}
}
================================================
FILE: app/public/index.html
================================================
{channel.lastMessage}
Joined: {moment(member.created).fromNow()}