Skip to main content

Quick Start Guide

This guide will walk you through creating your first polyglot project with PPM, combining JavaScript and Python in a single, unified workflow.

What We’ll Build

A full-stack web application with:
  • React frontend (JavaScript/TypeScript)
  • Flask backend (Python)
  • Real-time data processing using NumPy and Pandas
  • Unified development workflow with PPM

Prerequisites

Before starting, make sure you have:
1

Install PPM

If you haven’t already, install PPM using our one-liner:Windows:
macOS/Linux:
2

Verify Installation

You should see the PPM version number.
3

Check Dependencies

Make sure you have Node.js and Python installed:

Step 1: Create a New Project

Initialize a new PPM project:
This creates a new directory with a basic project.toml configuration file.

Step 2: Set Up Project Structure

Create the basic project structure:
Your project should now look like:

Step 3: Configure Dependencies

Edit the project.toml file to define your dependencies:

Step 4: Install Dependencies

Now install all dependencies with a single command:
PPM will automatically:
  • Create and activate a Python virtual environment
  • Install all JavaScript packages in the appropriate directory
  • Install all Python packages in the virtual environment
  • Set up the project for development

Step 5: Create the Frontend

Frontend Package Configuration

Create frontend/package.json:

Vite Configuration

Create frontend/vite.config.ts:

React Application

Create frontend/src/App.tsx:

Entry Point and HTML

Create frontend/src/main.tsx:
Create frontend/index.html:

Step 6: Create the Backend

Python Requirements

Create backend/requirements.txt:

Flask Application

Create backend/app.py:

Step 7: Run Your Application

Now comes the magic! Start both frontend and backend with a single command:
This will:
  1. Start the Python Flask backend on port 5000
  2. Start the React development server on port 3000
  3. Run both simultaneously with proper environment activation

Step 8: See It in Action

  1. Open your browser to http://localhost:3000
  2. See the React frontend displaying data from the Python backend
  3. Click “Refresh Data” to see new random data generated by NumPy
  4. Watch the real-time communication between JavaScript and Python

What Just Happened?

Unified Dependencies

PPM installed both npm and pip packages from a single configuration file

Environment Management

Python virtual environment was created automatically, Node.js dependencies managed separately

Cross-Language Scripts

One command started both frontend and backend with proper environment activation

Seamless Integration

React frontend communicates with Python backend through well-configured CORS

Compare with Traditional Approach

Without PPM (Traditional)

With PPM

Next Steps

Now that you have a working polyglot application, explore more PPM features:

Add More Dependencies

Learn how to add new JavaScript or Python packages

Advanced Configuration

Explore advanced project.toml configurations

Production Deployment

Set up CI/CD pipelines with PPM

More Examples

Explore more complex project examples

Troubleshooting

Make sure the Python backend is running on port 5000. Check the terminal for any Flask errors.
PPM creates a virtual environment automatically. If you see import errors, try:
If ports 3000 or 5000 are busy, you can change them in the configuration files or kill the processes using those ports.

🎉 Congratulations! You’ve built your first polyglot application with PPM. You’ve experienced firsthand how PPM eliminates the complexity of managing multiple package ecosystems while maintaining the power and flexibility of each language.