symfony 2 REST and JS (ember.js) client - symfony

I made a simple REST API bundle with Symfony 2 and now i want to use ember.js as a client.
I made a new bundle for it (ClientBundle). Where should i put the js files? Into
the ClientBundle/Resources folder under public/js?
app/web under public folder
somewhere else
what is the best practice / your favourite folder structure?

The best practice is to put the client code into a separate repository and use JS specific tools for its development.
Just because you can put them into a single repository doesn't mean you should. Imagine what a mess that repository will become if/when you add other clients like Android, iOS, and so on.

We put the client JS under Bundle/Resources/public/ and have a separate frontend and backend bundle. We just published a sample distro to show how this is organized here:
https://github.com/ucsf-ckm/symfony-emberjs-edition

Currently the answer would be to store the assets in the /web directory. Source

If you intend the ClientBundle to be reusable across different projects you may have, you are best served by placing the files into the ClientBundle\Resources\public\js folder.

Related

Is there a way to connect to the DAM repository without using REST API?

I am writing an external Java app to connect to the Magnolia CMS to allow my external application to push/pull assets into the repository.
Repository repository = JcrUtils.getRepository(URI);
What should the URI be? Assume that magnoliaAuthor is accessible on http://localhost:8080/magnoliaAuthor
I assume you try to fetch content outside of JCR, then you should take the Resource files app as an example since it renders content outside of JCR as well.
https://documentation.magnolia-cms.com/display/DOCS61/Resource+Files+app
If not, please let me know where that utility class come from. I cannot find it in the codebase.
Cheers,
Hope that helps,

Where to place non-app assets in a Meteor project to avoid bundling?

Per the Meteor docs, I'm trying to determine which special folder to place non-app assets (ex. Photoshop design PSDs) in, so that they still get checked into source control but don't get wrapped into the eventual client or server payloads.
It feels 'wrong' to use tests/ for this purpose but the docs suggest it has the desired behavior. Can private/ be used similarly, or will its contents always get added to the server bundle regardless of whether your app code registers any Assets? (Or is there a better place altogether to put such files?)
Consider a project structure like this:
/YourMeteorProject
/YourPSDFiles
file1.psd
file2.psd
...
/YourMeteorApp
/.meteor
/client
/server
...
You can launch your meteor app from within /YourMeteorApp. Files that are not part of your application, such as your PSD files, are kept outside of the application.

vaadin external javascript file location

I've got several javascript files.
I want to import it on my page, created using vaadin.
I added annotation #JavaScript to my UI.
#JavaScript({ "prettify.js", "vkbeautify.js", "additional.js" })
I put it into VAADIN\themes\theme-name.
However when I try to run it
WARNING: prettify.js published by com.folder.ui.AdminUi not found. Verify that the file com/folder/ui/prettify.js is available on the classpath.
Where I should put it?
It depends.
For maven based projects, the script files belong under the resource folder.
Example: src/main/resources/com/folder/ui
For Ivy/Eclipse based projects, the scripts go in the same path as your class src/main/java/com/folder/ui
The maven based projects generally mess people up because all Vaadin docs are written for Ivy.
Hope this helps,
Malcolm

Symfony 2 : Best practices

I would like to have a return on your experience concerning Symfony 2 projects :
Has anyone experience putting all of the projects inside the same enveloppe (each project is a bundle for example). why is it bad ?
Another solution : put the vendor folder somewhere on the server and point to it in all Symfony 2 projects (that means there is no vendor folder in the projects). What do you think about that ?
Thank you
Answer 1
It is bad because you will have a single config for each project, so a single database user etc. Not to mention best practises. There is nothing stopping you doing this, but it has bad news written all over it.
Answer 2
If you put the vendor folder somewhere else on the server you will not be able to have different versions of external libraries per project, which is actually important.
If you have common services that more than one project use then I would consider setting up APIs for each services so other projects can access it. OR you could import that bundle.

Windows symbolic link ASP.NET app repository

We are hosting huge app for our cutomers. There are diffrent configuration and contents (images, user files). But the core code, directories structure, databse scheme is this same for every client.
I'm looking for a way to create one core code repository, so all clientes will use it. We do updates often, so this will make our live easyer.
The idea is to create the repo and In clients directories create just symbolic links to that repo direcories: bin, App_Resources, Css, SystemImages etc.
Is this a good idea? Will ASP.NET MVC app handle this correctly, or I've to add some code for it handle the 'virtual direcotories'?
I would suggest that you take a look Single-tenant and Multi-tenant applications even if you say that your code base is the same for every one.
Here is a nice Multi-Tenancy ASP.NET example
I would also suggest that you check http://appHarbour.com as you can easily push changes from your master repository to appHarbour using Git or Mercurial.
Regarding your exact question, I also keep static files in a custom scheme under Amazon S3, so each client can upload there own files, plus the ones I have and all is based on a single location that does not put more resources just to delivery static files.
You can see my live web application using this technique checking the View Source.

Resources