From d6a358446c2c9fcfe1190daf799039122d6047dd Mon Sep 17 00:00:00 2001 From: hippoz Date: Thu, 3 Dec 2020 20:38:47 +0200 Subject: [PATCH] add readme with guide --- README.md | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..86848ac --- /dev/null +++ b/README.md @@ -0,0 +1,54 @@ +# Brainlet +Brainlet is a simple chat app. Each category has a text channel associated with it, all messages sent in the text channel are temporary, while in the category itself all posts are permanent. + + +As its database, it uses Mongo DB. +## Self-hosting +So you wanna host Brainlet yourself, huh? + +Firstly, you're gonna need a MongoDB server, I just use Docker for the Mongo server, but you can *try* to not use Docker, though Mongo does not want to standalone on anything outside a perfect debian system or windows, so just use Docker. (if you are on windows, simply install mongo normally, it should work nicely) + +Let create a Docker container for Mongo! +``` +docker run -it -v mongodata:/data/db -p 27017:27017 --name mongodb -d mongo +``` +This should automatically run it, however, next time you need it you gotta run: +``` +docker start mongodb +``` +Stopping it is as simple as: +``` +docker stop mongodb +``` + +Now that we have a Mongo server set up, let's actually begin to set up the Brainlet server. + +***NOTE***: You need nodejs and npm installed in order to proceed! I recommend using node 12.x, but anything above that will probably work. + + +Once you have installed node, clone the repo and then cd into it. +Then, run the following command: +``` +npm i +``` +This will install all of the node modules. + +Then, run: +``` +cp secret.js.template secret.js +``` +This will create a new secret.js based on that template. + +***IMPORTANT***: Open secret.js with your favourite editor, and set the jwtPrivateKey variable to a random string of characters, preferably generated from /dev/random or using node's own generation thing. + + +***NOTE***: You can edit config.js to tweak some of the settings. You might wanna do that, especially if you are planning to run it on a domain. (setting the address variable) + + +### You should now be ready to go! +Just run Brainlet with the command below: +``` +node index.js +``` + +Good luck! \ No newline at end of file