Giter VIP home page Giter VIP logo

chatappserver's Introduction

ChatApp Server

Summary

A back-end server side message dispatcher that works with a client(https://github.com/rodolfovilaca/ChatAppClient). It's a multithreaded program that broadcasts all messages to clients and saves all its timeline in a MySQL database.

Design Patterns

  • Singleton: A single object responsible to communicate with MySQL (CRUD operations) as we don't want several connections to the DB.
  • DAO(Data Access Objects): model used to create objects in the program and save them as data in MySQL.

Instructions

MySQL user setup on production:

> mysql -u root -p
mysql> GRANT ALL PRIVILEGES ON *.* TO ‘ChatAppClient’@‘localhost' WITH GRANT OPTION;
mysql> FLUSH PRIVILEGES;
mysql> exit

How to open ports in Digital Ocean

DB Port

> sudo ufw allow 3306/tcp
> sudo service ufw restart

Socket Port

> sudo ufw allow 5000/tcp 
> sudo service ufw restart

How to generate and run the JAR on production:

> git clone https://github.com/rodolfovilaca/ChatAppServer
> cd ChatAppServer
> mv ./MANIFEST.MF ./bin
> mv ./libs/* ./bin
> cd bin
> jar cfm ChatAppServer.jar MANIFEST.MF * org.rodolfo.bancodedadosmysql.jar mysql-connector-java-5.1.42-bin.jar

Run jar on the foreground:

> java -jar ChatAppServer.jar

Run jar on the background

> nohup java -jar ChatAppServer.jar &
> tail -f nohup.out

Kill background process

> ps -ef
> kill -9 $PID_NUMBER

chatappserver's People

Contributors

rodolfovilaca avatar danielmapar avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.