I'm starting to get into web development a little more. Currently I use the Spark Framework along with Vue for the few apps I've made. While this certainly works it's not ideal.
The project is built with Maven (and NPM for Vue) and the build process looks something like this.
So the filesystem looks something like this
/src/main/java (Spark Framework)
/src/main/resources (Vue)
This leads to a couple of annoyances.
Here's one of my projects that uses this model
So my question is: What's a better way to structure my application?
I've had a few months to think and in that time I've created a few more applications with Vue, here's the workflow I've started to take.
I create a GitHub organization for any project that has more than one layer. For example, many of my projects have a REST API written in Java or JavaScript, and a web interface with Vue. This organization will contain a repository for each layer. Here's a link to an organization that follows this idea.
This allows me to separate my backend and frontend, but it complicated deployment. I can no longer serve my Vue files with the same web server as the API, but upon further thought that's probably a good thing.
With this pattern I can host my static Vue site on Amazon S3 which is extremely cheap, and use free dynos with Heroku to host my API.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With