Giter Site home page Giter Site logo

recipe-app's Introduction

RecipeApp

The intention of this app / website is to have a recipe database and a planning tool at the same time. I.e. a week in advance can be planned and a shopping list is created automatically. Recipes show up on the corresponding days and number of persons are incorporated into the shopping list and recipes. In addition due to personal reasons the database supports three languages for the same ingredient (english, german and finnish).

Demo (login requires activation of me, so please email before): https://www.rezept-planer.de

Installation (Ubuntu)

Clean installation of Ubuntu 14.04 LTS.

Additional packages required for further process are:

sudo apt-get install gcc g++ git make nginx libkrb5-dev imagemagick

NodeJS

Get the newest NVM (Node Version Manager), see also https://github.com/creationix/nvm :

wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.29.0/install.sh | bash

Install and activate latest NodeJS version:

nvm install stable
nvm use stable
nvm alias default stable

MongoDB

Manual (newest version, at least 3.2 required)

Install MongoDB by using MongoDB repositories (does not work with 15.04), see https://docs.mongodb.org/master/tutorial/install-mongodb-on-ubuntu/ :

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927
echo "deb http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.2 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.2.list
sudo apt-get update
sudo apt-get install -y mongodb-org

Redis

Install Redis by compiling the newest version:

wget http://download.redis.io/releases/redis-3.0.5.tar.gz
tar -xzf redis-3.0.5.tar.gz
cd redis-3.0.5/deps
make hiredis lua jemalloc linenoise
cd ..
make
sudo make install

If you want to make it automatically run at startup run the following:

cd utils
sudo ./install_server.sh

Installation recipeApp

Enter the home directory (or where ever you want to install it), create an folder and enter it:

cd
mkdir recipeApp
cd recipeApp

Clone the git repository:

git clone https://github.com/jansauerbrey/recipe-app.git .

Install required modules for NodeJS:

npm install

Run by using:

node recipeApp.js

Automated startup

For automated startup (service) I use pm2. To install it and make the NodeJS server start at boot time run the following:

npm install -g pm2
pm2 start recipeApp.js

To actually run it at startup, run the following and execute the generated command in the shell:

pm2 startup ubuntu

Nginx configuration

Example configuration for https config:

/etc/nginx/sites-available/default

server {
       listen         80;
       server_name    www.rezept-planer.de;
       return         301 https://$server_name$request_uri;
}


server {
    listen 443 ssl;

    server_name www.rezept-planer.de;

    client_max_body_size 8M;

        ssl on;
        ssl_certificate /etc/nginx/ssl/rezept-planer.de.pem;
        ssl_certificate_key /etc/nginx/ssl/rezept-planer.de.key;

        ssl_session_timeout 5m;

        ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
        ssl_ciphers "ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA:ECDHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES128-SHA256:DHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES256-GCM-SHA384:AES128-GCM-SHA256:AES256-SHA256:AES128-SHA256:AES256-SHA:AES128-SHA:DES-CBC3-SHA:HIGH:!aNULL:!eNULL:!EXPORT:!DES:!MD5:!PSK:!RC4";
        ssl_prefer_server_ciphers on;

		# adjust according to your path
    root /home/jan/recipeApp/cordova-app/www;
    index index.html index.htm;

    location / {
        try_files $uri $uri/ =404;
    }

		# adjust according to your path
    location /upload/ {
        alias /home/jan/recipeApp/upload/;
    }

    location /api/ {
        proxy_pass http://127.0.0.1:3000;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;
    }
}

License

The MIT License (MIT)

Copyright (c) 2015-2016 Jan Sauerbrey

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.