Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,16 @@ services:
ports:
# change database:port here (edit left-one)
- "10000:80"

node:
container_name: Node
build:
context: ./..
dockerfile: ./.docker/node/Dockerfile
working_dir: /srv
volumes:
- ./../:/srv:delegated
ports:
- "8080:8080"
- "8888:8888"
command: [ "tail", "-f", "/dev/null" ]
15 changes: 15 additions & 0 deletions .docker/node/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM node:18.0.0-alpine3.14

USER root

# Setup user docker
# RUN adduser -S docker

WORKDIR /srv/

# RUN rm -rf /srv/node_modules
# RUN mkdir /srv/node_modules
# RUN chown -R docker /srv/node_modules
# RUN chown docker /srv/package.json

# USER docker
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
.idea
config/local.neon
vendor
package-lock.json
node_modules
www/dist/*
11 changes: 10 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,13 @@ start:

fix:
# phpstan -l (level 0-9, max - newest)
docker-compose -f .docker/docker-compose.yml exec php vendor/bin/phpstan analyse app -l max
docker-compose -f .docker/docker-compose.yml exec php vendor/bin/phpstan analyse app -l max

# Exec sh on Node container
exec\:node:
docker-compose -f .docker/docker-compose.yml exec node sh;

setup:
docker-compose -f .docker/docker-compose.yml exec php composer install;
docker-compose -f .docker/docker-compose.yml exec node npm install;
make init
2 changes: 2 additions & 0 deletions app/Module/Front/Homepage/templates/defaultSlider.latte
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,5 @@
</div>
</div>
</div>

<test />
8 changes: 8 additions & 0 deletions app/Module/templates/@layout.latte
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,14 @@
{include meta}

<title>{ifset title}{include title|stripHtml} - {/ifset}Filmátor</title>

{* JS files *}
<script type="application/javascript" src="{webpack dist/runtime.js}"></script>
<script type="application/javascript" src="{webpack dist/main.js}"></script>
</head>
<body>
<div id="vue-mount">

<div class="page-wrap page-wrap--light">
{include flashMessage}

Expand All @@ -39,6 +45,8 @@
{/if}
</div>

</div>

<!-- scripts -->
<div class="script">
<script src="https://nette.github.io/resources/js/3/netteForms.min.js"></script>
Expand Down
5 changes: 5 additions & 0 deletions app/components/test.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<template>
<div>
<h1>hello</h1>
</div>
</template>
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
"nettrine/fixtures": "^0.6.2",
"nettrine/cache": "^0.3.0",
"nextras/mail-panel": "^2.6",
"phpstan/phpstan": "^1.9"
"phpstan/phpstan": "^1.9",
"contributte/webpack": "^2.2"
},
"require-dev": {
"nette/tester": "^2.3",
Expand Down
79 changes: 78 additions & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

49 changes: 6 additions & 43 deletions config/common.neon
Original file line number Diff line number Diff line change
@@ -1,63 +1,26 @@
# Main configuration file, has to include every other file

parameters:
doctrine:
host: mariadb
user: root
password: root
dbname: filmator


application:
errorPresenter: Ghost:Error
mapping:
*: [App\Module, * ,*\*Presenter]


session:
expiration: 14 days


di:
export:
parameters: no
tags: no


extensions:
console: Contributte\Console\DI\ConsoleExtension(%consoleMode%)
doctrine.annotations: Nettrine\Annotations\DI\AnnotationsExtension
doctrine.dbal: Nettrine\DBAL\DI\DbalExtension
doctrine.dbal.console: Nettrine\DBAL\DI\DbalConsoleExtension
doctrine.orm: Nettrine\ORM\DI\OrmExtension
doctrine.orm.annotations: Nettrine\ORM\DI\OrmAnnotationsExtension
nettrine.orm.attributes: Nettrine\ORM\DI\OrmAttributesExtension
doctrine.orm.console: Nettrine\ORM\DI\OrmConsoleExtension
doctrine.cache: Nettrine\Cache\DI\CacheExtension
doctrine.migrations: Nettrine\Migrations\DI\MigrationsExtension
doctrine.fixtures: Nettrine\Fixtures\DI\FixturesExtension


doctrine.dbal:
debug:
panel: false
connection:
driver: pdo_mysql
host: %doctrine.host%
user: %doctrine.user%
password: %doctrine.password%
dbname: %doctrine.dbname%

doctrine.orm.annotations:
mapping:
App\Model: %appDir%/Model


nettrine.orm.attributes:
mapping:
App\Model: %appDir%/Model

doctrine.migrations:
directory: migrations/

doctrine.fixtures:
paths:
- %appDir%/Model/Database/Fixture
includes:
- extensions.neon
- doctrine.neon
- webpack.neon
26 changes: 26 additions & 0 deletions config/doctrine.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
doctrine.dbal:
debug:
panel: false
connection:
driver: pdo_mysql
host: %doctrine.host%
user: %doctrine.user%
password: %doctrine.password%
dbname: %doctrine.dbname%

# enable annotations
doctrine.orm.annotations:
mapping:
App\Model: %appDir%/Model

# enable attributes
nettrine.orm.attributes:
mapping:
App\Model: %appDir%/Model

doctrine.migrations:
directory: migrations/

doctrine.fixtures:
paths:
- %appDir%/Model/Database/Fixture
15 changes: 15 additions & 0 deletions config/extensions.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
extensions:
console: Contributte\Console\DI\ConsoleExtension(%consoleMode%)
# doctrine
doctrine.annotations: Nettrine\Annotations\DI\AnnotationsExtension
doctrine.dbal: Nettrine\DBAL\DI\DbalExtension
doctrine.dbal.console: Nettrine\DBAL\DI\DbalConsoleExtension
doctrine.orm: Nettrine\ORM\DI\OrmExtension
doctrine.orm.annotations: Nettrine\ORM\DI\OrmAnnotationsExtension
nettrine.orm.attributes: Nettrine\ORM\DI\OrmAttributesExtension
doctrine.orm.console: Nettrine\ORM\DI\OrmConsoleExtension
doctrine.cache: Nettrine\Cache\DI\CacheExtension
doctrine.migrations: Nettrine\Migrations\DI\MigrationsExtension
doctrine.fixtures: Nettrine\Fixtures\DI\FixturesExtension
# webpack
webpack: Contributte\Webpack\DI\WebpackExtension(%debugMode%, %consoleMode%)
9 changes: 9 additions & 0 deletions config/webpack.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
webpack:
build:
directory: %wwwDir%/dist
publicPath: /dist
devServer:
enabled: %debugMode%
url: http://localhost:90/dist
manifest:
name: manifest.json
29 changes: 29 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"name": "filmator",
"version": "1.0.0",
"description": "movie & serial database",
"main": "index.js",
"scripts": {
"dev-server": "encore dev-server --host localhost --port 90",
"dev": "encore dev",
"watch": "encore dev --watch",
"build": "encore production --progress"
},
"repository": {
"type": "git",
"url": "git+https://github.com/Chrynn/Filmator.git"
},
"author": "filip machala",
"license": "ISC",
"bugs": {
"url": "https://github.com/Chrynn/Filmator/issues"
},
"homepage": "https://github.com/Chrynn/Filmator#readme",
"dependencies": {
"@symfony/webpack-encore": "^4.3.0",
"vue": "^3.3.4",
"vue-loader": "^17.1.1",
"webpack-cli": "^5.1.1",
"webpack-notifier": "^1.15.0"
}
}
30 changes: 30 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
const Encore = require('@symfony/webpack-encore');

if (!Encore.isRuntimeEnvironmentConfigured()) {
Encore.configureRuntimeEnvironment(process.env.NODE_ENV || "dev");
}

Encore
// where webpack files are generated
.setOutputPath('./www/dist')
// where webpack generated files are placed to use by webpack
.setPublicPath('/dist')
// where Vue config file is
.addEntry('main', './www/js/main.js')
.enableSingleRuntimeChunk()
.cleanupOutputBeforeBuild()
.enableBuildNotifications()
.enableSourceMaps(!Encore.isProduction())
.enableVersioning(Encore.isProduction())
.enableVueLoader(() => {}, { runtimeCompilerBuild: true })
// setting manifest files 1 folder back
.configureManifestPlugin(options => {
options.publicPath = '';
})
.configureDevServerOptions(options => {
options.port = 90;
options.allowedHosts = 'all';
})
;

module.exports = Encore.getWebpackConfig();
10 changes: 10 additions & 0 deletions www/js/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import {createApp} from 'vue/dist/vue.esm-bundler';
import Test from '../../app/components/test.vue';

document.addEventListener('VueMount', (e) => {
const app = createApp({});

app.component('test', Test);

app.mount('#app');
});