Minutes of Meeting: NDA SecureSign

Comprehensive Setup Manual & Reference Guide

Generated on: June 6, 2025

1. Introduction

This document serves as a detailed manual and step-by-step guide for setting up the FAA SecureSign™ NDA Portal. It covers all actions taken, files created, code logic, and terminal commands executed during our development process. This manual is designed to be a comprehensive reference for understanding and replicating the setup.

2. Project Overview: FAA SecureSign™ NDA Portal

The FAA SecureSign™ NDA Portal is a web application designed to securely collect Non-Disclosure Agreement (NDA) applications. Key features include:

3. Local Development Environment Setup

This section details the steps to set up the project on a local machine.

3.1. Prerequisites

3.2. Project Structure

The core project structure, with `server.js` handling backend logic and static assets served from the `legal` subdirectory:

/Users/samantha/Documents/Restart/faa.zone/scripts/
├── node_modules/         (installed by npm)
├── uploads/              (created by Multer for uploaded files)
├── package.json          (npm project configuration)
├── server.js             (Node.js backend logic)
└── legal/
    ├── securesign.html   (the main HTML form)
    └── fruitful_holdings_nda.pdf (the downloadable NDA document)
    

3.3. Initial Project Setup & Dependencies

Performed in the terminal, starting from the scripts directory (/Users/samantha/Documents/Restart/faa.zone/scripts/).

  1. **Clean up existing files (if any) and initialize a new Node.js project:**
    rm -rf node_modules package-lock.json server.js package.json
    npm init -y

    Logic: This removes old installations to prevent conflicts and creates a basic `package.json` file for the project.

  2. **Install required Node.js packages:**
    npm install express body-parser multer nodemailer

    Logic:

    • express: Web framework for Node.js, used for routing and handling HTTP requests.
    • body-parser: Middleware to parse incoming request bodies (form data).
    • multer: Middleware for handling multipart/form-data, primarily used for file uploads.
    • nodemailer: Library to send emails from Node.js applications.

  3. **Update package.json with correct dependencies:**

    The `package.json` ensures that all necessary dependencies are listed with compatible versions. This was critical to resolve earlier `EJSONPARSE` errors.

    {
      "name": "scripts",
      "version": "1.0.0",
      "main": "index.js",
      "scripts": {
        "test": "echo \"Error: no test specified\" && exit 1"
      },
      "keywords": [],
      "author": "",
      "license": "ISC",
      "description": "",
      "dependencies": {
        "body-parser": "^1.20.2",
        "express": "^4.19.2",
        "multer": "^1.4.5-lts.1",
        "nodemailer": "^6.9.13"
      }
    }
    

3.4. Create & Configure Core Files

3.4.1. `securesign.html` (Frontend HTML)

  1. **Create the `legal` subdirectory and `securesign.html`:**
    mkdir -p legal
    cd legal
    nano securesign.html

    Logic: Organizes web assets in a `legal` folder. The `nano` command opens the file for editing.

  2. **Paste the HTML code:** Copy the entire code from the "FAA SecureSign™ NDA Portal (Single NDA Download)" immersive artifact (from our conversation history) into `securesign.html`.

    Key Logic & Features:

    • Structure: Comprehensive form fields (personal, identification, contact, employment, metrics, references).
    • Styling: Uses Tailwind CSS for responsive and modern aesthetics (rounded-xl, shadow-lg, responsive classes like md:).
    • File Uploads: Individual "drag-and-drop" styled areas for each document type, using <input type="file">.
    • Sector Selection: A `select` element with multiple selection enabled, dynamically populated by JavaScript from a predefined `sectorList`. A JavaScript listener limits selections to 5.
    • Modals: Custom JavaScript-driven success/error popups (`showModal`, `closeModal`) instead of browser alerts.
    • Form Submission: Uses fetch API for asynchronous submission, preventing page reloads.
    • NDA Download: A button linking directly to /legal/fruitful_holdings_nda.pdf.

    Action: Save and exit `nano` (`Ctrl + X`, then `Y`, then `Enter`).

3.4.2. `server.js` (Backend Node.js)

  1. **Navigate back to the `scripts` directory:**
    cd ..

    Logic: Ensures you are in the correct directory to create/edit `server.js`.

  2. **Open `server.js` with `nano`:**
    nano server.js
  3. **Paste the JavaScript code:** Copy the entire code from the "server.js: Node.js Express Backend for FAA SecureSign" immersive artifact (the latest, corrected version in our conversation history) into `server.js`.

    Key Logic & Features:

    • Express Server: Initializes the web server and listens on port 3000.
    • Static File Serving: app.use(express.static(path.join(__dirname))) allows serving HTML, CSS, JS files directly from the `scripts` directory and its subdirectories (like `legal`).
    • Routing:
      • GET /legal/securesign.html: Serves the NDA application form.
      • GET /legal/fruitful_holdings_nda.pdf: Serves the combined NDA document for download.
      • POST /submit-nda: Handles the form submission.
    • Body Parsing: Uses `body-parser` for `urlencoded` and `json` data.
    • File Uploads (Multer):
      • Configures disk storage for uploads in an `uploads/` directory.
      • Uses `multer().fields([...])` to handle multiple named file inputs from the form.
    • Email Sending (Nodemailer):
      • Configured for Zoho Mail SMTP (smtp.zoho.com, port 465, secure SSL).
      • Sends a confirmation email to the applicant's provided email address upon successful form submission.
      • Includes a summary of submitted text data and uploaded file names in the email body.
      • CRITICAL: Requires you to replace a placeholder with your actual Zoho Mail password/app key for `[email protected]`.
    • Data Handling: Parses the JSON string for selected sectors back into an array. Logs all form fields and uploaded file information to the console.

    Action: Save and exit `nano` (`Ctrl + X`, then `Y`, then `Enter`).

3.4.3. `fruitful_holdings_nda.pdf` (Combined NDA Document)

  1. **Create the PDF:** Combine your original "Fruitful Holdings NDA" content with the "Annexure A" content (provided as Markdown in a previous response) into a single PDF document.
  2. **Save the PDF:** Name this combined PDF file **`fruitful_holdings_nda.pdf`** (all lowercase, underscores instead of spaces).
  3. **Local Placement:** Place this `fruitful_holdings_nda.pdf` file into your local `legal` directory:
    /Users/samantha/Documents/Restart/faa.zone/scripts/legal/fruitful_holdings_nda.pdf

    Logic: This file is served by the `server.js` when the "Request Fruitful Holdings NDA" button is clicked.

3.5. Running the Local Server

After all files are in place, start your server from the scripts directory.

  1. **Start the server:**
    node server.js

    Expected Output:

    Server is running on http://localhost:3000
    Waiting for NDA submissions...
    Uploaded files will be saved locally in: /Users/samantha/Documents/Restart/faa.zone/scripts/uploads

    Logic: This command executes your Node.js server. The output confirms it's listening for requests.

  2. **Access the portal in your browser:**
    http://localhost:3000/legal/securesign.html

    Logic: This URL directs your browser to the `securesign.html` page served by your local Node.js server.

4. GitHub & Deployment Considerations

For deploying your application (e.g., using Vercel), your GitHub repository should reflect a specific structure, separating frontend static assets from backend serverless functions.

4.1. GitHub Repository Structure

Ensure your GitHub repository root has the following structure:

your-repo-name/
├── public/                 (For static assets served by Vercel)
│   └── legal/
│       └── securesign.html
│       └── fruitful_holdings_nda.pdf
└── scripts/                (Your Node.js backend code, deployed as serverless functions)
    ├── server.js
    ├── package.json
    ├── node_modules/       (will be built by Vercel during deployment)
    └── uploads/            (for local dev, not typically committed to Git if temporary)
    

4.2. Uploading Files to GitHub

You can use git push if you're comfortable with Git, or directly upload via the GitHub website.

  1. **Upload `fruitful_holdings_nda.pdf` (and `securesign.html` if not already there):**
    • Go to your GitHub repository in your web browser.
    • Navigate to the `public/legal/` path within your repository.
    • Click "Add file" -> "Upload files".
    • Drag and drop `fruitful_holdings_nda.pdf` (and `securesign.html`) into the upload area.
    • Add a commit message and click "Commit changes".

    Logic: This makes the files available to your deployment platform (e.g., Vercel) at the public-facing URL.

When deployed, the HTML will be at https://faa.zone/legal/securesign.html and the PDF at https://faa.zone/legal/fruitful_holdings_nda.pdf.

5. Troubleshooting Common Issues (from our chat)

6. Conclusion

This manual documents the entire process of setting up the FAA SecureSign™ NDA Portal, from initial environment configuration to deployment considerations. By following these steps, you should have a fully functional NDA submission system.

For any further assistance, please refer back to this guide or provide specific details of the issue.