# Chat project INSA by Paul FLORENCE & Lucien MENASSOL

**[User Guide](./user_guide.pdf)**

**[Conception Book](./coo.pdf)**

---

## Table of contents

- [Chat project INSA by Paul FLORENCE & Lucien MENASSOL](#chat-project-insa-by-paul-florence--lucien-menassol)
  - [Table of contents](#table-of-contents)
  - [Screenshot](#screenshot)
  - [Features](#features)
  - [Installation Instructions](#installation-instructions)
    - [Get the project](#get-the-project)
      - [Prerequisite](#prerequisite)
      - [Download with git (developement version)](#download-with-git-developement-version)
      - [Download from the latest release](#download-from-the-latest-release)
    - [Build the project](#build-the-project)

---

## Screenshot

![screenshot](screenshot.png)

---

## Features
- [x] Windows, OS X and Linux client
- [x] Easy to run executable (no installation)
- [x] Small software (< 50 Mb)
- [x] Choose your username
- [x] Change your username seamlessly
- [x] Discover other users in your local network or use a presence server
- [x] Unique identifier (!= pseudonyme)
- [x] Timestamped messages
- [x] Message history (data persistence)
- [x] Small memory footprint (< 100 Mb)
- [x] Nice user-friendly interface
- [x] Manually connect to a user by specifying his IP address
- [x] REST API endpoint to allow for plugin developpement
- [ ] Color support
- [ ] User authentification
- [ ] User pictures (avatars)
- [ ] Encrypted communication

## Installation Instructions

### Get the project

#### Prerequisite

You need to have the following dependencies installed to compile the project:

- Java 8 or newer
- The Maven build system
- A running local instance of MongoDB

You can use these one liners to install these dependencies:

On Ubuntu:

```bash
apt-get install mongodb-org default-jre maven
```

On Arch-compatible distributions:

```bash
pacman -S mongodb jdk8-openjdk maven
```

#### Download with git (developement version)

Get the project through git (latest developement version) :

```bash
git clone https://git.florencepaul.com/gbip/poo
```

#### Download from the latest release

You can simply download the binary from the [latest release](https://git.florencepaul.com/gbip/poo/releases).

On *Ubuntu Mate* you can run the application by right-clicking on it and selecting `Ouvrir avec OpenJDK Java 8 Runtime`.

Otherwise you need to open a terminal, go into the folder containing the jar you downloaded and execute :

```bash
java -jar NewClav3000.jar
```

If you want to use the presence server instead of launching the app in p2p mode, use

```bash
java -jar NewClav3000.jar --presence-server <presence-server-ip>
```

### Build the project

You need to have **maven** installed to build this project.

If you have already downloaded the sources, go in the project folder :

```bash
cd NewClav3000
```

You can then build the whole project with

```bash
mvn compile
```

To run, just execute :

```bash
mvn exec:java [ -Dexec.args="--presence-server <presence-server-ip>"]
```

To package a jar with all the dependencies, execute :

```bash
mvn compile assembly:single
```

If you want to build and run the presence server, replace `mvn exec` with `mvn exec -Dexec.mainClass="com.insa.app.server.Server"`.
