NovaLang brings enterprise-grade backend patterns plus modern frontend components to one unified language for complete full-stack development.
// 🚀 NovaLang Full-Stack Application
// Frontend Component
@Component
class UserCard {
function render(user) {
return `
` + user.name + `
` + user.email + `
`
}
}
// Shared Entity (works in frontend AND backend!)
@Entity
class User {
id: number
name: string
email: string
function getDisplayName() {
return this.name || this.email
}
}
// Backend Repository
@Repository
class UserRepository {
function findAll() {
print "💾 Finding all users..."
return db.query("SELECT * FROM users")
}
function save(user) {
print "💾 Saving user: " + user.name
return db.insert("users", user)
}
}
// Backend Service
@Service
class UserService {
function getUsers() {
return userRepo.findAll()
}
function createUser(userData) {
let user = new User(userData.name, userData.email)
return userRepo.save(user)
}
}
// REST API Controller
@Controller("/api/users")
class UserController {
function GET index() {
return userService.getUsers()
}
function POST create(request) {
return userService.createUser(request.body)
}
}
print "🎉 Full-Stack NovaLang App Ready!"
print "Frontend: ✅ Components with state"
print "Backend: ✅ Spring Boot patterns"
print "Database: ✅ Auto-configured"
Full-stack development with enterprise patterns plus modern frontend components
React-style components with @Component decorator, state management, and lifecycle hooks built into the language.
Intelligent automatic setup - database creation, component scanning, and dependency injection out of the box.
Clean separation with Entity/Repository/Service/Controller patterns. Professional enterprise architecture built-in.
MySQL auto-configuration, table creation from entities, and intelligent data access repositories.
Get from idea to running application in minutes with sensible defaults and minimal configuration.
Clean, readable syntax inspired by the best of JavaScript, Python, and Java.
Frontend components and backend services in one language. Share models, types, and logic between UI and API.
Built-in patterns for REST APIs, business logic, data access, and scalable architecture.
Full-stack development with frontend components and backend services in one language
// 🎨 Product Card Component - ProductCard.nova
// @Component
@Component
class ProductCard {
// Component state
state = {
quantity: 1,
inCart: false
}
// Render method (like React)
function render(product) {
return `
${product.name}
$${product.price}
${this.state.quantity}
`
}
// Event handlers
function increaseQuantity() {
this.state.quantity += 1
this.rerender()
}
function decreaseQuantity() {
if (this.state.quantity > 1) {
this.state.quantity -= 1
this.rerender()
}
}
function toggleCart() {
this.state.inCart = !this.state.inCart
print this.state.inCart ? "Added to cart!" : "Removed from cart!"
this.rerender()
}
// Lifecycle hooks
function onMount() {
print "ProductCard component mounted"
}
function onUpdate() {
print "ProductCard component updated"
}
}
// 📦 Product Entity - Product.nova
// @Entity - Same model used in frontend components!
@Entity
class Product {
// Entity fields (shared with frontend)
id: number
name: string
price: number
category: string
image: string
description: string
inStock: boolean
// Constructor
function Product(name, price, category, image) {
this.name = name
this.price = price
this.category = category
this.image = image
this.inStock = true
print "📦 Entity: Product created"
}
// Business methods (available in frontend too!)
function getDisplayPrice() {
return "$" + str(this.price)
}
function isAvailable() {
return this.inStock && this.price > 0
}
function getDiscountPrice(percentage) {
return this.price * (1 - percentage / 100)
}
// Validation (works in frontend forms too!)
function validate() {
if (len(this.name) < 2) {
return "Product name too short"
}
if (this.price <= 0) {
return "Price must be positive"
}
if (len(this.category) == 0) {
return "Category is required"
}
return "valid"
}
}
// 💾 Product Repository - ProductRepository.nova
// @Repository
function ProductRepository_save(name, price, category) {
print "💾 Saving product: " + name;
let sql = "INSERT INTO products (name, price, category) VALUES (?, ?, ?)";
print "📝 SQL: " + sql;
print "✅ Product saved with auto-generated ID";
return true;
}
function ProductRepository_findAll() {
print "📋 Finding all products";
let sql = "SELECT * FROM products";
print "📝 SQL: " + sql;
return 5; // Number of products found
}
function ProductRepository_findByCategory(category) {
print "🔍 Finding products by category: " + category;
let sql = "SELECT * FROM products WHERE category = ?";
print "📝 SQL: " + sql;
return 2; // Number of products found
}
// ⚙️ Product Service - ProductService.nova
// @Service
function ProductService_createProduct(name, price, category) {
print "🔄 ProductService.createProduct()";
// Business validation
if (!Product_validate(name, price, category)) {
return false;
}
// Default category if empty
if (len(category) == 0) {
category = "General";
print "📝 Setting default category: General";
}
// Check for duplicates
print "🔍 Checking for duplicate products...";
// Save through repository
return ProductRepository_save(name, price, category);
}
function ProductService_getProductsByCategory(category) {
print "🔍 Getting products by category: " + category;
return ProductRepository_findByCategory(category);
}
// 🌐 Product Controller - ProductController.nova
// @RestController
// @RequestMapping("/api/products")
function ProductController_createProduct(name, price, category) {
print "🌐 POST /api/products";
print "📥 Request: {name: '" + name + "', price: " + str(price) + "}";
let result = ProductService_createProduct(name, price, category);
if (result) {
print "✅ HTTP 201 CREATED - Product created successfully";
return 201;
} else {
print "❌ HTTP 400 BAD REQUEST - Validation failed";
return 400;
}
}
function ProductController_getProductsByCategory(category) {
print "🌐 GET /api/products/category/" + category;
let count = ProductService_getProductsByCategory(category);
print "✅ HTTP 200 OK - " + str(count) + " products found";
return 200;
}
Be among the first to experience the future of enterprise development. Get early access, shape the language, and be part of our growing community.
Get up and running with NovaLang in minutes
Download NovaLang interpreter and set up your development environment
git clone https://github.com/martinmaboya/novalang.git
cd novalang
python main.py your_app.nova
Create a simple "Hello World" application with enterprise patterns
// hello.nova
print "Hello, NovaLang!";
function greet(name) {
return "Welcome to NovaLang, " + name + "!";
}
let message = greet("Developer");
print message;
Build a full enterprise application with entities and REST APIs
// Run the package-based application
python main.py src/main/novalang/Application.nova
// Or use VS Code tasks
Ctrl+Shift+P → "Tasks: Run Task"
→ "Run Package-Based Application"