What is Amazon Nova Act AI?

Image
  What is Amazon Nova Act AI? Okay so, let me tell you about something super cool Amazon made. It's called Nova Act , and it's like a super smart robot brain that can use the internet just like we do! You know how we open websites, click stuff, type in boxes, and buy things online? Nova Act can do all that ... by itself! 1. It’s an AI Agent for Browsing the Internet So this Nova Act thing is like a robot helper that knows how to use a browser (like Chrome or Safari). It can go to websites, click buttons, fill forms, buy stuff, and even follow hard instructions without us telling it every little thing. Like imagine you said, "Hey Nova, go buy me a red t-shirt from Amazon." And guess what? It actually can go and do it all by itself! How crazy is that! 2. It Works on Its Own! One of the coolest thing about Nova Act is, once you give it a job, you don’t have to sit and watch it or tell it every step. It just knows what to do next, and it finish the task for you. Li...

How to create a Full-Stack Billing System with JavaScript, Node.js, Express, MySQL, and Semantic UI (1.8)


 About The EJS Template Structure

This HTML structure represents an admin interface for managing brands in a clothing business. It includes a vertical navigation bar with links to various sections, such as the dashboard, billing, orders, stock management, and customization options for brands, categories, and sizes.

The main content section features:

  1. Manage Brands Section: Displays a list of existing brands fetched from a backend, with an option to delete each brand.
  2. Add New Brand Modal: A Bootstrap modal allows users to input and submit a new brand name via a form.
  3. Dynamic Table: Lists all the brands, with a "Delete" button next to each for easy removal.

brands.ejs file 

<!doctype html>
<html lang="en">
  <head>
    <!-- Required meta tags -->
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!--Custom CSS-->
    <link rel="stylesheet" href="/css/style.css">
    <!--Semantic-UI CSS-->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.2.13/semantic.min.css">
    <!-- Bootstrap CSS -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BmbxuPwQa2lc/FVzBcNJ7UAyJxM6wuqIj61tLrc4wSX0szH/Ev+nYRRuWlolflfl" crossorigin="anonymous">

    <title>Brands</title>
  </head>
  <body>
    <!--Vertical Navbar-->
  <div class="vertical-nav bg-white" id="sidebar">
    <div class="py-4 px-3 mb-4" style="background: linear-gradient(to top, #90EE90 47%, #FFB385 68%);">
      <div class="media d-flex align-items-center"><img src="/css/admin.svg" alt="..." width="65" class="mr-3 rounded-circle img-thumbnail shadow-sm">
        &emsp;<div class="media-body">
          <h4 class="m-0"><p class="text-white">Hubuk Garments</h4>
            <p class="font-weight-light text-white mb-0"></p>
        </div>
      </div>
    </div>
    <form action="/logout?_method=DELETE" method="POST">
      <center><button type="submit" class="btn btn-danger" ><p class="text-white">Log Out</p></button></center>
    </form>
    <h5 class="ui horizontal divider header text-primary">
      MAIN
    </h5>
 
    <ul class="nav flex-column bg-white mb-0">
      <li class="nav-item">
        <a href="/" class="nav-link text-dark font-italic">
                  <i class="home icon"></i>
                  Dashboard
                </a>
      </li>
      <li class="nav-item">
        <a href="/bill" class="nav-link text-dark font-italic">
          <i class="rupee sign icon"></i>
                  Bill
              </a>
      </li>
      <li class="nav-item">
     <a href="/orders" class="nav-link text-dark font-italic" >
       <i class="eye icon"></i>
                  View Orders
     
              </a>
      </li>
      <li class="nav-item">
        <a href="/viewstocks" class="nav-link text-dark font-italic">
          <i class="tags icon"></i>
                  View Stocks
              </a>
      </li>
      <li class="nav-item">
        <a href="/stocks" class="nav-link text-dark font-italic">
          <i class="plus circle icon"></i>
                  Add Stock
              </a>
      </li>
    </ul>
 
    <h5 class="ui horizontal divider header text-primary">
      CUSTOMIZE
    </h5>
 
    <ul class="nav flex-column bg-white mb-0">
   
      <li class="nav-item">
        <a href="/brands" class="nav-link text-dark font-italic"  style="background: linear-gradient(to right, #90EE90 0%, #FFB385 68%);">
          <p class="text-white"><i class="yelp icon"></i>
                  Brand
          </p>
              </a>
      </li>
      <li class="nav-item">
        <a href="/categories" class="nav-link text-dark font-italic">
          <i class="bookmark icon"></i>
                  Category
              </a>
      </li>
      <li class="nav-item">
        <a href="/sizes" class="nav-link text-dark font-italic">
          <i class="check square icon"></i>
                  Size
              </a>
      </li>
    </ul>

    <h5 class="ui horizontal divider header text-primary">
      FILTERS
    </h5>
 
    <ul class="nav flex-column bg-white mb-0">
      <li class="nav-item">
        <a href="/sales_filter" class="nav-link text-dark font-italic">
          <i class="yelp icon"></i>
                  Sales
              </a>
      </li>
      <li class="nav-item">
        <a href="/stock_filter" class="nav-link text-dark font-italic">
          <i class="bookmark icon"></i>
                  Stock
              </a>
      </li>
    </ul>
  </div>
  <!-- End vertical navbar -->
 
  <!-- Page content holder -->
  <div class="page-content p-5" id="content" style="background: linear-gradient(to right, #90EE90 47%, #FFB385 68%);">
    <!-- Toggle button -->
    <button id="sidebarCollapse" type="button" class="btn btn-light bg-white rounded-pill shadow-sm px-4 mb-4"><i class="align justify icon"></i><small class="text-uppercase font-weight-bold">Menu</small></button>
 
    <!-- Page content -->
   
    <h1>Manage Brands</h1>
    <center><img class="ui medium rounded image" src="/css/brand.svg"></center>
    <br>
    <center>
         <!-- Button trigger modal -->
<button type="button" class="btn btn-lg btn-info" data-bs-toggle="modal" data-bs-target="#exampleModal">
    Add New Brand <i class="plus circle icon"></i></span>
  </button>
    <!-- Modal -->
  <div class="modal fade" id="exampleModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
    <div class="modal-dialog">
      <div class="modal-content">
        <div class="modal-header">
          <h5 class="modal-title" id="exampleModalLabel">Add New Brand</h5>
          <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
        </div>
        <div class="modal-body">
            <div class="mb-3">
                <label for="formGroupExampleInput" class="form-label">Enter New Brand</label>
                <form action="/brands/addbrand" method="POST">
                <input type="text" class="form-control" id="formGroupExampleInput" name="Brand" style="color:white;background: linear-gradient(to right, #90EE90 47%, #FFB385 68%);">
              </div>
        </div>
        <div class="modal-footer">
          <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
          <button type="submit" class="btn btn-primary" value="Hello" >Submit</button>
        </form>
        </div>
      </div>
    </div>
  </div>
        <div class="ui card">
    <table class="ui inverted violet table table-bordered" >
        <thead>
        <tr>
            <th><center><h1>Brands</h1></center></th>
        </tr>
    </thead>
    <tbody>
        <% brand.forEach(function(order){ %>
            <tr style="background: linear-gradient(to left, #90EE90 47%, #FFB385 68%);">
                <td><center><h2><%= order.Brand %></h2> &emsp;<form action="/deletebrand" method="POST"><input type="hidden" name="deleteid" value="<%= order.Brand %>"><button type="submit" class="btn btn-danger btn-sm">Delete</button></form></center></td>
            </tr>
        <% }); %>
    </tbody>
    </table>
</center>
    </div>
</div>
   

    <!-- Option 1: Bootstrap Bundle with Popper -->
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta2/dist/js/bootstrap.bundle.min.js" integrity="sha384-b5kHyXgcpbZJO/tY9Ul7kGkf1S0CWuKcCD38l8YkeH8z8QjE0GmW1gYU5S9FOnJ0" crossorigin="anonymous"></script>
    <!-- Semnatic-UI Scripts -->
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.2.13/semantic.min.js"></script>
    <script>
      $(function() {
    // Sidebar toggle behavior
    $('#sidebarCollapse').on('click', function() {
      $('#sidebar, #content').toggleClass('active');
    });
  });
 
    </script>

   
  </body>
</html>

brandsControllers.js file

const db = require('../db/connect.js');

const brandsControllers = {
  addBrand: (req, res) => {
    const { Brand } = req.body;
 
    const query = `INSERT INTO brands (Brand) VALUES (?)`;

    db.query(query, [Brand], (err, result) => {
      if (err) throw err;
      console.log('Brand added:', result);
      res.redirect('/brands'); // Redirect to the brands page after insertion
    });
  },

  getBrands: (req, res) => {
    const query = `SELECT * FROM brands`;

    db.query(query, (err, results) => {
      if (err) throw err;
      res.render('brands', { brand: results }); // Render the brands page with the fetched data
    });
  }
};

module.exports = brandsControllers;


brands.js file

const express = require('express');
const router = express.Router();
const brandsControllers = require('../controllers/brandsControllers');

// Route to fetch and display all brands
router.get('/', brandsControllers.getBrands);

// Route to add a new brand
router.post('/addbrand', brandsControllers.addBrand);

module.exports = router;

 

Comments

Popular posts from this blog

How to create a Full-Stack Billing System with JavaScript, Node.js, Express, MySQL, and Semantic UI (1.0)

What Is an API?

How to Turn Your Photos into Studio Ghibli-Style Art for Free!