Getting Started
Install ServCraft and create your first project in minutes
ServCraft is a modular Node.js backend framework that helps you build production-ready APIs quickly. Generate clean, maintainable code with built-in best practices.
Why ServCraft?
Built for developers who want clean, maintainable code without sacrificing flexibility or performance.
Production Ready
Generate backend code that's ready for production with best practices baked in.
Modular Architecture
Organize your code in self-contained modules that are easy to maintain and test.
Secure by Default
Built-in authentication, authorization, rate limiting, and security headers.
High Performance
Powered by Fastify for blazing fast request handling and low latency.
System Requirements
Installation Steps
Follow these steps to get ServCraft up and running
Install ServCraft CLI
Install ServCraft globally on your system using npm. This gives you access to the servcraft command-line tool for creating and managing projects.
npm install -g servcraftThe CLI includes all the tools you need to generate code, manage modules, and run development servers.
Verify Installation
Check that ServCraft is installed correctly and see the installed version.
servcraft --versionYou should see something like: ServCraft v0.4.9
Create a New Project
Initialize a new project with interactive setup. The CLI will guide you through choosing your preferences.
servcraft init my-appYou'll be prompted to select: TypeScript/JavaScript, database provider (PostgreSQL, MySQL, etc.), validator library, and module system.
Navigate to Project
Change into your new project directory.
cd my-appAll subsequent commands should be run from this directory.
Install Dependencies
Install all project dependencies defined in package.json.
npm installThis installs Fastify, Prisma, and all other dependencies your project needs.
Setup Database
Initialize the database and push the schema. For development, this is all you need.
npm run db:pushFor production, use migrations: npm run db:migrate
Start Development Server
Start the development server with hot reload. Your code changes will automatically restart the server.
npm run devYour API will be available at http://localhost:3000
All-in-One Setup
Run these commands to get started quickly
1# Complete setup in one go npm install -g servcraft servcraft init my-awesome-api cd my-awesome-api npm install npm run db:push npm run dev # Your API will be available at http://localhost:3000
Project Templates
Choose a template that fits your needs
Minimal
Basic API structure with core files only. Perfect for simple projects or learning.
servcraft init my-api --template minimalFull Stack
Complete setup with auth, users, and common modules. Best for production applications.
servcraft init my-app --template fullMicroservice
Lightweight setup for microservices. Minimal dependencies, focused on performance.
servcraft init my-service --template microserviceCLI Options
Customize your project setup with these options
--ts--js--prisma <db>--validator <lib>--esm--cjs--template <name>--force--dry-runTroubleshooting Common Issues
Command not found: servcraft
Solution: Make sure npm global modules are in your PATH. Try: npm config get prefix and add that to your PATH.
Permission denied when installing
Solution: Use sudo npm install -g servcraft (Linux/Mac) or run as Administrator (Windows).
Database connection failed
Solution: Check your DATABASE_URL in .env. Make sure your database server is running.
Port 3000 already in use
Solution: Set a different PORT in your .env file or stop the other process using the port.