Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/arturnawrot/chickenpoll
Web application for creating real time straw polls. Stack: Laravel 5.7, MySQL, Bootstrap 4, Vue.js, socket.io, redis
https://github.com/arturnawrot/chickenpoll
bootstrap4 laravel5 mysql php redis scss socket-io straw-polls vuejs2
Last synced: about 1 month ago
JSON representation
Web application for creating real time straw polls. Stack: Laravel 5.7, MySQL, Bootstrap 4, Vue.js, socket.io, redis
- Host: GitHub
- URL: https://github.com/arturnawrot/chickenpoll
- Owner: arturnawrot
- Created: 2019-08-26T16:13:34.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2023-08-11T14:13:34.000Z (over 1 year ago)
- Last Synced: 2024-09-28T19:02:51.892Z (about 2 months ago)
- Topics: bootstrap4, laravel5, mysql, php, redis, scss, socket-io, straw-polls, vuejs2
- Language: PHP
- Homepage:
- Size: 49.9 MB
- Stars: 4
- Watchers: 2
- Forks: 2
- Open Issues: 11
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
## Attention!
This project is a great example how to NOT write web applications due to shamless mixing business logic with the domain layer. It needs major code refactoring. I started this project when I was still learning how to program. I will rewrite this project in the future if I have more free time.If you are a recruiter I encourage you to take a look at my other projects such as: rocketcontent, web-scraper, plagiarism-checker.
## Screenshots
![Example straw poll](https://raw.githubusercontent.com/Arturek1/cdn/master/sc2.PNG)
![Main page](https://raw.githubusercontent.com/Arturek1/cdn/master/sc1.PNG)
## Installation
sudo rm composer.lock
composer install
sudo chown -R www-data:www-data /path/to/your/laravel/root/directory
sudo chown -R www-data.www-data /var/www/travel_list/storage
sudo chown -R www-data.www-data /var/www/travel_list/bootstrap/cache
sudo chgrp -R www-data storage bootstrap/cache
sudo chmod -R ug+rwx storage bootstrap/cache
npm run prod
sudo apt-get redis && sudo apt-get redis-server
npm install --save socket.io-client
laravel-echo-server init
laravel-echo-server install
php artisan queue:listen --tries=1
crontab -e * * * * * * cd /var/www/polls && php artisan schedule:run >> /dev/null 2>&1
php artisan migrate --seed
php artisan wink:install
Create two wink posts with the following slugs: privacy-policy, terms-of-use, contactIf something goes wrong try: php artisan optimize
If you get ``proc_open(): fork failed - Cannot allocate memory`` during composer installation execute:
sudo /bin/dd if=/dev/zero of=/var/swap.1 bs=1M count=1024 && sudo /sbin/mkswap /var/swap.1 && sudo /sbin/swapon /var/swap.1
## Nginx configuration
HTTP
server {
listen 80;
server_name server_domain_or_IP;
root /var/www/travel_list/public;
add_header X-Frame-Options "SAMEORIGIN";
add_header X-XSS-Protection "1; mode=block";
add_header X-Content-Type-Options "nosniff";
index index.html index.htm index.php;charset utf-8;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location /socket.io {
proxy_pass http://localhost:6001; #could be localhost if Echo and NginX are on the same box
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
}location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }error_page 404 /index.php;
location ~ \.php$ {
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
include fastcgi_params;
}location ~ /\.(?!well-known).* {
deny all;
}
}HTTPS certificate
server {
listen 443 ssl;
ssl_certificate /etc/letsencrypt/live/chickenpoll.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/chickenpoll.com/privkey.pem; #
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
server_name www.chickenpoll.com;
return 301 https://chickenpoll.com$request_uri;
}
server {
server_name chickenpoll.com;
root /var/www/polls/public;
add_header X-Frame-Options "SAMEORIGIN";
add_header X-XSS-Protection "1; mode=block";
add_header X-Content-Type-Options "nosniff";
index index.html index.htm index.php;
charset utf-8;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location /socket.io {
proxy_pass http://localhost:6001; #could be localhost if Echo and NginX are on the same box
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
}
location = /favicon.ico {
access_log off; log_not_found off;
}
location = /robots.txt {
access_log off; log_not_found off;
}
error_page 404 /index.php;
location ~ \.php$ {
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
include fastcgi_params;
}
location ~ /\.(?!well-known).* {
deny all;
}
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/chickenpoll.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/chickenpoll.com/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
server {
if ($host = www.chickenpoll.com) {
return 301 https://$host$request_uri;
} # managed by Certbot
if ($host = chickenpoll.com) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80;
server_name www.chickenpoll.com chickenpoll.com;
return 404; # managed by Certbot
}