A simple discussion forum sample app
Runs on express and vite.
It's using a personal boilerplate that is still not quite production tested, but I'm it will be one day.
The project is entirely contained within the src
folder,
within it are the two core locations api
and client
.
No surprises here, all the js and ts files within the routes
folder are registered by default on startup, if there's
need, you may edit the registerApi()
function over at
index.js
to alter this behavior.
Here, the structure has a bit more... authorial aspects, but not too many I hope.
Easy one, for static global assets like favicons and such.
Global css goes here.
definitions
holds sass stuff (variables, mixins, etc).
styles
includes all files that actually output, well... styles.
global.scss
is for definitions that you want available on every .scss
file.
main.scss
is the global css file, it's imported by main.js
on the client
root.
There's a simple layout system im place so that different pages can be enveloped in custom layouts if needed be.
To be a layout all a vue component needs is a slot, no more, no less.
Last but definitely not least, is the modules
folder.
Here is where the core of your project's client-side code.
The idea is to group the project's domains within modules, with every module aggregating their related components, assets, etc.
Every module may contain a routes.ts
file which exports
an array of route definition
objects.
SSR is supported out-of-the-box and should mostly just work for basic scenarios.
More complex implementations such as forwarding cookies and serializing the state have yet to be worked out.
For more in-depth information check the official documentation for both vite and vue.