Skip to content

Easy to use Open Source modules that implement common API logic and can be used in your Node.js backend services

License

Notifications You must be signed in to change notification settings

vratix-dev/api-library

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Vratix API Module Library

Contributor Covenant GitHub License NPM Downloads

TL;DR

Use the init command to create a new Node.js project:

npx vratix init

Overview

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.

Installation

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.

Start a New Project

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

Configure Your Project

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

Choose API Modules

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.

Set Folder Overrides

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.

Ready To Go

Once setup is complete, run:

npm run dev

to start your service.

To add additional modules later, simply use:

npx vratix add auth-basic

About

Easy to use Open Source modules that implement common API logic and can be used in your Node.js backend services

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published