diff --git a/README.md b/README.md index 056b281..5343059 100644 --- a/README.md +++ b/README.md @@ -1 +1,7 @@ -swarmlab.io +# *[swarmlab.io](www.docs.swarmlab.io)* + +Swarmlab is a powerful collaboration tool that connects tutors and students in a unique all-in-one environment that gets work done fast and easily. + + + + diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml new file mode 100644 index 0000000..68265ab --- /dev/null +++ b/docker/docker-compose.yml @@ -0,0 +1,18 @@ +version: "3.8" +services: + webapp: + build: ../web + dockerfile: dockerfile + image: webapp:latest +deploy: + mode: replicated + replicas: 2 + restart_policy: + condition: on-failure + delay: 10s + max_attempts: 3 + window: 120s + placement: + max_replicas_per_node: 1 + constraints: + - "node.role==manager" diff --git a/routes/users.js b/routes/users.js deleted file mode 100755 index 623e430..0000000 --- a/routes/users.js +++ /dev/null @@ -1,9 +0,0 @@ -var express = require('express'); -var router = express.Router(); - -/* GET users listing. */ -router.get('/', function(req, res, next) { - res.send('respond with a resource'); -}); - -module.exports = router; diff --git a/app.js b/web/app.js similarity index 100% rename from app.js rename to web/app.js diff --git a/bin/www b/web/bin/www similarity index 100% rename from bin/www rename to web/bin/www diff --git a/public/javascripts/fetchLabs.js b/web/config/creds.js similarity index 100% rename from public/javascripts/fetchLabs.js rename to web/config/creds.js diff --git a/web/dockerfile b/web/dockerfile new file mode 100644 index 0000000..8506b70 --- /dev/null +++ b/web/dockerfile @@ -0,0 +1,19 @@ +FROM node:latest + +# Create app directory +WORKDIR /usr/src/app + +# Install app dependencies +# A wildcard is used to ensure both package.json AND package-lock.json are copied +# where available (npm@5+) +COPY package*.json ./ + +RUN npm install +# If you are building your code for production +# RUN npm ci --only=production + +# Bundle app source +COPY . . + +EXPOSE 8080 +CMD [ "node", "./bin/www" ] \ No newline at end of file diff --git a/locales/el.json b/web/locales/el.json similarity index 100% rename from locales/el.json rename to web/locales/el.json diff --git a/locales/en.json b/web/locales/en.json similarity index 100% rename from locales/en.json rename to web/locales/en.json diff --git a/package-lock.json b/web/package-lock.json similarity index 99% rename from package-lock.json rename to web/package-lock.json index 4dda700..984fe36 100755 --- a/package-lock.json +++ b/web/package-lock.json @@ -1,6 +1,6 @@ { "name": "swarmlab.io", - "version": "0.0.0", + "version": "0.1.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/web/package.json similarity index 82% rename from package.json rename to web/package.json index 83bc2f6..14c8629 100755 --- a/package.json +++ b/web/package.json @@ -1,9 +1,10 @@ { "name": "swarmlab.io", - "version": "0.0.0", + "version": "0.1.0", "private": true, "scripts": { - "start": "nodemon ./bin/www" + "start": "node ./bin/www", + "dev": "nodemon ./bin/www" }, "dependencies": { "cookie-parser": "~1.4.4", @@ -18,4 +19,4 @@ "morgan": "~1.9.1", "nodemon": "^2.0.4" } -} \ No newline at end of file +} diff --git a/public/images/annie-spratt-QckxruozjRg-unsplash.jpg b/web/public/images/annie-spratt-QckxruozjRg-unsplash.jpg similarity index 100% rename from public/images/annie-spratt-QckxruozjRg-unsplash.jpg rename to web/public/images/annie-spratt-QckxruozjRg-unsplash.jpg diff --git a/public/images/markus-spiske-qjnAnF0jIGk-unsplash.jpg b/web/public/images/markus-spiske-qjnAnF0jIGk-unsplash.jpg similarity index 100% rename from public/images/markus-spiske-qjnAnF0jIGk-unsplash.jpg rename to web/public/images/markus-spiske-qjnAnF0jIGk-unsplash.jpg diff --git a/public/images/thomas-jensen-ISG-rUel0Uw-unsplash.jpg b/web/public/images/thomas-jensen-ISG-rUel0Uw-unsplash.jpg similarity index 100% rename from public/images/thomas-jensen-ISG-rUel0Uw-unsplash.jpg rename to web/public/images/thomas-jensen-ISG-rUel0Uw-unsplash.jpg diff --git a/public/images/yancy-min-842ofHC6MaI-unsplash.jpg b/web/public/images/yancy-min-842ofHC6MaI-unsplash.jpg similarity index 100% rename from public/images/yancy-min-842ofHC6MaI-unsplash.jpg rename to web/public/images/yancy-min-842ofHC6MaI-unsplash.jpg diff --git a/public/javascripts/bs-init.js b/web/public/javascripts/bs-init.js similarity index 100% rename from public/javascripts/bs-init.js rename to web/public/javascripts/bs-init.js diff --git a/web/public/javascripts/fetchLabs.js b/web/public/javascripts/fetchLabs.js new file mode 100644 index 0000000..e69de29 diff --git a/public/stylesheets/Footer-Dark.css b/web/public/stylesheets/Footer-Dark.css similarity index 100% rename from public/stylesheets/Footer-Dark.css rename to web/public/stylesheets/Footer-Dark.css diff --git a/public/stylesheets/Navigation-with-Button.css b/web/public/stylesheets/Navigation-with-Button.css similarity index 100% rename from public/stylesheets/Navigation-with-Button.css rename to web/public/stylesheets/Navigation-with-Button.css diff --git a/public/stylesheets/bootstrap.min.css b/web/public/stylesheets/bootstrap.min.css similarity index 100% rename from public/stylesheets/bootstrap.min.css rename to web/public/stylesheets/bootstrap.min.css diff --git a/routes/index.js b/web/routes/index.js similarity index 74% rename from routes/index.js rename to web/routes/index.js index 78c700e..f54df01 100755 --- a/routes/index.js +++ b/web/routes/index.js @@ -1,7 +1,6 @@ var express = require('express'); var router = express.Router(); -/* GET home page. */ router.get('/', (req, res, next) => { res.render('index'); }); diff --git a/views/error.ejs b/web/views/error.ejs similarity index 100% rename from views/error.ejs rename to web/views/error.ejs diff --git a/views/index.ejs b/web/views/index.ejs similarity index 100% rename from views/index.ejs rename to web/views/index.ejs