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.6)


 About The EJS Template Structure

The HTML structure represents a page for managing sizes in a garment billing system. It includes the following key components:

  1. Vertical Navbar: A sidebar navigation with links to various sections like Dashboard, Bill, View Stocks, Add Stock, Brand, Category, Size, and Filters for Sales and Stock. The navbar also includes a logout button.

  2. Page Content: The main content area includes a header, an image, and a button to trigger a modal for adding a new size.

  3. Add New Size Modal: A Bootstrap modal that opens when the "Add New Size" button is clicked. It contains a form where users can input and submit new sizes.

  4. Size Management Table: A table that displays existing sizes dynamically. Each size is listed with a delete button that allows the user to remove the size from the system.

  5. Form Actions: The forms on the page are integrated with backend routes to add (/sizes/addsize) or delete (/deletesize) sizes via POST requests.

sizes.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>Sizes</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 100%);">
      <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">
          <i class="yelp icon"></i>
                  Brand
              </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" style="background: linear-gradient(to right, #90EE90 0%, #FFB385 68%);">
          <p class="text-white"><i class="check square icon"></i>
                  Size
            </p>
              </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 100%);">
    <!-- 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 Sizes</h1>
    <center><img class="ui large rounded image" src="/css/size.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 Size <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 Size</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 Size</label>
                <form action="/sizes/addsize" method="POST">
                <input type="text" class="form-control" id="formGroupExampleInput" name="Size" style="color:white;background: linear-gradient(to right, #90EE90 0%, #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>Sizes</h1></center></th>
        </tr>
    </thead>
    <tbody>
        <% size.forEach(function(order){ %>
            <tr style="background: linear-gradient(to left, #90EE90 0%, #FFB385 68%);">
                <td><center><h2><%= order.Size %></h2> &emsp;<form action="/deletesize" method="POST"><input type="hidden" name="deleteid" value="<%= order.Size %>"><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>

sizesControllers.js file

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

const sizesControllers = {
  addSize: (req, res) => {
    const { Size } = req.body;
    const query = `INSERT INTO sizes (Size) VALUES (?)`;

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

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

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

  deleteSize: (req, res) => {
    const { deleteid: Size } = req.body;
    const query = `DELETE FROM sizes WHERE Size = ?`;

    db.query(query, [Size], (err, result) => {
      if (err) throw err;
      console.log('Size deleted:', result);
      res.redirect('/sizes'); // Redirect to the sizes page after deletion
    });
  }
};

module.exports = sizesControllers;

sizes.js file

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

// Route to fetch and display all sizes
router.get('/', sizesControllers.getSizes);

// Route to add a new size
router.post('/addsize', sizesControllers.addSize);

// Route to delete a size
router.post('/deletesize', sizesControllers.deleteSize);

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.9)

What Is an API?

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