Tofu is an opinionated, developer-centric MVC framework for Node.js that aims to streamline your prototyping and development workflow. Inspired by PHP Laravel, Tofu brings structure and simplicity to your Node.js projects.
- Rapid Development: Tofu's CLI tools and scaffolding capabilities help you set up project structures quickly.
- Flexibility: While opinionated, Tofu allows for customization as your project grows.
- Developer Experience: Built with DX in mind, Tofu aims to simplify common development tasks.
- Full-Stack Approach: Supports both frontend views and backend APIs.
- Separation of concerns with Models, Views, and Controllers
- Routing based on controller structure
- Support for API development
- Generate controllers, models, middleware, and more with CLI commands
- Project creation wizard for quick setup
- Built-in timer functionality for scheduled tasks
- Ability to create and manage background jobs using a Cron like syntax
- Decentralized Event/listener architecture for decoupled application logic
- Middleware support at controller level
- Easy to implement custom middleware
- Basic database connectivity
- Support for MongoDB through Mongoose
- Configurable startup process
- Environment-based configuration support
- Support for multiple view engines (Handlebars, Pug, EJS)
- Ability to switch between view engines
- Basic documentation available
- Example files included in the project structure
npm install -g tofu
tofu create my-awesome-app
cd my-awesome-app
npm install
npm start
Tofu provides several CLI commands to help with development:
tofu make controller UserController
tofu make model User
tofu make middleware AuthMiddleware
tofu make timer DailyCleanup
tofu make event UserRegistered
Tofu uses a configuration system based on JavaScript files in the Config
directory.
Tofu provides some basic security features:
- Helmet.js integration for HTTP headers security
- Express security best practices
Tofu includes a basic test setup using AVA.
We welcome contributions!
If you find Tofu helpful, consider supporting its development:
Tofu is MIT licensed.
Tofu: A promising framework for Node.js development, aiming to simplify common tasks and provide a structured approach to building applications. Join us in evolving Node.js development! 🚀🥢