Crafta
Lightweight, modular Node.js framework for rapid backend development
Table of Contents
Features
- Modular & Lightweight: Easily extendable and adaptable to your needs.
- Authentication Ready: Pre-built authentication system with JWT and bcrypt support. Install it separately via
@dax-crafta/auth
. - Express Integration: Built on top of Express, it integrates smoothly into your existing Node.js apps.
- Plug-and-Play System: Minimal setup required—just install and configure to get started in minutes.
Installation
# Core package
npm install crafta
# Optional: Authentication module
npm install @dax-crafta/auth
Quick Start
const crafta = require('crafta');
const { auth } = require('@dax-crafta/auth');
const app = crafta();
// Enable authentication (optional, if you need auth functionality)
app.use(auth({
secret: 'your-secret-key',
expiresIn: '1d'
}));
// Define a protected route
app.get('/protected', (req, res) => {
res.json({ message: 'Protected route accessed successfully!' });
});
app.listen(3000, () => {
console.log('Server running on http://localhost:3000');
});
Documentation
For detailed documentation, visit our documentation site.
Authentication
If you need authentication features, you can integrate @dax-crafta/auth
:
const { auth } = require('@dax-crafta/auth');
// Configure authentication
app.use(auth({
secret: 'your-secret-key',
expiresIn: '1d'
}));
// Create a new user
const user = await createUser({
username: 'john',
password: 'secure123'
});
Contributing
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
Support
License
ISC © [Dax Patel]