Bii o ṣe le ṣe awọn akọsilẹ pẹlu Iwe-kikọ

Lọwọlọwọ lọwọlọwọ awọn irinṣẹ lọpọlọpọ fun ṣiṣe awọn akọsilẹ, ọkan ti o ti mu akiyesi mi ni tuntun, alagbara ati orisun ṣiṣi Iwe, eyiti o jẹ iyatọ gidi si awọn ohun-ini ohun-ini ti agbegbe yii.

Kini Iwe-kikọ?

Iwe kikọ jẹ yiyan orisun orisun fun gbigba akọsilẹ, o ṣe atilẹyin Evernote, Microsoft OneNote & Google Keep.

iwe iṣẹ

iwe iṣẹ

Iwe kikọ a ti kọ ọ ni PHP, ni lilo ilana Laravel 4. Itumọ ti lori oke ti AngularJS y Okun bata 3, pO pese wiwo olumulo olumulo wẹẹbu igbalode, bii API ṣiṣi fun iṣọpọ ẹnikẹta.

Fun apakan ẹhin-ọrọ o tọju ohun gbogbo sinu ibi ipamọ data kan MySQL. Pẹlu iru awọn ibeere to wọpọ (Linux, Apache, MySQL, PHP), Iwe kikọ Yoo ni anfani lati ṣiṣẹ kii ṣe lori awọn olupin ifiṣootọ nikan, ṣugbọn tun lori awọn ẹrọ NAS kekere ati alabọde (Synology, QNAP, ati bẹbẹ lọ).

Bii o ṣe le ṣe idanwo demo iwe kan

A le ṣe idanwo demo ti Iwe-iṣẹ nipa iraye si awọn iṣẹlẹ iṣẹ ori ayelujara ti a pese nipasẹ  Iyanrin y Cloudron.  O le gbiyanju Iwe ni Sandstorm (laisi wíwọlé) tabi Iwe iṣẹ ni Cloudron (orukọ olumulo: Cloudron, ọrọigbaniwọle: Cloudron).

Ni gbogbo alẹ ni 3 owurọ (CET), ibi ipamọ data ti lọ silẹ ati tun pada, ati awọn imudojuiwọn tuntun lori GitHub ti wa ni ṣiṣi.

Ni idaniloju lati ṣẹda / yipada / paarẹ awọn iroyin, awọn iwe ajako ati awọn akọsilẹ. Yi demo le ṣee lo fun idanwo to lagbara laisi eyikeyi iṣoro.

Awọn ibeere lati fi sii Iwe iṣẹ

  • php5
  • MySQL
  • nginx, atupa ...
  • ọmọ-iwe
  • nodejs

Bii o ṣe le fi sii Iṣẹ-iwe

Fi iwe iṣẹ sori Ubuntu 14.10

Eyi yoo tọ ọ ni igbesẹ nipasẹ igbesẹ bi o ṣe le fi sori ẹrọ a Olupin LEMP ati iwe. A kọ itọsọna yii ati idanwo lori Ubuntu 14.10 eyiti o le ṣiṣẹ pẹlu awọn ẹya agbalagba bakanna.


Fi awọn igbẹkẹle sii

apt-get update
apt-get install mysql-server php5-mysql nginx php5-fpm curl wget git php5-cli php5-gd php5-mcrypt nodejs nodejs-legacy

Ti o ba n gbero lati lo MySQL, o ni iṣeduro pe ki o tunto rẹ lailewu:

/usr/bin/mysql_secure_installation

Lati jẹki mcrypt ninu awọn faili iṣeto PHP, iwọ yoo nilo lati ṣafikun atẹle ni isalẹ ti iṣeto fun php5-cli ati php5-fpm:

extension=mcrypt.so

vi /etc/php5/fpm/php.ini
vi /etc/php5/cli/php.ini

fi sori ẹrọ olupilẹṣẹ

curl -sS https://getcomposer.org/installer | php

ṣiṣe olupilẹṣẹ laisi sisọ ọna naa

mv composer.phar /usr/local/bin/composer

Ṣẹda itọsọna lati fi sori ẹrọ Iwe kikọ

mkdir /var/www/
cd /var/www/

Gba lati ayelujara Iwe kikọ lilo Git:

git clone https://github.com/twostairs/paperwork.git

Lọ si itọsọna iwaju:

 cd ./paperwork/frontend/

Ṣiṣe "fi olupilẹṣẹ sori ẹrọ" ati / tabi "imudojuiwọn olupilẹṣẹ". Eyi yoo fi gbogbo awọn igbẹkẹle pataki sii.

composer install

Bayi, o gbọdọ fi awọn iwe eri MySQL rẹ si frontend / app / config / database.php. Fun fifi sori agbegbe, a le tunto ibi ipamọ data iwe-aṣẹ lati ṣiṣẹ pẹlu awọn eto aiyipada:

DROP DATABASE IF EXISTS paperwork;
CREATE DATABASE IF NOT EXISTS paperwork DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
GRANT ALL PRIVILEGES ON paperwork.* TO 'paperwork'@'localhost' IDENTIFIED BY 'paperwork' WITH GRANT OPTION;
FLUSH PRIVILEGES;
quit

Lẹhin ipari awọn igbesẹ wọnyi, ṣiṣe awọn iṣẹ-ṣiṣe ijira, eyiti o kun aaye data:

php artisan migrate

Yi awọn igbanilaaye Paperwork lori itọsọna wẹẹbu si olumulo nginx ti n ṣiṣẹ:

chown www-data:www-data -R /var/www/

Ṣatunkọ awọn eto aaye aiyipada lati baamu: / ati be be / nginx / ojula-wa / aiyipada

server {
        listen   80;
        # listen 443 ssl;

        root /var/www/paperwork/frontend/public;
        index index.php index.html index.htm;

        server_name example.com;

        # server_name example.com;
        # ssl_certificate /etc/nginx/ssl/server.crt;
        # ssl_certificate_key /etc/nginx/ssl/server.key;

        location / {
                try_files $uri $uri/ /index.php;
        }

        error_page 404 /404.html;

        error_page 500 502 503 504 /50x.html;
        location = /50x.html {
              root /usr/share/nginx/www;
        }

        # pass the PHP scripts to FastCGI server listening on the php-fpm socket
        location ~ \.php$ {
                try_files $uri =404;
                fastcgi_pass unix:/var/run/php5-fpm.sock;
                fastcgi_index index.php;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                include fastcgi_params;

        }

}

Fi npm sii:

 wget https://www.npmjs.org/install.sh
 bash ./install.sh

Fi sori ẹrọ gulp ati bower:

 npm install -g gulp bower

Fi awọn igbẹkẹle npm ti iṣẹ naa sori ẹrọ

 npm install

Fi awọn igbẹkẹle bower sori ẹrọ ati ṣiṣe awọn iṣẹ ṣiṣe aiyipada

 bower install
 gulp

Tun Nginx bẹrẹ ati php

service nginx restart
service php5-fpm restart

A le wọle si localhost:8888 ki o bẹrẹ si ni igbadun Iwe kikọ

Fi iwe sii sori Debian 7

Eyi yoo tọ ọ ni igbesẹ nipasẹ igbesẹ bi o ṣe le fi sori ẹrọ a Olupin LEMP ati iwe. A ti kọ itọsọna yii ati idanwo lori Debian 7 eyiti o le ṣiṣẹ pẹlu awọn ẹya agbalagba bakanna.

A gbọdọ ṣafikun awọn iwe ipamọ ti ibi ipamọ, ti a beere lati fi sori ẹrọ Node.js si faili /etc/apt/sources.list:

 deb http://http.debian.net/debian wheezy-backports main

Fi awọn igbẹkẹle sii

apt-get update
apt-get install mysql-server php5-mysql nginx php5-fpm curl wget git php5-cli php5-gd php5-mcrypt nodejs nodejs-legacy

Ti o ba n gbero lati lo MySQL, o ni iṣeduro pe ki o tunto rẹ lailewu:

/usr/bin/mysql_secure_installation

Ṣafikun olupilẹṣẹ

curl -sS https://getcomposer.org/installer | php

ṣiṣe olupilẹṣẹ laisi sisọ ọna naa

mv composer.phar /usr/local/bin/composer

Ṣẹda itọsọna lati fi sori ẹrọ Iwe kikọ:

mkdir /var/www/
cd /var/www/

Gba lati ayelujara Iwe kikọ lilo Git:

git clone https://github.com/twostairs/paperwork.git

Lọ si itọsọna iwaju:

 cd ./paperwork/frontend/

Ṣiṣe "fi olupilẹṣẹ sori ẹrọ" ati / tabi "imudojuiwọn olupilẹṣẹ". Eyi yoo fi awọn igbẹkẹle pataki sii.

composer install

A gbọdọ sopọ si Iwe iṣẹ si olupin SQL rẹ. Ṣẹda "database.json" ki o daakọ faili naa "default_database.json":

cp app/storage/config/default_database.json app/storage/config/database.json

Tabi, tẹ awọn iwe-ẹri ti olupin SQL rẹ sii ni "database.json", fun fifi sori ẹrọ ti o rọrun lori olupin agbegbe rẹ, a le fi idi ipilẹ data ti o ṣiṣẹ pẹlu iṣeto aiyipada:

DROP DATABASE IF EXISTS paperwork;
CREATE DATABASE IF NOT EXISTS paperwork DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
GRANT ALL PRIVILEGES ON paperwork.* TO 'paperwork'@'localhost' IDENTIFIED BY 'paperwork' WITH GRANT OPTION;
FLUSH PRIVILEGES;
quit

Lẹhin ipari awọn igbesẹ wọnyi, ṣiṣe awọn iṣẹ-ṣiṣe ijira, eyiti o kun aaye data:

php artisan migrate

Yi awọn igbanilaaye Paperwork lori itọsọna wẹẹbu si olumulo nginx ti n ṣiṣẹ:

chown www-data:www-data -R /var/www/

Ṣatunkọ awọn eto aaye aiyipada lati baamu: / ati be be / nginx / ojula-wa / aiyipada

server {
        listen   80;
        # listen 443 ssl;

        root /var/www/paperwork/frontend/public;
        index index.php index.html index.htm;

        server_name example.com;

        # server_name example.com;
        # ssl_certificate /etc/nginx/ssl/server.crt;
        # ssl_certificate_key /etc/nginx/ssl/server.key;

        location / {
                try_files $uri $uri/ /index.php;
        }

        error_page 404 /404.html;

        error_page 500 502 503 504 /50x.html;
        location = /50x.html {
              root /usr/share/nginx/www;
        }

        # pass the PHP scripts to FastCGI server listening on the php-fpm socket
        location ~ \.php$ {
                try_files $uri =404;
                fastcgi_pass unix:/var/run/php5-fpm.sock;
                fastcgi_index index.php;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                include fastcgi_params;

        }

}

fi sori ẹrọ npm

 wget https://www.npmjs.org/install.sh
 bash ./install.sh

fi sori ẹrọ gulp ati bower

 npm install -g gulp bower

Fi awọn igbẹkẹle ọsan ti o nilo fun iṣẹ naa sori ẹrọ

 npm install

Fi awọn igbẹkẹle bower sori ẹrọ ati ṣiṣe awọn iṣẹ ṣiṣe pataki

 bower install
 gulp

Tun Nginx bẹrẹ ati php

service nginx restart
service php5-fpm restart

Imudojuiwọn Iwe, ṣiṣe (lati / iwaju)

  sudo php artisan paperwork:update

Iwe iwe iṣẹ

A le rii iwe API ni docs.paperwork.apiary.io tabi lilo apiary.apib lati ibi ipamọ iwe iṣẹ osise. Iwe iwe wa labẹ idagbasoke, nitorinaa awọn ireti siwaju sii ni a reti.

Ṣe alabapin si Iwe-iṣẹ

Lati ṣe alabapin si Iwe-iṣẹ o le lo atẹle naa git ti eka. Nitorinaa lati dagbasoke, o ni lati ṣe ẹda oniye ibi ipamọ ni Github, ki o gba ẹka tuntun kan. Ṣe idaniloju awọn iyipada ẹka ati lẹhinna Titari awọn imudojuiwọn si ẹka idagbasoke.

Ti o ba nifẹ si iṣẹ yii ati pe o fẹ lati ṣe alabapin, o le kan si Olùgbéejáde marius@paperwork.rocks) tabi Twitter (@devilx) -

Ikanni IRC wa # iṣẹ-iwe lori freenode.net ati pe ẹgbẹ kan wa gita.


Awọn akoonu ti nkan naa faramọ awọn ilana wa ti awọn ilana olootu. Lati jabo aṣiṣe kan tẹ nibi.

Jẹ akọkọ lati sọ ọrọ

Fi ọrọ rẹ silẹ

Adirẹsi imeeli rẹ yoo ko le ṣe atejade.

*

*

  1. Lodidi fun data naa: Miguel Ángel Gatón
  2. Idi ti data naa: SPAM Iṣakoso, iṣakoso ọrọ asọye.
  3. Ofin: Iyọọda rẹ
  4. Ibaraẹnisọrọ data: Awọn data kii yoo ni ifọrọhan si awọn ẹgbẹ kẹta ayafi nipasẹ ọranyan ofin.
  5. Ibi ipamọ data: Alaye data ti o gbalejo nipasẹ Awọn nẹtiwọọki Occentus (EU)
  6. Awọn ẹtọ: Ni eyikeyi akoko o le ni opin, gba pada ki o paarẹ alaye rẹ.

bool (otitọ)