bnjet
v1.0.2
Published
A simple bnjsx scaffolding tool to create projects in seconds.
Downloads
38
Readme
bnjet
bnjet is a scaffolding tool for the bnjsx framework, allowing you to quickly create bnjsx projects in seconds.
Installation
To install bnjet globally, run:
npm install -g bnjetOnce installed, you can use the command line tool globally.
Available Commands
bnjet -vPrints the current version of bnjet.bnjet new <path> <options>Creates a new bnjsx project in the specified path or in the current directory if no path is specified. You need to provide one of the following options:-tsto create a bnjsx TypeScript project for web.-jsto create a bnjsx JavaScript project for web.-ts -reactto create a bnjsx TS React project (coming soon in the next version).-js -reactto create a bnjsx JS React project (coming soon in the next version).-ts -vueto create a bnjsx TS Vue project (coming soon in the next version).-js -vueto create a bnjsx JS Vue project (coming soon in the next version).
Getting Started
- After installing bnjet, navigate to your project directory and run:
npm install- Start the Vite server for development:
npm run dev- Start the bnjsx server and open your application at localhost:2025:
npm run startBy default, bnjsx projects come with auth implemented out of the box, but we plan to introduce an option in the future to configure this functionality.
Frontend Development with Vite
bnjsx projects use Vite for frontend asset handling, which means you'll get HMR (Hot Module Replacement) and live reload every time you update your views or React components.
Jest Testing
Your bnjsx project comes with Jest preconfigured, Simply place your test files in the test folder and run:
npm run testCommand Line Tool
bnjsx projects also come with a command-line interface entry point at the root project, exec.js. You can use it to communicate with bnjsx and execute commands like:
node exec -v
node exec mk:gen productsAlternatively, you can use npx bnjsx -v, but note that it may be a bit slower.
TailwindCSS Integration
bnjsx projects come with TailwindCSS preconfigured. It’s ready to use with auto-reload when you update your views or React components (if using React).
Assets Handling
Assets in the public folder are served by the bnjsx server, while assets in the assets folder are served by the Vite server during development and by the bnjsx server in production. To switch to production, make sure to set the bnjsx.config.js env option to pro.
Production Setup
When your project is ready for production, follow these steps:
- Build your project:
npm run buildThis will output the build to the /app folder.
- Install production-only dependencies:
cd app && npm i --omit=dev- Make sure your database is ready by running:
node exec genUpdate
bnjsx.config.jsin the/appfolder:- Set
envtopro - Set
cachetotrue - Configure other options such as
host,port,protocol,key,cert, etc.
- Set
Run the server:
node indexEnjoy Your Development
That’s it! Enjoy seamless bnjsx development with bnjet.
