Use the init
command to create a new Node.js project:
npx vratix init
We created this library of reusable API modules to simplify API development because we were wasting too much time setting up basic functionality and researching the latest backend best practices. We wanted a repository of high-quality API modules we can reuse, copy and paste into our projects and have a working backend in seconds.
Currently, the modules work for Express.js, however, we’re actively working to extend compatibility with other backend languages and popular Node.js frameworks. We would be more than happy for you to contribute and help us achieve this faster.
This isn’t just another package; it’s a source code repository you can copy and use — your code, your way.
The modules are designed to be a solid foundation for any API service, you should customize them to fit your unique needs.
We recommend using our CLI to import modules into your codebase. It automates file placement, manages external dependencies, sets up database repositories and migrations, and resolves module imports.
You’re free to copy and use any code from this API Module Library — it's designed to be a foundation you can build on.
To simplify setup and integration, we created a CLI tool that helps you start new projects or integrate our API Modules into existing ones. The CLI handles imports, configurations, and dependencies automatically, so you can get up and running in minutes.
Use the init
command to create a new Node.js project or configure an existing one.
Add the -c
flag to specify a custom folder, or the CLI will set up the project in the current directory:
npx vratix init
The CLI will prompt you with a few questions to configure your project and create ./config/modules.json
:
Select your package manager: › pnpm
What database are you going to use: › PostgreSQL
Select your schema validator: › zod
Should we set up Docker containers for this service (docker-compose.yaml): › no / yes
Should we configure a web proxy for this project (NGINX): › no / yes
During setup, select any initial API Modules you’d like to install as part of the project template:
☐ Auth (Basic)
☐ Stripe Subscriptions
☐ S3 File Upload
☐ None
If you choose "None," you can add modules individually after setup.
Customize the paths for main module folders if needed:
@components -> /src/components
@routes -> /src/routes
@middleware -> /src/middleware
@utils -> /src/utils
Note: Any folder overrides will still be located within
/src
.
Once setup is complete, run:
npm run dev
to start your service.
To add additional modules later, simply use:
npx vratix add auth-basic