crafta
Version:
Lightweight, modular Node.js framework
100 lines (71 loc) • 2.7 kB
Markdown
# Crafta
[](https://www.npmjs.com/package/crafta) [](https://github.com/daxp472/crafta/blob/main/LICENSE) [](https://www.npmjs.com/package/crafta)
> Lightweight, modular Node.js framework for rapid backend development
## Table of Contents
- [Installation](#installation)
- [Quick Start](#quick-start)
- [Features](#features)
- [Documentation](#documentation)
- [Contributing](#contributing)
- [Support](#support)
- [License](#license)
## 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
```bash
# Core package
npm install crafta
# Optional: Authentication module
npm install @dax-crafta/auth
```
## Quick Start
```javascript
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](https://crafta.dev/docs).
### Authentication
If you need authentication features, you can integrate `@dax-crafta/auth`:
```javascript
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
1. Fork the repository
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
3. Commit your changes (`git commit -m 'Add some amazing feature'`)
4. Push to the branch (`git push origin feature/amazing-feature`)
5. Open a Pull Request
## Support
- [GitHub Issues](https://github.com/daxp472/crafta/issues)
- [Documentation](https://crafta.dev/docs)
- [Discord Community](https://discord.gg/crafta)
## License
ISC © [Dax Patel]
---