Getting Started
11 min
the bit that needs to be done before before being able to deploy notez, using either method, some setup does need to be done beforehand this is that prerequisites before starting, make sure you have all of the following things a server or computer that can be kept online 24/7 🖥️ a domain 🌐 a discord & github account 👤 coding knowledge & some familiarity with the command line ⌨️ this includes git, nginx, and pm2 a sentry account 📜 a mongodb database 💾 a google account ✨ some coffee ☕` you can find guides for setting up the following in the getting started sub menu mongodb database (atlas) installing making sure to be connected & logged into the server or computer you wish to host notez on, and clone the notez repository bash git clone https //github com/whizbangpop/notez git && cd notez configurating notez's backend the file notez works from 2 files primarily, server js & config json we are more interested in config json , and you should only be touching server js if you really know what you are doing super easy to break something in there i should know make sure to copy everything word for word, letter for letter and don't leave anything blank one of the few things they tell you in school that actually applies here config json { "github oauth" { "client id" "", "client secret" "" }, "sentry" { "dsn" "" }, "discord oauth" { "client id" "", "client secret" "" }, "server" { "url" "", "secret" "" }, "db" { "connector" "" }, "firebaseconfig" { "apikey" "", "authdomain" "", "projectid" "", "storagebucket" "", "messagingsenderid" "", "appid" "" } } github authentication go to https //github com/settings/applications/new https //github com/settings/applications/new and fill out the fields as so, making sure to change "notez mydomain com" to the domain you plan on using this can be changed, but you can only have 1 redirect uri, annoyingly application name my notez instance homepage url https // notez mydomain com application description you can just leave blank authorization callback url https // notez mydomain com /auth/github/callback then, just register the app and let github work its magic you should now see your app's client id, and copy that into your config and for the client secret, click the generate a new client secret button github will most likely ask you to re authenticate once you have, you should now be presented with your app's new client secret, as it should go without saying, but keep this secret copy that into your config json discord authentication go to https //discord com/developers/applications https //discord com/developers/applications and click on the new application button name it whatever, doesn't matter i would call it notez so you remember what it actually is then, navigate to the "oauth2" tab, and copy both the client id and client secret into your config json discord seems to have a bug where you have to provide a 2fa token to get your app's client secret, even if it is its first time being viewed now, click the add redirect button, and add https // notez mydomain com /auth/discord/callback as the input, making sure to change "notez mydomain com" to your own domain and just hit save! sentry navigate to https //mysentrydomain sentry io/projects/new/ https //sentry io (changing mysentrydomain for your sentry subdomain), and then select express (nodejs) as your project type then, change the name of your project to something memorable, i recommend notez and just click new project now, just ignore 98% of the gibberish sentry has launched upon your screen all we are looking for is the dsn sentry provides in the config object (usually in the second code block) should look like this "https //a11\[ ]eae\@o45\[ ]344 ingest sentry io/4 " (i've omitted some of my dsn, it will look similar, but longer) copy that sucker and paste it into your config using docker docker support is currently a bit buggy, and may not always work as expected building from source then install the required packages with npm npm install && npm install global pm2 this will install the packages that notez requires, as well as pm2, which we will be using to keep the server running, even if we log out! (in the case of a vps)