<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Proposal on Janik von Rotz</title>
    <link>https://janikvonrotz.ch/tags/proposal/</link>
    <description>Recent content in Proposal on Janik von Rotz</description>
    <generator>Hugo</generator>
    <language>en</language>
    <lastBuildDate>Tue, 28 Mar 2017 16:20:06 +0000</lastBuildDate>
    <atom:link href="https://janikvonrotz.ch/tags/proposal/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Meteor project structure</title>
      <link>https://janikvonrotz.ch/2017/03/28/meteor-project-structure/</link>
      <pubDate>Tue, 28 Mar 2017 16:20:06 +0000</pubDate>
      <guid>https://janikvonrotz.ch/2017/03/28/meteor-project-structure/</guid>
      <description>&lt;p&gt;Get the latest version of this specification here: &lt;a href=&#34;https://gist.github.com/d4755eb1b7a9d6b08515408ea6fd69bb&#34;&gt;https://gist.github.com/d4755eb1b7a9d6b08515408ea6fd69bb&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;The Meteor project structure (MPS) is a proposal for a simple file and folder naming specification.&lt;/p&gt;&#xA;&lt;p&gt;There are several basic distinctions when building a Meteor project structure. First there is a &lt;strong&gt;client&lt;/strong&gt;, &lt;strong&gt;server&lt;/strong&gt; and an &lt;strong&gt;imports&lt;/strong&gt; folder. All folders have specific naming rules and differ in their structure.&lt;/p&gt;&#xA;&lt;p&gt;Global restrictions are applied to all folders:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Non-npm-package-import sources are always &lt;code&gt;index.js&lt;/code&gt; files.&lt;/li&gt;&#xA;&lt;li&gt;Every first-level subfolder contains an &lt;code&gt;index.js&lt;/code&gt; file.&lt;/li&gt;&#xA;&lt;li&gt;A subfolder depth of three is the limit.&lt;/li&gt;&#xA;&lt;li&gt;Everything which is not defined in this guide must be according to the &lt;a href=&#34;https://guide.meteor.com/code-style.html&#34;&gt;Meteor code style guide&lt;/a&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Important paradigms:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Modularity is key when designing a structure.&lt;/li&gt;&#xA;&lt;li&gt;A module is a namespace reserved for an entity.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Requirements:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;UI: React&lt;/li&gt;&#xA;&lt;li&gt;Local state: Redux&lt;/li&gt;&#xA;&lt;li&gt;Remote state: Meteor publications&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;client&#34;&gt;client&lt;/h2&gt;&#xA;&lt;p&gt;Restrictions:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Component file names are PascalCase.&lt;/li&gt;&#xA;&lt;li&gt;Folder and module names are lower case.&lt;/li&gt;&#xA;&lt;li&gt;CSS files can be placed anywhere.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Folders and files:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;actions/&lt;/code&gt; Redux methods to dispatch actions.&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;core.js&lt;/code&gt; Application actions.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;[modules].js&lt;/code&gt; Module actions.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;core/&lt;/code&gt; App react components.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;main.js&lt;/code&gt; Client startup.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;main.html&lt;/code&gt; Contains the render target for the react-dom mount and static header tags.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;MainLayout.js&lt;/code&gt; Is the main template of the app.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;[modules]/&lt;/code&gt; Module react components.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;reducers/&lt;/code&gt; Redux state reducers.&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;[state].js&lt;/code&gt; Filename is equal to the state name.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;users/&lt;/code&gt; User react components.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;React component naming:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;[Entity].js&lt;/code&gt; Single entity react component.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;[Entity]List.js&lt;/code&gt; React list view component.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;[Entity]Search.js&lt;/code&gt; React search form component.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;[Entity][Suffix]Container.js&lt;/code&gt; React component container.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;imports&#34;&gt;imports&lt;/h2&gt;&#xA;&lt;p&gt;Folders and files:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;collections/&lt;/code&gt; Mongo collections.&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;[Modules].js&lt;/code&gt; Collection definitions.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;schemas/&lt;/code&gt; Schemas.&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;[Module].js&lt;/code&gt; Schema definitions.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;helpers/&lt;/code&gt; Helper functions for client and server.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;translations/&lt;/code&gt; Translation sets.&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;[language].js&lt;/code&gt; Contains a translated language set.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;server&#34;&gt;server&lt;/h2&gt;&#xA;&lt;p&gt;Server restrictions:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Folder and module names are lower case.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Folders and files:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;actions/&lt;/code&gt; Server only methods.&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;[modules].js&lt;/code&gt; Module specific actions.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;methods/&lt;/code&gt; Meteor methods.&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;[modules].js&lt;/code&gt; Module Meteor methods.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;pubication/s&lt;/code&gt; Meteor publications.&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;[modules].js&lt;/code&gt; Module Meteor publications.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;main.js&lt;/code&gt; Server startup.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;seeds.js&lt;/code&gt; Contains database seed sets.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;accounts.js&lt;/code&gt; User account configurations.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Publications and methods naming:&lt;/p&gt;&#xA;&lt;p&gt;Component -&amp;gt; Publication&lt;br&gt;&#xA;&lt;code&gt;PostList&lt;/code&gt; -&amp;gt; &lt;code&gt;posts.list&lt;/code&gt;&lt;br&gt;&#xA;&lt;code&gt;Post&lt;/code&gt; -&amp;gt; &lt;code&gt;posts.item&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Action -&amp;gt; Method&lt;br&gt;&#xA;&lt;code&gt;Update post&lt;/code&gt; -&amp;gt; &lt;code&gt;posts.update&lt;/code&gt;&lt;br&gt;&#xA;&lt;code&gt;Remove post&lt;/code&gt; -&amp;gt; &lt;code&gt;posts.remove&lt;/code&gt;&lt;br&gt;&#xA;&lt;code&gt;Insert post&lt;/code&gt; -&amp;gt; &lt;code&gt;posts.insert&lt;/code&gt;&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
