
Product
Introducing Rust Support in Socket
Socket now supports Rust and Cargo, offering package search for all users and experimental SBOM generation for enterprise projects.
Fictif is a full-stack application framework for building modern, server-driven web apps with Vue 3 — without needing to maintain a separate frontend API. It blends the power of classic server-side tools like Laravel with the speed of SPAs, offering a flexible, composable alternative to Inertia.js, Nuxt, and Vue Router.
Whether you're building Laravel hybrids, Electron apps, PWAs, or fully client-side SPAs, Fictif adapts effortlessly — with zero runtime dependencies and a tiny footprint.
*.screen.vue
, and are placed in resources/screens
, are discovered, and defined with a path like this: path.to.welcome
for resources/screens/path/to/welcome.screen.vue
, the screen resolver has many other features like node_packages and vendor discovery (vendor::has.a.screen
) and overrides that i will document later<Display>
, <Curtain>
, and <MultiStep>
to accelerate development.fast-glob
during development only.We are currently writing documentation for this library, we will cover basic usage here.
This package is in its early beta version, we recommend not to use it in production environments, you can install the latest GitHub release:
pnpm i fictifhq/fictif#release
# or use npm
Or get stable releases from npm registry:
pnpm i fictif
# or use npm
For inertia-like usage, scroll down. Let's get straight to the point,
Add this to your vite.config.js
export default defineConfig({
plugins: [
vue(), // ... and other plugins you already have
fictif()
],
});
Your project structure should look like:
resources/
js/
app.js
... Your javascript files
css/
... Your css files
screens/
welcome.page.vue
... Your views ( screens )
import { createFictifApp } from 'fictif'
import 'fictif/style'
createFictifApp((route) => {
route.get('/', (req) => {
return view('welcome').with({
// You can pass props here
abcd: '2025'
})
});
route.get('/:someArg', (req, someArg) => {
return view('welcome').with({
abcd: someArg
})
});
// This is how to handle 404
//route.get('*', (req, arg1) => {
// //
//});
});
<template>
Hello {{ abcd }}
</template>
<script>
const { abcd } = defineProps(['abcd']);
</script>
That's all 🧨
If you have an inertiajs compatible backend, like laravel with inertia installed, do this in your app.js
import { createFictifApp } from 'fictif'
import 'fictif/style'
createFictifApp();
// Theres plenty of things to customize, don't worry, i will document all of them soon.
Yep, thats all, you can define your screens in resources/screens
, dont forget to add the fictif()
vite plugin.
The router is the heart of Fictif. It manages the visit lifecycle with a granular event system.
import { useRouter } from 'fictif';
const router = useRouter(); // Get the globally initialized router
// Listen to lifecycle events
router.on('leaving', () => {
if (hasUnsavedChanges()) {
if (!confirm("Leave without saving?")) {
router.preventNavigation();
}
}
});
router.on('navigation', () => progress.start());
router.on('navigated', () => progress.finish());
router.on('push', ({ page }) => {
// The page state has been updated
console.log('Now on component:', page.component);
});
// Programmatic navigation
router.go('/dashboard');
The useForm composable provides a complete solution for form submissions, including state management, validation errors, and file uploads.
<script setup>
import { useForm } from 'fictif';
const form = useForm({
name: 'John Doe',
avatar: null,
});
const submit = () => {
// This automatically handles FormData for file uploads
form.post('/users');
};
</script>
<template>
<form @submit.prevent="submit">
<input type="text" v-model="form.data.name">
<div v-if="form.errors.name">{{ form.errors.name }}</div>
<input type="file" @input="form.data.avatar = $event.target.files[0]">
<button type="submit" :disabled="form.processing">Save</button>
</form>
</template>
For SPAs or advanced routing needs, the RouterMap provides a powerful, Express.js-style API for defining your routes on the client.
// A custom resolver using RouterMap
import { RouterMap, response, redirect } from 'fictif';
const rm = new RouterMap();
// Apply a middleware to a group of routes
rm.middleware('auth', (req, next) => {
if (!isLoggedIn()) {
return redirect('/login').build();
}
return next(req);
});
rm.group(admin => {
admin.get('/dashboard', () => response().component('admin.dashboard'));
admin.get('/users', () => response().component('admin.users'));
}).prefix('/admin').applyMiddleware('auth');
// Use it in your router
const router = new Router({ resolve: rm });
We have a Discord server in case you have any questions.
Contributions are welcome! Please feel free to submit a pull request or open an issue.
Fictif is open-source software licensed under the MIT license.
FAQs
The modern, hybrid framework for Vue 3.
We found that fictif demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket now supports Rust and Cargo, offering package search for all users and experimental SBOM generation for enterprise projects.
Product
Socket’s precomputed reachability slashes false positives by flagging up to 80% of vulnerabilities as irrelevant, with no setup and instant results.
Product
Socket is launching experimental protection for Chrome extensions, scanning for malware and risky permissions to prevent silent supply chain attacks.