Comprehensive Setup Manual & Reference Guide
Generated on: June 6, 2025
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.
The FAA SecureSign™ NDA Portal is a web application designed to securely collect Non-Disclosure Agreement (NDA) applications. Key features include:
This section details the steps to set up the project on a local machine.
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)
Performed in the terminal, starting from the scripts
directory (/Users/samantha/Documents/Restart/faa.zone/scripts/
).
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.
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.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"
}
}
mkdir -p legal
cd legal
nano securesign.html
Logic: Organizes web assets in a `legal` folder. The `nano` command opens the file for editing.
Key Logic & Features:
rounded-xl
, shadow-lg
, responsive classes like md:
).<input type="file">
.fetch
API for asynchronous submission, preventing page reloads./legal/fruitful_holdings_nda.pdf
.Action: Save and exit `nano` (`Ctrl + X`, then `Y`, then `Enter`).
cd ..
Logic: Ensures you are in the correct directory to create/edit `server.js`.
nano server.js
Key Logic & Features:
app.use(express.static(path.join(__dirname)))
allows serving HTML, CSS, JS files directly from the `scripts` directory and its subdirectories (like `legal`).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.smtp.zoho.com
, port 465, secure SSL).Action: Save and exit `nano` (`Ctrl + X`, then `Y`, then `Enter`).
/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.
After all files are in place, start your server from the scripts
directory.
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.
http://localhost:3000/legal/securesign.html
Logic: This URL directs your browser to the `securesign.html` page served by your local Node.js server.
For deploying your application (e.g., using Vercel), your GitHub repository should reflect a specific structure, separating frontend static assets from backend serverless functions.
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)
You can use git push
if you're comfortable with Git, or directly upload via the GitHub website.
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
.
Error: Cannot find module 'express'
or other modules:**
Cause: Node.js cannot find the installed packages. Usually due to `node_modules` being missing or corrupted, or `npm install` not running successfully in the correct directory.
Fix: Navigate to your `scripts` directory and run: rm -rf node_modules package-lock.json && npm install
Cannot GET /
:**
Cause: The server doesn't have a route defined for the root URL, or you're accessing the wrong path.
Fix: Ensure your `server.js` has a route for the specific path you're trying to access (e.g., `/legal/securesign.html`). Access the portal using the full path: http://localhost:3000/legal/securesign.html
.
SyntaxError: Unexpected token ')'
or other syntax errors in `server.js`:**
Cause: Usually a copy-paste error or a malformed comment/code snippet.
Fix: Re-copy the entire `server.js` code from the latest Canvas and paste it into your `server.js` file, ensuring no extra characters or incomplete lines.
npm error code EJSONPARSE
in `package.json`:**
Cause: JSON files (like `package.json`) do not allow JavaScript-style comments (`//`).
Fix: Remove all comments from your `package.json` file.
Cause: Incorrect SMTP host/port/secure settings, wrong email username/password, or firewall/security blocking.
Fix: Double-check `host`, `port`, `secure`, `user`, and `pass` in `transporter` config in `server.js`. Ensure you're using the correct password or app-specific password for your Zoho Mail account. Check your email provider's settings (e.g., allow less secure apps for Gmail, or generate an app password).
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.