Alapajs's Posts
Nairaland Forum › Alapajs's Profile › Alapajs's Posts
1 (of 1 pages)
Alapa gives you fine-grained control over model output using includeFields and excludeFields. Whether you're returning data to a client or an API consumer, you can safely sanitize responses to protect sensitive data and keep payloads clean. Here’s how it works: 🔹 includeFields – Define exactly what should be visible in responses 🔹 excludeFields – Hide sensitive fields from output (like passwords, tokens, SSNs) 💡 Priority Rule: If both are defined, includeFields always wins—ensuring you're explicit about what gets exposed. Alapa supports: ✅ Static declarations ✅ Decorator-based configs ✅ Dynamic runtime methods ✅ Conditional field inclusion/exclusion All filtering is automatically applied through: toClient() toAPI() toJSON() sanitize(), sterilize() res.api() Even res.json() 🔐 Best Practices: ✅ Use includeFields for clear, safe defaults 🚫 Avoid defining both on the same model 🧪 Regularly audit outputs to prevent leaks Secure, predictable APIs—by design. https://alapa.dev/docs/models/field-controls-and-data-operations/includes-and-excludes
|
🧩 Alapa’s development server includes a built-in refresh mechanism designed for a smooth developer workflow. Here’s how it works: 🔄 Automatic browser refresh on file changes — whether it’s views, static assets, or public files. 🛠️ Asset rebuilds are triggered intelligently when relevant files change. 🌐 LiveSocket using Socket.IO connects browsers to the dev server in real time. 🧠 If no browser is connected, the dev server will automatically open one after a short delay — only once, and only when needed. ⚙️ Built with chokidar for file watching, child_process for command execution, and full platform support (macOS, Linux, Windows). Everything is handled internally — no need for external tooling, browser extensions, or reload plugins. This setup improves feedback loops during development while staying lightweight and reliable. Get Started: https://alapa.dev/docs #nodejs #developerexperience #javascript #webdev #socketio #alapa #tooling #frameworks |
Alapa makes server-side navigation intuitive and expressive — no more clunky redirects or scattered flash messages. Whether you're building dashboards, form flows, or handling authentication, Alapa now makes it incredibly easy to: ✅ Redirect users to a route or URL ✅ Navigate back with helpful error messages ✅ Use named routes with dynamic parameters ✅ Chain flash messages like success, error, info, and warn ✅ Keep your code clean and expressive with method chaining Explore the full power of navigation in Alapa 👉 https://alapa.dev/docs/routing/navigator
|
Alapa’s Model .find* methods come packed with flexible options to query data without complex QueryBuilders. Here’s a quick overview: Basic Find Options select: Pick specific columns to return relations: Load related entities effortlessly (joins behind the scenes) where: Filter records by simple or nested conditions, including OR arrays order: Sort your results by multiple columns and directions skip & take: Paginate results cleanly and effectively withDeleted: Include soft-deleted rows in your query cache: Enable caching for performance boosts lock: Apply optimistic or pessimistic locks (for findOne only) Advanced Operators Use powerful built-in operators for complex filtering: Not, LessThan, MoreThanOrEqual, Equal, Like, ILike, Between, In, IsNull, Raw queries, and array operators like ArrayContains & ArrayOverlap. You can even combine operators with And, Or, and Not for full control over your query logic. Example: Query Users with Filters & Relations With Alapa’s flexible and declarative querying, your data fetching is clean, readable, and powerful—without writing raw SQL! https://alapa.dev/docs/models/find-options
|
Alapa offers a set of powerful decorators that allow developers to automatically generate API documentation in a clean, consistent, and maintainable way. These decorators are designed to work seamlessly with Alapa's routing and controller system, which means you can focus on building the application’s core features without worrying about the tedious task of maintaining accurate and up-to-date API documentation. https://alapa.dev/docs/api-docs/generate
|
Alapa simplifies model data handling through powerful create() and fill() methods—making mass assignment both efficient and secure. create() immediately assigns and persists data to the database. fill() allows you to assign values without saving, ideal for preprocessing or conditional logic. You can also track changes using built-in utilities: isDirty() to detect unsaved changes isClean() to confirm a model hasn’t been modified getOriginalValues() to retrieve initial data for comparison or auditing 🔐 Important: Always configure your fillable and guarded fields before using these features to ensure data security. https://alapa.dev/docs/models/field-controls-and-data-operations/create-and-fill
|
Alapa gives you fine-grained control over model output using includeFields and excludeFields. Whether you're returning data to a client or an API consumer, you can safely sanitize responses to protect sensitive data and keep payloads clean. Here’s how it works: 🔹 includeFields – Define exactly what should be visible in responses 🔹 excludeFields – Hide sensitive fields from output (like passwords, tokens, SSNs) 💡 Priority Rule: If both are defined, includeFields always wins—ensuring you're explicit about what gets exposed. Alapa supports: ✅ Static declarations ✅ Decorator-based configs ✅ Dynamic runtime methods ✅ Conditional field inclusion/exclusion All filtering is automatically applied through: toClient() toAPI() toJSON() sanitize(), sterilize() res.api() Even res.json() 🔐 Best Practices: ✅ Use includeFields for clear, safe defaults 🚫 Avoid defining both on the same model 🧪 Regularly audit outputs to prevent leaks Secure, predictable APIs—by design. https://alapa.dev/docs/models/field-controls-and-data-operations/includes-and-excludes #AlapaFramework #BackendDevelopment #DataSanitization #TypeScript #WebSecurity #APIResponse #ORM #IncludeFields #ExcludeFields #SecureByDefault #SoftwareEngineering #CleanOutput #DevBestPractices #WebDevTips
|
Named routes allow you to reference routes by their assigned names instead of hardcoding URLs. This improves maintainability and readability in your application. You can assign names to routes while defining them, making it easier to reference them later. By using named routes, you ensure that changes to route paths require only a single update at the definition level, preventing unnecessary modifications across multiple files. https://alapa.dev/docs/routing/name
|
Alapa provides a straightforward and flexible routing system for handling HTTP requests. Its routing design is similar to Express, allowing developers to define routes for various HTTP methods easily. Defining Routes Routes are defined using the Router class, which maps specific HTTP methods and URLs to handler functions. Below is an example of a basic route definition: Lear More: https://alapa.dev/docs/routing/basic
|
Karleb:Thank you very much for your feedback, Karleb. I understand your concern about the complexity of managing routes in large applications. However, there are various tools and techniques in the Alapa framework that can help you view and manage your routes without having to manually navigate through each controller file. For instance, Alapa provides commands to list all defined routes in one place, which can save time and improve visibility. You can always group related routes. This way, your routing logic remains organized, and you can avoid the issue of searching through multiple controller files. In addition, Alapa offers different types of routing strategies apart from controller-based routing, such as Basic routing (similar to Express) and Resource-based routing. You can choose the approach that fits best for your application's structure and needs. To learn more about these routing options, check out the documentation here: https://alapa.dev/docs/routing/basic |
Alapa Components offer a robust, React-like templating experience for your applications. They are reusable, customizable, and designed to seamlessly integrate into your templates. Key Features Component Structure: Defined using HTML-like syntax with the <component> tag. Reusability: Import and use components across your project. Dynamic Rendering: Use attributes like props, content, and attributes to customize rendering dynamically. https://alapa.dev/docs/template/component/indroduction
|
Controller-based routing in Alapa is designed to be intuitive. By following camel-case naming conventions for methods within a controller class, the framework automatically interprets the method names to generate corresponding routes. The first part of the method name specifies the HTTP verb, while the remaining parts define the route path, segmented by uppercase letters. https://alapa.dev/docs/routing/controller
|
The Alapa Template Engine enables developers to build dynamic HTML files using its unique and intuitive syntax. It supports embedding JavaScript expressions, rendering variables, and working with raw HTML, making it an efficient choice for template-based development. The default file extension for Alapa templates is .html. https://alapa.dev/docs/template/getting-started
|
Alapa Containers are a powerful feature designed to help you organize and inject scripts, styles, or custom HTML content throughout your application. With Containers, you can write scripts, styles, or custom HTML anywhere in your code and render them in a single location (e.g., scripts at the footer, styles in the head). This approach provides unparalleled flexibility in managing your page structure and content rendering, making your codebase cleaner, more modular, and easier to maintain. https://alapa.dev/docs/template/containter
|
Resource-based routing is a convention-over-configuration approach that maps HTTP verbs to controller actions for a specific resource. For example, a Book resource might have routes for listing books, showing a specific book, creating a new book, updating a book, and deleting a book. Alapa simplifies this process by automatically generating these routes when you define a resourceful controller. https://alapa.dev/docs/routing/resourceful
|
Alapa is a next-gen web development framework that makes building modern web apps faster, easier, and more efficient. With its React-like components, seamless routing, and modular architecture, Alapa is designed to give developers the tools they need to create scalable and maintainable applications. 💡 Whether you're building a small project or a large-scale solution, Alapa's got you covered with: - Intuitive API & easy onboarding - Built-in authentication & template engine - Developer-driven, community-focused development 👉 Check out the docs and join us in shaping the future of web development with Alapa! 🔥 📖 https://alapa.dev/docs #Alapa #WebDevelopment #OpenSource #Framework #Developers |
1 (of 1 pages)