SkillAgentSearch skills...

Servue

[Suspended development :(] Reactive backend with VueJS. Socket, Routes, Reactive data.

Install / Use

/learn @juliandavidmr/Servue
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

Servue

A reactive backend that implements the best of javascript, such as VueJS, SocketIO, and Redux?

  • [x] Routes
  • [x] Reactive controllers
  • [x] Middlewares
  • [ ] Reactive Socket
  • [ ] Render templates VueJS

Usage

Module: main.ts

import { Server } from "../../../"
import { Main } from "./app.module"

Server(Main).serve('localhost', 3000, () => {
  console.log("Run server port %i", 3000);  
});

Module: app.module.ts

import { Module } from '../../../'
import { Pet } from "../controllers/PetController";
import { User } from "../controllers/UserController";

function middleware(req, res, next) {
  console.log("Middleware executed");
  next();
}

@Module({
  controllers: [
    Pet,
    User
  ],
  use: [],
  middlewares: [
    middleware
  ]
})
export class Main { }

Module: PetController.ts

@VueController({})
export class Pet extends Vue {

  @Prop name: string = "Julian";

  created() {
    console.log("Pet mounted")
  }

  @Get('list')
  getList(req: any, res, next) {
    console.log("ID :", req.params)
    res.json([{ name: 'David' }])
  }
}

Controller: UserController.ts

@VueController({
  prefix: 'usercontroller'
})
export class User extends Vue {

  @Prop info: string = "Julian";

  created() {
    console.log("User mounted")
  }

  @Watch("info", { deep: true })
  onInfoChanged(val) {
    console.log("Value", val);
  }

  @Get({
    path: '/data/:id'
  })
  getData(req: any, res, next) {
    console.log("ID :", req.params)
    return res.send("Hello, I am a controller TS")
  }

  @Get('list')
  getList(req: any, res, next) {
    console.log("ID :", req.params)
    return res.json([{ name: 'David' }])
  }

  @Get({
    path: '/info/:data',
  })
  getInfo(req: any, res, next) {
    console.log("ID :", req.params)
    return res.send("Hello, I am a controller TS")
  }

  @Post({})
  getPost(req: any, res, next) {
    console.log("ID :", req.params)
    return res.send("Request Post :)")
  }
}

Build Setup

# install dependencies
npm install

# Clean and build
npm run prebuild

# serve localhost:3000
npm run prepublish

Changelog

License MIT @juliandavidmr

View on GitHub
GitHub Stars5
CategoryDevelopment
Updated6mo ago
Forks1

Languages

TypeScript

Security Score

82/100

Audited on Oct 1, 2025

No findings