Skip to content

darefat/kfsquare

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

180 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

KFSQUARE - Data Analytics & Predictive Modeling

Production Ready Cross Platform Node.js Docker Security

Overview

KFSQUARE is a data engineering and analytics company leveraging cutting-edge Large Language Models (LLM) to deliver predictive analysis and transformative insights for businesses. This modern, responsive, platform-agnostic website showcases our services and provides an interactive platform for client engagement across Windows, macOS, and Linux systems.

🌐 Cross-Platform Support

Supported Platforms

  • βœ… Windows (10/11, Server 2016/2019/2022)
  • βœ… macOS (Intel & Apple Silicon)
  • βœ… Linux (Ubuntu, CentOS, RHEL, Fedora, Arch, openSUSE)
  • βœ… Docker (Multi-architecture: AMD64, ARM64)
  • βœ… Cloud Platforms (AWS, Azure, GCP, Heroku, Vercel)

Browser Compatibility

  • βœ… Modern Browsers: Chrome, Firefox, Safari, Edge (latest)
  • βœ… Legacy Support: Internet Explorer 8+ (graceful degradation)
  • βœ… Mobile: iOS Safari, Android Chrome (responsive design)

πŸš€ Quick Start (Any Platform)

Prerequisites

Automated Setup (Recommended)

# Clone repository
git clone <your-repo-url>
cd kfsquare

# Option 1: Cross-platform shell script
./setup-cross-platform.sh      # Linux/macOS
bash setup-cross-platform.sh   # Windows Git Bash/WSL

# Option 2: Python setup utility (any platform)
python setup.py --setup        # Full automated setup
python3 setup.py --setup       # Linux/macOS alternative

Manual Setup

# 1. Install Node.js 18+ from https://nodejs.org
# 2. Clone and setup
git clone <your-repo-url>
cd kfsquare

# 3. Install Python requirements (optional, for utilities)
pip install -r requirements-minimal.txt
# OR for full development environment
pip install -r requirements.txt

# 4. Install Node.js dependencies
npm install

# 5. Configure environment
cp .env.example .env
# Configure Mailgun in .env (see below)

# 6. Start development
npm run dev
# OR fallback Python server
python -m http.server 8080

πŸ“¦ Platform-Specific Scripts

Windows

# Command Prompt
npm run dev
start-production.bat

# PowerShell
npm run dev
.\start-production.bat

# Git Bash (Recommended)
npm run dev
./start-production.sh

macOS/Linux

npm run dev
./start-production.sh

Cross-Platform Commands

# Setup and deployment
npm run setup     # Run setup script
npm run deploy    # Run deployment script
python setup.py --setup    # Python setup utility
python setup.py --health   # Check server health

# Development servers
npm run dev       # Node.js development server
npm run serve     # Python fallback server (any platform)
npm run serve:win # Python server (Windows specific)

# Utilities
npm run health    # Check server health
python setup.py --start    # Start development server (any platform)

πŸ“¦ Dependencies

Node.js Dependencies (Required)

{
  "express": "^5.1.0",
  "helmet": "^8.0.0",
  "compression": "^1.7.4",
  "express-rate-limit": "^7.4.1",
  "mailgun.js": "^10.2.3",
  "form-data": "^4.0.0",
  "cross-env": "^7.0.3"
}

Python Dependencies (Optional)

# Install minimal requirements
pip install -r requirements-minimal.txt

# OR install full development environment
pip install -r requirements.txt

Minimal Python Requirements:

  • requests>=2.31.0 - HTTP requests and health checks
  • python-dotenv>=1.0.0 - Environment variable management
  • colorama>=0.4.6 - Cross-platform colored output

Full Python Requirements: (for development)

  • Testing: pytest, black, flake8, mypy
  • Documentation: mkdocs, mkdocs-material
  • Security: bandit, safety
  • Monitoring: psutil, watchdog

βš™οΈ Environment Configuration

Create a .env file with the following variables:

# Server Configuration
NODE_ENV=production
PORT=3000

# Mailgun Email Configuration
MAILGUN_API_KEY=your_mailgun_api_key_here
MAILGUN_DOMAIN=mg.kfsquare.com
# MAILGUN_BASE_URL=https://api.mailgun.net   # or https://api.eu.mailgun.net for EU
RECIPIENT_EMAIL=customersupport@kfsquare.com

# Security Configuration
GENERAL_RATE_LIMIT=100
EMAIL_RATE_LIMIT=5
ALLOWED_ORIGINS=https://kfsquare.com,https://www.kfsquare.com

πŸ”§ Available Scripts

  • npm start: Start production server
  • npm run dev: Start development server
  • npm run build: Prepare for production (no build needed)
  • npm test: Run tests (not implemented)
  • ./deploy.sh: Full production deployment preparation

πŸ“Š API Endpoints

Health Check

GET /health

Returns server status and uptime information.

Contact Form

POST /send-email

Accepts contact form submissions with validation and rate limiting.

Request Body:

{
  "name": "Your Name",
  "email": "your.email@example.com",
  "message": "Your message here"
}

πŸ›‘οΈ Security Features

  • Content Security Policy (CSP)
  • HTTP Strict Transport Security (HSTS)
  • X-Frame-Options protection
  • Input validation and sanitization
  • Rate limiting (100 requests/15min general, 5 emails/hour)
  • CORS protection
  • Error handling without information leakage

🌐 Browser Support

  • Modern Browsers: Chrome, Firefox, Safari, Edge (latest versions)
  • Legacy Support: Internet Explorer 8+ (with graceful degradation)
  • Mobile: iOS Safari, Android Chrome (responsive design)

πŸ“± Responsive Design

  • Mobile First: Optimized for mobile devices
  • Tablet: Enhanced experience for tablet users
  • Desktop: Full-featured desktop experience
  • High DPI: Retina and high-resolution display support

πŸš€ Production Checklist

  • βœ… Environment variables configured
  • βœ… Dependencies installed
  • βœ… Security headers enabled
  • βœ… Rate limiting configured
  • βœ… SSL/HTTPS ready
  • βœ… Static file caching
  • βœ… Error handling
  • βœ… Health check endpoint
  • βœ… Graceful shutdown
  • βœ… Production logging

πŸ“ž Support

For technical support or questions:

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


KFSQUARE - Transforming Data into Insights πŸš€ ```

  1. Run the server:

    node server.js
  2. Open index.html in your browser. It's recommended to use a development server (e.g., serve) to avoid CORS issues.

Key Files

  • index.html: The main HTML file containing the website structure and content.
  • styles.css: CSS file for styling the website.
  • script.js: JavaScript file for handling form submission and client-side logic.
  • server.js: Node.js server file for handling form submissions and sending emails via Mailgun.
  • .env: File for storing sensitive information like API keys and email addresses.

Email Configuration (Mailgun)

Set these in your .env:

MAILGUN_API_KEY=your_mailgun_api_key_here
MAILGUN_DOMAIN=mg.kfsquare.com
# MAILGUN_BASE_URL=https://api.mailgun.net   # or https://api.eu.mailgun.net for EU
RECIPIENT_EMAIL=customersupport@kfsquare.com

The website includes a contact form that sends emails using Mailgun. The server-side code handles the email sending process via Mailgun SDK.

Important:

  • Make sure you have a Mailgun account and have created an API key with the necessary permissions.
  • Verify the "no-reply" email address with Mailgun to prevent emails from being marked as spam.

CORS Configuration

The server uses CORS to allow requests from the frontend. Make sure the CORS_ORIGIN environment variable is set to the correct URL of your frontend.

Input Validation

The server uses express-validator to validate the form data on the server-side.

Error Handling

The server includes error handling and logging to help identify and resolve issues.

Production Deployment

When deploying to production:

  • Set the environment variables directly in your hosting environment.
  • Ensure that the CORS origin is set to the correct URL of your production frontend.
  • Consider using a process manager like PM2 to keep the server running.

Contributing

Contributions are welcome! Please submit a pull request with your changes.

License

Β© 2025 KFSQUARE. All rights reserved.

About

No description, website, or topics provided.

Resources

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors