Skip to content

Commit

Permalink
Added base skeleton for a landing page (#905)
Browse files Browse the repository at this point in the history
* Added base skeleton for a landing page

* added tailwindcss symfony bundle

* small fixes

* moved config out of kernel

* added missing dependency

* fixed namespace

* fixed NS in console app
  • Loading branch information
owsiakl authored Jan 4, 2024
1 parent 0c5cf42 commit 8cffb6f
Show file tree
Hide file tree
Showing 27 changed files with 4,161 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,8 @@ updates:
directory: "/tools/psalm"
schedule:
interval: "daily"

- package-ecosystem: "composer"
directory: "/src/web/landing"
schedule:
interval: "daily"
1 change: 1 addition & 0 deletions .php-cs-fixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
__DIR__ . '/src/adapter/**/tests',
__DIR__ . '/src/lib/**/src',
__DIR__ . '/src/lib/**/tests',
__DIR__ . '/src/web/**/src',
__DIR__ . '/examples',
]);

Expand Down
2 changes: 2 additions & 0 deletions src/web/landing/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
APP_ENV=dev
APP_SECRET=04f48bdb7d5426b4c5ba6aaf3d00a1fa
4 changes: 4 additions & 0 deletions src/web/landing/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.env.local
vendor/
var/
public/assets
46 changes: 46 additions & 0 deletions src/web/landing/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Flow PHP - Web

## Prerequisite
To run web page locally, you need to have Symfony CLI installed locally.
Instruction on how to install it can be found here: [https://symfony.com/download](https://symfony.com/download).

## Setup
Install all dependencies:
```shell
composer install
```

Create a local certificate authority for the server:
```shell
symfony server:ca:install
```

Run symfony web server:
```shell
symfony server:start --dir=public -d
```

Build assets:
```shell
bin/console tailwind:build
```

Page will be accessible from [https://127.0.0.1:8000](https://127.0.0.1:8000) url.

To stop symfony web server, execute:
```shell
symfony local:server:stop --dir=public
```

## Working with CSS using Tailwind
We strive to eliminate usage of Node and NPM in Flow PHP, so we decided to use standalone CLI executable here.
To generated CSS using Tailwind, execute:
```shell
bin/console tailwind:build
```

It'll fetch executable file and create CSS that will be served from web server.
Or if you want to keep it running in the watch mode, execute:
```shell
bin/console tailwind:build --watch
```
Binary file added src/web/landing/assets/images/banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/web/landing/assets/styles/app.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
17 changes: 17 additions & 0 deletions src/web/landing/bin/console
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env php
<?php

use Flow\Website\Kernel;
use Symfony\Bundle\FrameworkBundle\Console\Application;

if (!is_file(dirname(__DIR__).'/vendor/autoload_runtime.php')) {
throw new LogicException('Symfony Runtime is missing. Try running "composer require symfony/runtime".');
}

require_once dirname(__DIR__).'/vendor/autoload_runtime.php';

return function (array $context) {
$kernel = new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);

return new Application($kernel);
};
41 changes: 41 additions & 0 deletions src/web/landing/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"name": "flow-php/web",
"description": "Flow PHP ETL - Web",
"type": "project",
"require": {
"symfony/http-kernel": "^6.4",
"symfony/http-foundation": "^6.4",
"symfony/routing": "^6.4",
"symfony/framework-bundle": "^6.4",
"symfony/twig-bundle": "^6.4",
"symfony/asset-mapper": "^6.4",
"symfony/asset": "^6.4",
"symfony/runtime": "^6.4",
"symfony/console": "^6.4",
"symfony/yaml": "^6.4",
"symfony/dotenv": "^6.4"
},
"require-dev": {
"symfony/web-profiler-bundle": "^6.4",
"symfonycasts/tailwind-bundle": "^0.5.0",
"norberttech/static-content-generator-bundle": "1.x-dev"
},
"autoload": {
"psr-4": {
"Flow\\Website\\": "src/Flow/Website/"
}
},
"config": {
"allow-plugins": {
"symfony/runtime": true
}
},
"scripts": {
"assets:clear": "rm -rf public/assets",
"assets:build": [
"@assets:clear",
"bin/console tailwind:build",
"bin/console asset-map:compile"
]
}
}
Loading

0 comments on commit 8cffb6f

Please sign in to comment.