Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Customizing server/client/public directories

Received: by 10.236.185.226 with SMTP id u62mr3759981yhm.3.1345228253834;
        Fri, 17 Aug 2012 11:30:53 -0700 (PDT)
X-BeenThere: meteor-talk@googlegroups.com
Received: by 10.236.124.176 with SMTP id x36ls9645805yhh.1.gmail; Fri, 17 Aug
 2012 11:30:53 -0700 (PDT)
Received: by 10.236.173.202 with SMTP id v50mr3548349yhl.8.1345228253216;
        Fri, 17 Aug 2012 11:30:53 -0700 (PDT)
Received: by 10.236.173.202 with SMTP id v50mr3548346yhl.8.1345228253190;
        Fri, 17 Aug 2012 11:30:53 -0700 (PDT)
Return-Path: <luckysm...@gmail.com>
Received: from mail-yw0-f48.google.com (mail-yw0-f48.google.com [209.85.213.48])
        by gmr-mx.google.com with ESMTPS id i27si2260460yhe.4.2012.08.17.11.30.53
        (version=TLSv1/SSLv3 cipher=OTHER);
        Fri, 17 Aug 2012 11:30:53 -0700 (PDT)
Received-SPF: pass (google.com: domain of luckysm...@gmail.com designates 209.85.213.48 as permitted sender) client-ip=209.85.213.48;
Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of luckysm...@gmail.com designates 209.85.213.48 as permitted sender) smtp.mail=luckysm...@gmail.com; dkim=pass header...@gmail.com
Received: by yhfq46 with SMTP id q46so4611642yhf.7
        for <meteor-talk@googlegroups.com>; Fri, 17 Aug 2012 11:30:53 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=mime-version:in-reply-to:references:from:date:message-id:subject:to
         :content-type;
        bh=E1/3pCGqIWoYRbgGMCtg6cn5fefIMhH5Poo8dnEv9q8=;
        b=ao/RnKBaSqujMaAk6n411Quyb6YZo5aOr9tAaxMalLwcMcBNt1L4FWV3TLQX0ozp2O
         NVYZMLLreEjb+7OhwaF8J52PYSlh/5rZ0l84+pV1y6DMTkZotiv8vcY9AK6f67jyQlpx
         y7pyvCI2S6GBqJqWC4YBiM4DPZvB+5s0jwzdv6NpLXWRZhrFkPBnd2ua8V5sEa8K4klY
         ljEfRpvZr46i7oNqKt6usaitjMav76cQMMC+Mbd2zkthnW+Fhwi2vxkMBtn41AYlbIVu
         xPxQOl0B3xvO13cVdFzvhb+FKEEL5rbuALw7bVYhcICeu6ED5ATdOL6pya7kW1uNIqOc
         rdgw==
Received: by 10.50.160.130 with SMTP id xk2mr2848009igb.66.1345228252903; Fri,
 17 Aug 2012 11:30:52 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.50.149.226 with HTTP; Fri, 17 Aug 2012 11:30:32 -0700 (PDT)
In-Reply-To: <C15DE138-AC47-477B-84F4-F007921FD...@shigeoka.com>
References: <1efe4f69-9667-4158-ae08-e86b4b149b68@googlegroups.com>
 <83034140-35EC-484E-9594-35711A2D9...@shigeoka.com> <CABGXpVyn-3ma=y46oYuPw57WkSPgAVv_m=DxusLbSunbMqq...@mail.gmail.com>
 <C15DE138-AC47-477B-84F4-F007921FD...@shigeoka.com>
From: Shawn McElroy <luckysm...@gmail.com>
Date: Fri, 17 Aug 2012 11:30:32 -0700
Message-ID: <CABGXpVwgYgcoK4cJNyE_VsBQ6+HZ8qVPs3ZtnxfmjAmUajs...@mail.gmail.com>
Subject: Re: [meteor-talk] Customizing server/client/public directories
To: meteor-talk@googlegroups.com
Content-Type: multipart/alternative; boundary=14dae934113727f8db04c77a5ccf

--14dae934113727f8db04c77a5ccf
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: quoted-printable

Yea it makes sense now. It just so different than what I'm used to. Where
models are where a lot of the core app functionality which, if the end user
could see, could allow them to easily copy your code which you would not
want. But here the model is exposed. But since the focus on meteor is
having a local client db to make the site appear real time, it makes sense
to me. so here in the models I would only have the minimal code needed for
the app to function properly.

Which begs the question, for code I dont want end users to see that I would
normally have in a model, or a controller, where would I put that? For
controllers and what I am used to, the controllers handle all the
communication between model and view. the model validates and returns the
dataset, and the controller, if needed, preps the data to be available in
the view. The way meteor works, I would need that kind of info on both
client and server as well. Which I would probable end up all just putting
into the models here.

So for code I dont want end users to see I would put it in the lib or
server directories. but short of server side validation and maybe some
schema definitions, or server/app configs, I dont see a lot else I would
put in there. I just want to be able to prevent users from being able to
capture code and being able to use it (for proprietary apps, which I would
make at my job). While I love the idea of meteor and how it works, it so
far, seems to me that the vast majority of your application code is visible
to the end user. Granted it is all minified/obfuscated which makes it more
difficult. Just for the apps I make at my job, code security is of high
importance. And for those kinds of apps, meteor may not be as much as a fit
as I need it to be.

On Fri, Aug 17, 2012 at 11:01 AM, Iain Shigeoka <i...@shigeoka.com> wrote:

>
> On Aug 17, 2012, at 7:30 AM, Shawn McElroy <luckysm...@gmail.com> wrote:
>
> > Ok yea that helps, But based on his example, would the models/ director=
y
> not be accessible to the client?
>
> It would be accessible to both client and server. Think of the rules as;
> meteor walks the directory tree with a sticky "publish mode" that it sets
> as a flag for each directory (and it's contents)  - by default it's in
> client/server mode - everything it sees is published to both the client a=
nd
> server. If it gets to a directory that is named 'client' or 'server' it
> goes into the appropriate mode and only sends the files it finds in that
> directory. All directories below that directory will get the same "stick"
> mode unless a directory name sets a new mode. The only exception is if it
> sees a directory named 'lib' - it will include those into the web page
> ahead of other javascript files it finds ('lib' directories allow you to
> prioritize some libraries to be loaded before others - you will tend to p=
ut
> core dependencies there like third party libraries or your base javascrip=
t
> files).
>
> > Wouldnt I want it to be in the server/ directory? Also, based on the
> fact he gives the feature-* examples, it seems that I can have more than
> one server and/or client directory correct? so:
> >
> > foo/server/
> > foo/client/
> > server/
> > bar/client/
> > baz/server/
> >
> > where all the server directories would properly only expose code to the
> server, and client/ to the client? anything outside is both.
>
> Yup, you got it. The files in the following directories in your example
> will only be available to the client:
>
> foo/client
> bar/client
> /
>
> The files in the following directories will be only available on the serv=
er
>
> foo/server
> bar/server
> /
>
> You'll find you will write some common javascript (like utility functions
> and basic data model definitions) that you'll want to include in both the
> client and the server. Rather than include them in the / directory in thi=
s
> case, it would be better to create another directory to store them. If yo=
u
> don't care when they are loaded, you could name that directory 'common' -
> if you want it loaded before the other javascript files, you would name i=
t
> 'lib'. So a good way to organize could be:
>
> foo/server/
> foo/client/
> server/
> bar/client/
> baz/server/
> lib/
>
> Yup, you got it. The files in the following directories in your example
> will only be available to the client:
>
> lib/
> foo/client
> bar/client
> /
>
> The files in the following directories will be only available on the serv=
er
>
> lib/
> foo/server
> bar/server
> server
> /
>
> Hope that helps.
>
> -iain
>
> --
> You received this message because you are subscribed to the Google Groups
> "meteor-talk" group.
> To post to this group, send email to meteor-talk@googlegroups.com.
> To unsubscribe from this group, send email to
> meteor-talk+unsubscribe@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/meteor-talk?hl=3Den.
>
>


--=20

 -- Shawn McElroy

"Anything worth doing, is worth doing right"  =97 Hunter S. Thompson

"A mind troubled by doubt cannot focus on the course to victory" =97
A<http://www.goodreads.com/author/quotes/5237.Hunter_S_Thompson>rthur
Golden

--14dae934113727f8db04c77a5ccf
Content-Type: text/html; charset=windows-1252
Content-Transfer-Encoding: quoted-printable

Yea it makes sense now. It just so different than what I&#39;m used to. Whe=
re models are where a lot of the core app functionality which, if the end u=
ser could see, could allow them to easily copy your code which you would no=
t want. But here the model is exposed. But since the focus on meteor is hav=
ing a local client db to make the site appear real time, it makes sense to =
me. so here in the models I would only have the minimal code needed for the=
 app to function properly.=A0<div>

<br></div><div>Which begs the question, for code I dont want end users to s=
ee that I would normally have in a model, or a controller, where would I pu=
t that? For controllers and what I am used to, the controllers handle all t=
he communication between model and view. the model validates and returns th=
e dataset, and the controller, if needed, preps the data to be available in=
 the view. The way meteor works, I would need that kind of info on both cli=
ent and server as well. Which I would probable end up all just putting into=
 the models here.=A0</div>

<div><br></div><div>So for code I dont want end users to see I would put it=
 in the lib or server directories. but short of server side validation and =
maybe some schema definitions, or server/app configs, I dont see a lot else=
 I would put in there. I just want to be able to prevent users from being a=
ble to capture code and being able to use it (for proprietary apps, which I=
 would make at my job). While I love the idea of meteor and how it works, i=
t so far, seems to me that the vast majority of your application code is vi=
sible to the end user. Granted it is all minified/obfuscated which makes it=
 more difficult. Just for the apps I make at my job, code security is of hi=
gh importance. And for those kinds of apps, meteor may not be as much as a =
fit as I need it to be.<br>

<br><div class=3D"gmail_quote">On Fri, Aug 17, 2012 at 11:01 AM, Iain Shige=
oka <span dir=3D"ltr">&lt;<a href=3D"mailto:i...@shigeoka.com" target=3D"_b=
lank">i...@shigeoka.com</a>&gt;</span> wrote:<br><blockquote class=3D"gmail=
_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:=
1ex">

<br>
On Aug 17, 2012, at 7:30 AM, Shawn McElroy &lt;<a href=3D"mailto:luckysmack=
@gmail.com">luckysm...@gmail.com</a>&gt; wrote:<br>
<br>
&gt; Ok yea that helps, But based on his example, would the models/ directo=
ry not be accessible to the client?<br>
<br>
It would be accessible to both client and server. Think of the rules as; me=
teor walks the directory tree with a sticky &quot;publish mode&quot; that i=
t sets as a flag for each directory (and it&#39;s contents) =A0- by default=
 it&#39;s in client/server mode - everything it sees is published to both t=
he client and server. If it gets to a directory that is named &#39;client&#=
39; or &#39;server&#39; it goes into the appropriate mode and only sends th=
e files it finds in that directory. All directories below that directory wi=
ll get the same &quot;stick&quot; mode unless a directory name sets a new m=
ode. The only exception is if it sees a directory named &#39;lib&#39; - it =
will include those into the web page ahead of other javascript files it fin=
ds (&#39;lib&#39; directories allow you to prioritize some libraries to be =
loaded before others - you will tend to put core dependencies there like th=
ird party libraries or your base javascript files).<br>


<br>
&gt; Wouldnt I want it to be in the server/ directory? Also, based on the f=
act he gives the feature-* examples, it seems that I can have more than one=
 server and/or client directory correct? so:<br>
&gt;<br>
&gt; foo/server/<br>
&gt; foo/client/<br>
&gt; server/<br>
&gt; bar/client/<br>
&gt; baz/server/<br>
&gt;<br>
&gt; where all the server directories would properly only expose code to th=
e server, and client/ to the client? anything outside is both.<br>
<br>
Yup, you got it. The files in the following directories in your example wil=
l only be available to the client:<br>
<br>
foo/client<br>
bar/client<br>
/<br>
<br>
The files in the following directories will be only available on the server=
<br>
<br>
foo/server<br>
bar/server<br>
/<br>
<br>
You&#39;ll find you will write some common javascript (like utility functio=
ns and basic data model definitions) that you&#39;ll want to include in bot=
h the client and the server. Rather than include them in the / directory in=
 this case, it would be better to create another directory to store them. I=
f you don&#39;t care when they are loaded, you could name that directory &#=
39;common&#39; - if you want it loaded before the other javascript files, y=
ou would name it &#39;lib&#39;. So a good way to organize could be:<br>


<br>
foo/server/<br>
foo/client/<br>
server/<br>
bar/client/<br>
baz/server/<br>
lib/<br>
<br>
Yup, you got it. The files in the following directories in your example wil=
l only be available to the client:<br>
<br>
lib/<br>
foo/client<br>
bar/client<br>
/<br>
<br>
The files in the following directories will be only available on the server=
<br>
<br>
lib/<br>
foo/server<br>
bar/server<br>
server<br>
/<br>
<br>
Hope that helps.<br>
<span class=3D"HOEnZb"><font color=3D"#888888"><br>
-iain<br>
<br>
--<br>
You received this message because you are subscribed to the Google Groups &=
quot;meteor-talk&quot; group.<br>
To post to this group, send email to <a href=3D"mailto:meteor-talk@googlegr=
oups.com">meteor-talk@googlegroups.com</a>.<br>
To unsubscribe from this group, send email to <a href=3D"mailto:meteor-talk=
%2Bunsubscribe@googlegroups.com">meteor-talk+unsubscribe@googlegroups.com</=
a>.<br>
For more options, visit this group at <a href=3D"http://groups.google.com/g=
roup/meteor-talk?hl=3Den" target=3D"_blank">http://groups.google.com/group/=
meteor-talk?hl=3Den</a>.<br>
<br>
</font></span></blockquote></div><br><br clear=3D"all"><div><br></div>-- <b=
r><div><br></div><div>=A0-- Shawn McElroy</div><div><br></div><div><span st=
yle=3D"color:rgb(24,24,24);font-family:georgia,serif;font-size:14px;line-he=
ight:18px">&quot;Anything worth doing, is worth doing right&quot;=A0=A0=97=
=A0Hunter S. Thompson</span></div>

<div><span style=3D"color:rgb(24,24,24);font-family:georgia,serif;font-size=
:14px;line-height:18px"><br></span></div><div><span style=3D"font-family:Ve=
rdana,Geneva,Arial,Helvetica,sans-serif;font-size:13px">&quot;A mind troubl=
ed by doubt cannot focus on the course to victory&quot;=A0</span><span styl=
e=3D"color:rgb(24,24,24);font-family:georgia,serif;font-size:14px;line-heig=
ht:18px">=97=A0<a href=3D"http://www.goodreads.com/author/quotes/5237.Hunte=
r_S_Thompson" style=3D"color:rgb(102,102,0);text-decoration:none;font-famil=
y:georgia,serif;font-size:13px" target=3D"_blank">A</a>rthur Golden</span><=
/div>

<br>
</div>

--14dae934113727f8db04c77a5ccf--