Skip to content

MostafaK2/chat-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

chat-app (frontend and backend)

This is the code base for chat-app implemented using websockets

Requirements

Java8. Install java
Apache Maven. v3.8.6 Install maven
Node.js. v18.3.0 Install node.js
MySQL from MySQL Workbench

MySQL

Set up your my sql server
Save your URI, Password and Username

set up springboot

  • Navigate application.properties file cd ./src/main/resources
  • If using a database other than mySql, then change the following:
    spring.datasource.url to the sql server url
    spring.datasource.driver-class-name to respective driver name
    spring.jpa.properties.hibernate.dialect to respective dialect
  • Enter your username and password for the database in these two slots spring.datasource.username and spring.datasource.password

Running Headless

Frontend Application

  • Move to the frontend directory
    cd ./chat-app-frontend
  • Install Required Dependencies
    npm install
  • Run the application
    npm start
  • Run the tests
    npm test

Backend Application

  • Navigate to the root backend directory
  • Install all the required maven dependency by running
    cd ./src
  • Run the app mvn spring-boot:run

Deployement

Description: The jar file or the docker image would run the frontend and the backend on the same port.

Using a jar file

In the main chat-app application folder, run mvn clean install
This command will create a working jar file that could be deployed to a website.
The jar file would in the target folder. Its named a chat-app-backend-0.0.1-SNAPSHOT.jar
Run this jar file by running java -jar path/to/your/jarfile.jar

Using Docker container

The Docker container has enviroment varibles setup for the database credentials
ENV DATABASE_URI = database
ENV DATABASE_USER = user
ENV DATABASE_PASSWORD = pass
If you would like to change this, you need also the names in application.properties file as well

By default docker uses the Dockerfile of the current folder if you run a single command like
docker build -e DATABASE_URI = <db_uri> -e DATABASE_USER = <db_user> -e DATABASE_PASSWORD = <db_pass> -t <your_docker_image>

Run your docker image by running the following:
docker run -p 8080:8080 <your_docker_image>

About

A real time chat application implemented in react, springboot and mySQL.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors