1.0.2 • Published 5 months ago
@uisap/create v1.0.2
@uisap/create
A scaffolding tool for quickly setting up a new project using @uisap/core
, a lightweight and modular framework inspired by Laravel and built on top of Fastify.
With @uisap/create
, you can bootstrap a fully functional project in seconds, complete with configuration files, models, controllers, routes, and more.
Installation
You don’t need to install @uisap/create
globally. Use npx
to run it directly:
npx @uisap/create my-app
Prerequisites:
- Node.js (version 16.x or higher)
- Redis (default: localhost:6379, required for queue and broadcasting)
- Database (MSSQL is configured by default; adjust settings in
config/database.js
as needed)
Ensure Redis and your database are running before starting the application.
Directory Structure
my-app/
├── app/
│ ├── controllers/
│ │ └── exampleController.js
│ └── models/
│ └── exampleModel.js
├── config/
│ ├── app.js
│ ├── cors.js
│ ├── database.js
│ ├── events.js
│ ├── queue.js
│ └── schedule.js
├── index.js
├── routes.js
├── .env.example
└── package.json
Starting the Application
Navigate to your project directory, copy the environment file, and start the app:
cd my-app
cp .env.example .env
npm start
For queue and broadcasting, start the worker in a separate terminal:
npm run worker
The application runs on http://localhost:4115 by default (configurable in config/app.js
or .env
).
Features
- Routing: Define routes in
routes.js
using@uisap/core’s
routing system. - Controllers: Extend BaseController for handling requests.
- Models: Use Model for database interactions.
- Dependency Injection: Automatic injection of models and services.
- Events & Broadcasting: Handle real-time updates using Socket.IO.
- Queue Processing: Asynchronous job handling with bull.
- Scheduling: Cron-like tasks using toad-scheduler.