
Product
Introducing Tier 1 Reachability: Precision CVE Triage for Enterprise Teams
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
@uisap/create
Advanced tools
A scaffolding tool for quickly setting up a new project using @uisap/core, a lightweight, modular, and Laravel-inspired framework built on top of Fastify. With @uisap/create, you can bootstrap a fully functional project in seconds, complete with configuration files, models, controllers, routes, events, listeners, jobs, and more.
You don’t need to install @uisap/create globally. Use npx
to run it directly:
npx @uisap/create my-app
This command creates a new project directory named my-app
with all necessary files and dependencies.
config/database.js
.Ensure Redis and your chosen database are running before starting the application.
The scaffolded project follows a structured layout inspired by Laravel, designed for modularity and scalability:
my-app/
├── app/
│ ├── console/
│ │ └── commands/
│ │ └── ExampleCommand.js (optional, created with make:command)
│ ├── controllers/
│ │ └── ExampleController.js
│ ├── events/
│ │ ├── ExampleEvent.js
│ │ └── OrderShipped.js
│ ├── jobs/
│ │ └── ExampleJob.js
│ ├── listeners/
│ │ ├── ExampleListener.js
│ │ └── SendShipmentNotification.js
│ ├── models/
│ │ └── ExampleModel.js
│ └── providers/
│ └── AppServiceProvider.js
├── config/
│ ├── app.js
│ ├── broadcast.js
│ ├── cors.js
│ ├── database.js
│ ├── events.js
│ ├── queue.js
│ └── schedule.js
├── routes/
│ ├── api.js
│ ├── channels.js
│ └── console.js
├── .env.example
├── index.js
├── package.json
├── uisap.js
└── README.md
cd my-app
cp .env.example .env
npm install
npm run dev
The npm run dev
command starts both the main server (default: http://localhost:4115) and the queue worker. To run the worker separately (e.g., for debugging):
npm run worker
routes/api.js
using @uisap/core's routing system, with support for middleware.uisap.js
CLI provides commands for generating components and managing tasks.The uisap.js
CLI (invoked via node uisap
or npx uisap
) offers commands to generate components and manage the application. Run from the project root:
node uisap make:controller Example
Generates app/controllers/ExampleController.js
.
node uisap make:model Example
Generates app/models/Example.js
.
node uisap make:middleware Auth
Generates app/middlewares/Auth.js
.
node uisap make:job ProcessData
Generates app/jobs/ProcessData.js
.
node uisap make:event OrderShipped
Generates app/events/OrderShipped.js
.
node uisap make:event OrderShipped --listener SendShipmentNotification
Updates app/providers/AppServiceProvider.js
to bind the listener.
node uisap make:listener SendShipmentNotification
Generates app/listeners/SendShipmentNotification.js
.
node uisap make:listener SendShipmentNotification --event OrderShipped
Updates app/providers/AppServiceProvider.js
.
node uisap make:listener SendShipmentNotification --queue
Adds the listener to config/queue.js
as a handler.
node uisap make:command CleanLogs
Generates app/console/commands/CleanLogs.js
.
node uisap make:command CleanLogs --schedule
Adds the command to config/schedule.js
.
node uisap schedule:run
Executes all scheduled tasks once.
node uisap schedule:list
Displays a table of scheduled tasks.
node uisap queue:work [--queue <queue>] [--tries <tries>]
Processes jobs from the specified queue (default: default
).
node uisap broadcast:test [--channel <channel>] [--event <event>] [--data <data>]
Sends a test broadcast message to the specified channel.
node uisap serve [--port <port>]
Runs npm run dev
with an optional port (default: 4115
).
node uisap help
Shows detailed help for all commands.
Events and listeners are tightly integrated for real-time and asynchronous processing. Use the --listener
or --event
options to bind them automatically in AppServiceProvider.js
.
Example:
node uisap make:event OrderShipped --listener SendShipmentNotification
This command generates app/events/OrderShipped.js
and updates app/providers/AppServiceProvider.js
:
import { ServiceProvider, EventFacade as Event } from '@uisap/core';
import SendShipmentNotification from '../listeners/SendShipmentNotification.js';
export class AppServiceProvider extends ServiceProvider {
register() {
// Register custom services or bindings
}
async boot() {
// Bind event to listener
Event.listen('OrderShipped', new SendShipmentNotification(), 10);
}
}
When the OrderShipped
event is fired, the SendShipmentNotification
listener is triggered, either directly or via a queue if configured.
Key configuration files are located in the config/
directory:
Modify .env
to override defaults (e.g., DB_CONNECTION
, REDIS_HOST
, JWT_SECRET
).
In app/controllers/ExampleController.js
:
async index(request, reply) {
const { id, data } = request.body;
const record = await this.exampleModel.createRecord({ id, data });
await Event.fire(new ExampleEvent({ recordId: record.id, data }));
return reply.send({ message: 'Record created', record });
}
In app/listeners/ExampleListener.js
:
async handle(event, app) {
app.fastify.logger.info('ExampleListener handling event', {
recordId: event.data.recordId,
data: event.data.data,
});
// Perform async operations, e.g., store in Redis
await app.container.make('keyValueStore').set(
`listener:${event.data.recordId}:handled`,
JSON.stringify(event.data),
3600
);
}
In routes/console.js
:
import { ScheduleFacade } from '@uisap/core';
export default async function consoleRoutes(app) {
ScheduleFacade.call(async (app) => {
app.fastify.logger.info('Sample scheduled task executed');
}).daily('0:00');
ScheduleFacade.setTimezone('Europe/Istanbul').run();
}
app/providers/
to register services or bind event listeners.app/middlewares/
for request processing.app.plugin()
in index.js
.app/console/commands/
..env
file has correct REDIS_HOST
and REDIS_PORT
..env
and check config/database.js
.npm run worker
separately if jobs aren't processing.logs/
directory for detailed error messages.Contributions are welcome! Please submit issues or pull requests to the @uisap/create repository. Ensure you include tests and follow the coding style.
@uisap/create and @uisap/core are licensed under the MIT License.
FAQs
@uisap/core için güncel scaffolding aracı
We found that @uisap/create demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 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’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
Research
/Security News
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.
Security News
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.