Skip to content

🪧 The aim of this project was to create a chat room for friends !

License

Notifications You must be signed in to change notification settings

caullird/info834_blabla-tea

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🔈🍵 - Blabla tea

The aim of this project was to create a chat room for friends! We had two 4-hour sessions to complete this project! The objectives were the following:

👦🏻 Project objective for the user experience

✅ Allow users to create an account 

✅ Allow users to login / logout

✅ Allow users to know who is logged in

✅ Allow users to retrieve conversation history with another user 

✅ Allow users to open a conversation with another user 

🛠️ Project objective at technical implementation level

✅ Using Node.js for the application structure

✅ Use MongoDB for data storage

✅ Use socket.io for interaction management

✅ Have a fault tolerant application (use of Replicaset)

✅ Unit testing with Node.js

👀 Quick overview of our project

When the user arrives on our application, he has the possibility to log in (left image), or to create an account (right image).

image

When the user logs in, an example conversation is visible, to explain very quickly what is possible in our project

image

The different users who are connected (indicated with the "online" at the top left), can communicate

image

To find out more and try out all the features, it's best to try out our application!

🛠️ How to use

1️⃣ Clone the Git

2️⃣ Modify the configuration file to match your environment (in the configuration file here)

{
	"db": {
		"host": "127.0.0.1",
		"port": 27017,
		"name": "chat"
	},
	"sessionSecret": "123soleil",
	"redis": {
		"host": "127.0.0.1",
		"port": 6379,
		"password": ""
	}
}

3️⃣ Install the packages

yarn or npm install

4️⃣ Start MongoDB using replicaset (optional)

If you have problems with the replicaset, you can simply follow step 8️⃣

mongod --replSet rs0 --port 27017 --dbpath ./data/r0s1
mongod --replSet rs0 --port 27018 --dbpath ./data/r0s2
mongod --replSet rs0 --port 27019 --dbpath ./data/r0s3

5️⃣ Start the arbiter (optional)

mongod--port 30000 --dbpath ./data/arb --replSet rs0

6️⃣ Defind roles of mongod servers (optional)

mongo --port 27017

7️⃣ Last step to complete the configuration (optional)

rs.initiate()
rs.conf()
rs.add("localhost:27018")
rs.add("localhost:27019")
rs.addArb("localhost:30000")

8️⃣❗ Step to follow only in case of a problem with the replicat set

rmdir /S data
mkdir data

9️⃣You can now start the services !

open redis-server.exe from the source file
node server.js

1️⃣0️⃣ It's time to have fun, go to localhost:3000

🧪👁️‍🗨️ As we are good developers, we tried to make unit tests

npm run test

🏗️ Developed with

💪 Authors of this project

About

🪧 The aim of this project was to create a chat room for friends !

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published