2

I am just about to build an application that will consist of a rest api for the backend which is then consumed by a vuejs application.

I would like the frontend and backend code to be in the same code repository.

I am just struggling to figure out where to put my vuejs files.

Currently my project directory structure looks like this:

/project-dir
    /app
    /bin
    /src
    /tests
    /var
    /vendor
    /web

Now do I put all the js files in /project-dir/web? Like this:

/project-dir
    /app
    /bin
    /src
    /tests
    /var
    /vendor
    /web
        /build
        /config
        /node_modules
        package.json
        /src
        /static
        /test

I feel this might be a good way to structure it but not sure if there are any downsides with doing it this way. How would you integrate vuejs and webpack into a skeleton symfony application?

1 Answer 1

6

If you build your vue.js project (and the folder web/builds/ suggests it). I would recommend keeping the rest of the code outside the web/ directory and build into it.

Other than that there is nothing speaking against your approach and it's even suggested by the current Symfony Best Practices:

Best Practice

Store your assets in the web/ directory.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.