aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Kronqvist <joel.h.kronqvist@gmail.com>2022-02-10 20:38:28 +0200
committerJoel Kronqvist <joel.h.kronqvist@gmail.com>2022-02-10 20:38:28 +0200
commitb0841da93712d2bd7d8c47930cb8bed41ce417db (patch)
treef46dfac30debb454d964a9a58b4bd3ca5ce74769
parentb270c4475ca6ed61784ed8368ab42fea3dc528e5 (diff)
downloadLYLLRuoka-b0841da93712d2bd7d8c47930cb8bed41ce417db.tar.gz
LYLLRuoka-b0841da93712d2bd7d8c47930cb8bed41ce417db.zip
Updated README.md
-rw-r--r--README.md56
1 files changed, 44 insertions, 12 deletions
diff --git a/README.md b/README.md
index 4195255..17684e3 100644
--- a/README.md
+++ b/README.md
@@ -1,14 +1,35 @@
-# Food-app
-Readme coming soon!
-
-## Setup
-You will need a SSL certificate if you want to use https.
-You need to install node.js and MySQL (+ npm install mysql2).
-You will need to update the server with the help of the food shift message and a tab separated list of classes (just copypaste from excel from the Kurssitarjotin)
-You probably want to set up cron to run some cronjobs from crontab_add.txt.
-Also, some of the code depends on the github repo JoelHMikael/funcs, so go ahead and clone them.
-You need to provide the login info to the MySQL DB in ../dblogin.txt. Logging in as root was found problematic on Mint, but feel free to try if you want to.
-You should create the following tables, because the server code wont do it for you.
+# Installation instructions
+Follow these steps to install everything required for the project to run.
+
+## Install the FoodJS repository:
+```
+git clone "https://github.com/JoelHMikael/FoodJS.git"
+```
+
+## Install node.js
+(16.x, the one in Ubuntus package repositories is outdated)
+```
+apt install curl
+curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash -
+apt-get install -y nodejs
+```
+Install npm packages required for project
+```
+npm install mysql2
+```
+
+## Install MySQL server & configure it
+```
+apt install mysql-server
+sudo mysql_secure_installation
+```
+> Note: If you want to update the databases remotely, you can allow logging in from the local network. In this case you of course have to use a strong password.
+
+## Initializing the database
+Log into mysql and run the following to initialize the tables:
+```
+CREATE DATABASE lyllruoka;
+USE lyllruoka;
CREATE TABLE shiftnames (
day INT,
@@ -45,4 +66,15 @@ CREATE TABLE exams (
end DATE,
message VARCHAR(256),
PRIMARY KEY (start, end)
-); \ No newline at end of file
+);
+```
+
+## Give the server the credentials, keys & other required things
+* MySQL credentials in `../dblogin.txt`
+ * You may want to create a user for this. There has been some problems logging in as root on ubuntu, if I remember right.
+* SSL certificate in `../Certificate/key.pem` and `../Certificate/cert.pem`
+
+---
+
+# Updating the tables
+Coming soon... \ No newline at end of file