FormSync

FormSync - Real-time Collaborative Forms

πŸš€ Quick Start

Prerequisites

Installation & Running

  1. Install dependencies:
    npm run install-all
    
  2. Start the application:

    Option 1 - Using the batch file (Windows):

    start-all.bat
    

    Option 2 - Using PowerShell (Windows):

    .\start-all.ps1
    

    Option 3 - Using npm (Cross-platform):

    npm start
    
  3. Access the application:
    • Open your browser to: http://localhost:8080
    • The server API runs on: http://localhost:3001

Troubleshooting Connection Issues

If you see connection errors:

  1. Test the connection:
    • Open http://localhost:8080/test-connection.html
    • You should see β€œβœ… Connected to server!”
  2. Check services are running:
    • Server should be on port 3001
    • Client should be on port 8080
    • MongoDB should be on port 27017
  3. Common fixes:
    • Use localhost instead of 127.0.0.1 in your browser
    • Clear browser cache and reload
    • Check Windows Firewall isn’t blocking the ports

Overview

A modern web application for creating and collaborating on forms in real-time with integrated video chat functionality.

Features

Tech Stack

Frontend

Backend

Project Structure

FormSync/
β”œβ”€β”€ public/                # Frontend static files
β”‚   β”œβ”€β”€ index.html        # Main HTML file
β”‚   β”œβ”€β”€ css/              # Stylesheets
β”‚   β”‚   β”œβ”€β”€ main.css      # Main styles
β”‚   β”‚   β”œβ”€β”€ components.css # Component styles
β”‚   β”‚   └── animations.css # Animations
β”‚   β”œβ”€β”€ js/               # JavaScript files
β”‚   β”‚   β”œβ”€β”€ app.js        # Main app entry
β”‚   β”‚   β”œβ”€β”€ components/   # UI components
β”‚   β”‚   β”œβ”€β”€ services/     # Services (API, Socket, etc)
β”‚   β”‚   └── utils/        # Utility functions
β”‚   └── assets/           # Images, fonts, etc
β”‚
β”œβ”€β”€ server/               # Node.js backend
β”‚   β”œβ”€β”€ config/          # Configuration files
β”‚   β”œβ”€β”€ controllers/     # Route controllers
β”‚   β”œβ”€β”€ middleware/      # Express middleware
β”‚   β”œβ”€β”€ models/          # Mongoose models
β”‚   β”œβ”€β”€ routes/          # API routes
β”‚   β”œβ”€β”€ services/        # Business logic
β”‚   └── package.json
β”‚
β”œβ”€β”€ shared/              # Shared constants
└── package.json         # Root package.json

Prerequisites

Installation

  1. Clone the repository
    git clone https://github.com/yourusername/formsync.git
    cd formsync
    
  2. Install dependencies
    cd server && npm install
    cd ..
    
  3. Set up environment variables

    Create a .env file in the server directory:

    # Server Configuration
    NODE_ENV=development
    PORT=3001
    
    # MongoDB Configuration
    MONGODB_URI=mongodb://localhost:27017/
    
    # Client URL
    CLIENT_URL=http://localhost:5173
    
    # JWT Secret
    JWT_SECRET=your-super-secret-jwt-key
    
    # Session Secret
    SESSION_SECRET=your-super-secret-session-key
    
  4. Start MongoDB
    # If using local MongoDB
    mongod
    
  5. Run the application

    Development mode (from root directory):

    npm run dev
    

    This will start the server on port 3001. The frontend is served directly by Express.

Usage

  1. Access the application
    • Open http://localhost:3001 in your browser
  2. Create a new form
    • Enter your name
    • Click β€œCreate New Form”
    • Select a template
    • Share the form code with collaborators
  3. Join an existing form
    • Enter your name
    • Click β€œJoin Existing”
    • Enter the 6-character form code
  4. Collaborate
    • Edit form fields in real-time
    • See who’s editing what with field locking
    • Use video chat to communicate
    • Take and share screenshots

API Endpoints

Forms

Authentication

Users

Screenshots

Socket Events

Client β†’ Server

Server β†’ Client

Development

Code Style

Testing

# Run server tests
cd server && npm test

# Run client tests
cd client && npm test

Building for Production

# Build client
cd client && npm run build

# The built files will be in client/dist

Deployment

Environment Variables for Production

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Future Enhancements

License

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

Acknowledgments


Built with ❀️ by the FormSync team