Skip to content

Commit c0de2f5

Browse files
committed
Init
0 parents  commit c0de2f5

File tree

164 files changed

+9055
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

164 files changed

+9055
-0
lines changed

.dockerignore

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
node_modules
2+
vendor
3+
public/build
4+
public/hot
5+
6+
# Environment variables
7+
.env
8+
.env.example
9+
10+
# Dockerfiles
11+
.dockerignore
12+
docker-compose.production.yml
13+
docker-compose.test.yml
14+
docker-compose.yml
15+
Dockerfile
16+
Dockerfile.test
17+
Dockerfile.production
18+
19+
supervisord.dev.conf
20+
.onedev-buildspec.yml
21+
.editorconfig

.editorconfig

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
indent_size = 4
7+
indent_style = space
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
[*.md]
12+
trim_trailing_whitespace = false
13+
14+
[*.{yml,yaml}]
15+
indent_size = 2
16+
17+
[docker-compose.yml]
18+
indent_size = 4

.env-example

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
APP_NAME="PicoLink"
2+
APP_SLUG="pico-link"
3+
APP_ENV=local
4+
APP_KEY=
5+
APP_DEBUG=true
6+
APP_URL=http://localhost
7+
8+
DB_CONNECTION=mysql
9+
DB_HOST=mysql
10+
DB_PORT=3306
11+
DB_DATABASE=laravel
12+
DB_USERNAME=sail
13+
DB_PASSWORD=password
14+
15+
ADMIN_USERNAME="admin"
16+
ADMIN_PASSWORD="password"

.gitattributes

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
* text=auto eol=lf
2+
3+
*.blade.php diff=html
4+
*.css diff=css
5+
*.html diff=html
6+
*.md diff=markdown
7+
*.php diff=php
8+
9+
/.github export-ignore
10+
CHANGELOG.md export-ignore
11+
.styleci.yml export-ignore

.github/workflows/docker-publish.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: Docker
2+
3+
# This workflow uses actions that are not certified by GitHub.
4+
# They are provided by a third-party and are governed by
5+
# separate terms of service, privacy policy, and support
6+
# documentation.
7+
8+
on:
9+
push:
10+
branches: [ "master" ]
11+
# Publish semver tags as releases.
12+
tags: [ 'v*.*.*' ]
13+
pull_request:
14+
branches: [ "*" ]
15+
16+
env:
17+
# Use docker.io for Docker Hub if empty
18+
REGISTRY: ghcr.io
19+
# github.repository as <account>/<repo>
20+
IMAGE_NAME: ${{ github.repository }}
21+
22+
23+
jobs:
24+
build:
25+
26+
runs-on: ubuntu-latest
27+
permissions:
28+
contents: read
29+
packages: write
30+
# This is used to complete the identity challenge
31+
# with sigstore/fulcio when running outside of PRs.
32+
id-token: write
33+
34+
steps:
35+
- name: Checkout repository
36+
uses: actions/checkout@v4.0.0
37+
38+
39+
# Workaround: https://github.com/docker/build-push-action/issues/461
40+
- name: Setup Docker buildx
41+
uses: docker/setup-buildx-action@v3.0.0
42+
43+
# Login against a Docker registry except on PR
44+
# https://github.com/docker/login-action
45+
- name: Log into registry ${{ env.REGISTRY }}
46+
if: github.event_name != 'pull_request'
47+
uses: docker/login-action@v3.0.0
48+
with:
49+
registry: ${{ env.REGISTRY }}
50+
username: ${{ github.actor }}
51+
password: ${{ secrets.GITHUB_TOKEN }}
52+
53+
# Extract metadata (tags, labels) for Docker
54+
# https://github.com/docker/metadata-action
55+
- name: Extract Docker metadata
56+
id: meta
57+
uses: docker/metadata-action@v5.0.0
58+
with:
59+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
60+
61+
# Build and push Docker image with Buildx (don't push on PR)
62+
# https://github.com/docker/build-push-action
63+
- name: Build and push Docker image
64+
id: build-and-push
65+
uses: docker/build-push-action@v5.0.0
66+
with:
67+
context: .
68+
push: ${{ github.event_name != 'pull_request' }}
69+
tags: ${{ steps.meta.outputs.tags }}
70+
labels: ${{ steps.meta.outputs.labels }}
71+
cache-from: type=gha
72+
cache-to: type=gha,mode=max

.gitignore

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/.phpunit.cache
2+
/node_modules
3+
/public/build
4+
/public/hot
5+
/public/storage
6+
/storage/*.key
7+
/vendor
8+
.env
9+
.env.backup
10+
.phpunit.result.cache
11+
Homestead.json
12+
Homestead.yaml
13+
auth.json
14+
npm-debug.log
15+
yarn-error.log
16+
/.fleet
17+
/.idea
18+
/.vscode
19+
composer.lock
20+
package-lock.json

Dockerfile

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
FROM rockylinux:9.2 as build
2+
EXPOSE 80
3+
4+
# Installazione pacchetti principali
5+
RUN dnf update -y \
6+
&& dnf install npm nodejs ncurses unzip wget procps nano -y \
7+
&& dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm -y \
8+
&& dnf install https://rpms.remirepo.net/enterprise/remi-release-9.rpm -y \
9+
&& dnf update -y \
10+
&& dnf module install php:remi-8.2 -y \
11+
&& dnf install \
12+
php-pgsql php-gd php-imap php-mysql \
13+
php-zip php-bcmath php-soap php-intl php-ldap \
14+
php-msgpack php-igbinary php-redis \
15+
php-memcached php-pcov php-xdebug -y \
16+
&& dnf install supervisor -y
17+
RUN dnf install php-swoole --nobest -y
18+
RUN mkdir -p /run/php-fpm/
19+
20+
RUN curl https://getmic.ro | bash && mv micro /usr/bin/
21+
22+
# Installazione di Apache Web Server
23+
RUN dnf install httpd httpd-tools -y
24+
25+
# Installazione di composer
26+
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
27+
28+
WORKDIR /root/docker
29+
30+
# Copia della repo
31+
COPY . /root/docker
32+
33+
# Installazione librerie composer e npm
34+
RUN composer install --optimize-autoloader --no-dev \
35+
&& npm install \
36+
&& npm run build
37+
38+
COPY httpd.conf /etc/httpd/conf/
39+
COPY php.ini /etc/php.ini
40+
RUN cp -R /root/docker/. /var/www/html
41+
RUN chown -R apache:apache /var/www/html
42+
43+
COPY supervisord.production.conf /etc/supervisord.conf
44+
45+
WORKDIR /var/www/html
46+
CMD ["supervisord"]

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
#PicoLink

app/Classes/Help.php

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<?php
2+
3+
4+
namespace App\Classes;
5+
6+
use Illuminate\Support\Str;
7+
8+
9+
class Help
10+
{
11+
public static function convert_date(string $date):string{
12+
return implode("-", array_reverse(explode("/", $date)));
13+
}
14+
15+
public static function fragment(string $view, string $fragment, array $data = []):string{
16+
return view($view, $data)->fragment($fragment);
17+
}
18+
19+
public static function strToLen(?string $str, int $len, bool $left = false){
20+
$str = $str ?? "";
21+
22+
if(strlen($str) >= $len){
23+
return Str::limit($str, $len, '');
24+
}
25+
26+
return !$left ? Str::padRight($str, $len, " ") : Str::padLeft($str, $len, " ");
27+
}
28+
29+
public static function euid(int $lenght){
30+
$time = time();
31+
$base_36 = base_convert($time , 10, 36);
32+
$randomize_id = $base_36.Str::random($lenght - Str::length($base_36));
33+
34+
return $randomize_id;
35+
}
36+
37+
public static function format_number($number, $is_price = false){
38+
return number_format($number, 2, ',', '.').($is_price ? "" : "");
39+
}
40+
41+
public static function empty_dictionary($dictionary){
42+
foreach($dictionary as $key => $value){
43+
if(!empty($value)) return false;
44+
}
45+
46+
return true;
47+
}
48+
}

app/Console/Kernel.php

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?php
2+
3+
namespace App\Console;
4+
5+
use Illuminate\Console\Scheduling\Schedule;
6+
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
7+
8+
class Kernel extends ConsoleKernel
9+
{
10+
/**
11+
* Define the application's command schedule.
12+
*/
13+
protected function schedule(Schedule $schedule): void
14+
{
15+
// $schedule->command('inspire')->hourly();
16+
}
17+
18+
/**
19+
* Register the commands for the application.
20+
*/
21+
protected function commands(): void
22+
{
23+
$this->load(__DIR__.'/Commands');
24+
25+
require base_path('routes/console.php');
26+
}
27+
}

0 commit comments

Comments
 (0)