<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="de">
	<id>https://wiki.opencaching.de/index.php?action=history&amp;feed=atom&amp;title=Frontend_Stack</id>
	<title>Frontend Stack - Versionsgeschichte</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.opencaching.de/index.php?action=history&amp;feed=atom&amp;title=Frontend_Stack"/>
	<link rel="alternate" type="text/html" href="https://wiki.opencaching.de/index.php?title=Frontend_Stack&amp;action=history"/>
	<updated>2026-05-08T00:57:25Z</updated>
	<subtitle>Versionsgeschichte dieser Seite in Opencaching-Wiki</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://wiki.opencaching.de/index.php?title=Frontend_Stack&amp;diff=7859&amp;oldid=prev</id>
		<title>Fraggle: Erstentwurf</title>
		<link rel="alternate" type="text/html" href="https://wiki.opencaching.de/index.php?title=Frontend_Stack&amp;diff=7859&amp;oldid=prev"/>
		<updated>2024-05-06T19:05:51Z</updated>

		<summary type="html">&lt;p&gt;Erstentwurf&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Neue Seite&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Introduction ==&lt;br /&gt;
Our approach is to build the new frontend in a &amp;lt;b&amp;gt;component-oriented way&amp;lt;/b&amp;gt; (eg.: header, main, footer, cache-list, s.o.) to prevent duplicate styling and html.&lt;br /&gt;
We use &amp;lt;b&amp;gt;SCSS&amp;lt;/b&amp;gt; (a CSS preprocessor) and &amp;lt;b&amp;gt;BEM&amp;lt;/b&amp;gt; (a technique on how to structure the css classes in components) to support us by this approach.&lt;br /&gt;
To get the resulting CSS we use &amp;lt;b&amp;gt;Grunt&amp;lt;/b&amp;gt; which collects all files, compiles them from SCSS to CSS, combines and minifies them.&lt;br /&gt;
Grunt also fetches all javascript files, combines and minifies them.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We currently build the css for the frontend in two ways.&lt;br /&gt;
* via Grunt (for development purposes)&lt;br /&gt;
* via Symfony Command (&amp;lt;code&amp;gt;./bin/console cache:web:create&amp;lt;/code&amp;gt;)&lt;br /&gt;
This is done because we don&amp;#039;t want to have yarn and grunt installed on the production server.&lt;br /&gt;
We currently can&amp;#039;t restructure the deployment process to deploy from travis.&amp;lt;br /&amp;gt;&lt;br /&gt;
[[#Caveats|&amp;lt;b&amp;gt;For more details on the caveats look below.&amp;lt;/b&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Framework ==&lt;br /&gt;
The frontend framework used is &amp;lt;b&amp;gt;Bootstrap v4&amp;lt;/b&amp;gt;.&amp;lt;br /&amp;gt;&lt;br /&gt;
To prevent cluttering the frontend with col-{xs,sm,md,lg}-* and other stuff we only use the mixins provided by Bootstrap.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== File structure ==&lt;br /&gt;
Below i start describing the file structure.&lt;br /&gt;
&lt;br /&gt;
[[Image:Testumgebung FrontendStack 01.png]]&lt;br /&gt;
&lt;br /&gt;
htdocs/&amp;lt;/b&amp;gt;&lt;br /&gt;
: &amp;lt;b&amp;gt;app/Resources/&amp;lt;/b&amp;gt;&lt;br /&gt;
:: &amp;lt;b&amp;gt;scss/&amp;lt;/b&amp;gt; (all scss files of the frontend)&lt;br /&gt;
::: &amp;lt;b&amp;gt;_mixins/&amp;lt;/b&amp;gt; (custom mixins which we can use in blocks)&lt;br /&gt;
::: &amp;lt;b&amp;gt;blocks/&amp;lt;/b&amp;gt; (all blocks of the frontend)&lt;br /&gt;
:::: &amp;lt;b&amp;gt;flash-messages/&amp;lt;/b&amp;gt; (is used to group some blocks by its common denominator)&lt;br /&gt;
::::: &amp;lt;b&amp;gt;flash-messages.scss&amp;lt;/b&amp;gt; (contains the styling of the block)&lt;br /&gt;
::: &amp;lt;b&amp;gt;_global.scss&amp;lt;/b&amp;gt; (imports variables, mixins of bootstrap, our settings, custom mixins from above, and is used in all blocks)&lt;br /&gt;
::: &amp;lt;b&amp;gt;_settings.scss&amp;lt;/b&amp;gt; (holds all variables which we use in our blocks)&lt;br /&gt;
:: &amp;lt;b&amp;gt;views/&amp;lt;/b&amp;gt; (contains all twig files of the frontend used in different controllers)&lt;br /&gt;
::: &amp;lt;b&amp;gt;_components/&amp;lt;/b&amp;gt; (reflects the structure of the scss blocks and contains the equivalent twig files which should be styled)&lt;br /&gt;
:::: &amp;lt;b&amp;gt;flash-messages/&amp;lt;/b&amp;gt; (grouping as above)&lt;br /&gt;
::::: &amp;lt;b&amp;gt;flash-messages.html.twig&amp;lt;/b&amp;gt; (twig file of the component)&lt;br /&gt;
::: &amp;lt;b&amp;gt;base.html.twig&amp;lt;/b&amp;gt; (contains the base layout)&lt;br /&gt;
: &amp;lt;b&amp;gt;web/&amp;lt;/b&amp;gt; (contains the compiled css and javascript files build by grunt or symfony command)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== YARN ==&lt;br /&gt;
You can find all important things to know about Yarn on following website: https://yarnpkg.com.&amp;lt;br /&amp;gt;&lt;br /&gt;
Yarn is a different CLI client for the npm registry.&amp;lt;br /&amp;gt;&lt;br /&gt;
To read about why we use yarn instead of npm see https://www.sitepoint.com/yarn-vs-npm/.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== SCSS ==&lt;br /&gt;
You can find all important things to know about SCSS on following website: http://sass-lang.com.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== BEM ==&lt;br /&gt;
You can find all important things to know about BEM on following website: http://getbem.com.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Grunt ==&lt;br /&gt;
You can find all important things to know about Grunt on following website: https://gruntjs.com&amp;lt;br /&amp;gt;&lt;br /&gt;
The configuration file of Grunt is found here: &amp;lt;code&amp;gt;htdocs/gruntfile.js&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
It defines all steps needed to move, compile, combine, minify and uglify all stuff.&lt;br /&gt;
&lt;br /&gt;
The primary used tasks are:&lt;br /&gt;
* grunt (only build once with linting)&lt;br /&gt;
* grunt build (build once without linting)&lt;br /&gt;
* grunt watch (build and watch for file changes in a loop)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Caveats ==&lt;br /&gt;
Dependencies like Bootstrap and jQuery are currently maintained in both &amp;lt;code&amp;gt;composer.json&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;package.json&amp;lt;/code&amp;gt;.&lt;br /&gt;
Be aware that both files should contain the same version of each dependency.&lt;br /&gt;
When you develop new things for the frontend test both ways building the assets for the web folder!&lt;br /&gt;
&lt;br /&gt;
Note: The composer dependencies are only fetched from composers vendor-folder, but to keep the switch to grunt for the new deployment later easy we maintain both.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Kategorie:Entwicklung]]&lt;br /&gt;
[[Kategorie:English pages]]&lt;br /&gt;
[[Kategorie:Überarbeiten]]&lt;/div&gt;</summary>
		<author><name>Fraggle</name></author>
	</entry>
</feed>