openapi: 3.0.0
info:
  title: Pterocos
  description: |
    Welcome to the official docs of pterocos.eu.org. 
    About Pterocos,
    Pterocos is a Free Online Code Editor for Python, Rust, PHP, SQL, Java, C#, Ruby, Lua & More

    Open-source, browser-based code editor that supports 10+ programming languages including Python, Rust, PHP, SQL (SQLite & DuckDB), Java, C#, Ruby, Lua, and frontend tools like HTML/CSS/JS with SCSS and TypeScript support. Powered by the Monaco Editor (the engine behind VS Code), it features syntax highlighting, intelligent autocomplete, and a built-in AI assistant for debugging and code generation.

    Perfect for developers, students, and educators who need a fast, secure, and accessible online code editor for testing snippets, prototyping ideas, or sharing runnable examples with teammates. Whether you're debugging a Python script, testing a Rust function, or prototyping an SQL query, Pterocos makes coding frictionless.

    Available at https://pterocos.eu.org
  version: 1.0.0
  contact:
    name: Amine KHD
    url: https://github.com/aminkheddache-dotcom/Pterocos
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0
servers:
  - url: https://pterocos.eu.org
    description: Live demo of Pterocos

# Define your categories (Topics) here
tags:
  - name: Getting started
    description: Getting started with Pterocos
  - name: AI for coding
    description: AI coding assistance
  - name: Preprocessors
    description: HTML CSS Javascript Preprocessors
  - name: FAQ
    description: Frequently Asked Questions
  - name: .JC files
    description: Learn about .JC files
  - name: Contact the Maintainer
    description: Get in touch with the maintainer

paths:
  /how-to-start:
    get:
      summary: How to start
      description: |
        Welcome to Pterocos! To start using the editor:
        1. Open your browser and go to https://pterocos.eu.org
        2. Select the language you want to code with or just click [Start Coding] button on topbar.
        3. You'll find yourself at https://pterocos.eu.org/?page_id=15
        4. Start your journey by creating your first folder name it anything you want.
        5. Open the folder you've created
        6. Create your first File select the lang you want PHP, Lua or anything 
        7. Done. you can start coding
        
        No signup, no installation, just code instantly.
      tags:
        - Getting started
  /create-file:
    get:
      summary: How do I create a file
      description: |
        To create a new file in Pterocos:
        1. Inside the code editor https://pterocos.eu.org/?page_id=15 after choosing the folder you want
        2. you'll find yourself at a area asks you to create a file
        3. Create [+ New File] there please select file name and the lang you want. (php or anything)
        4. Create file and done. open it and start coding
        
      tags:
        - Getting started
  /create-folder:
    get:
      summary: How do I create a folder
      description: |
        To create a folder in Pterocos:
        1. Go to https://pterocos.eu.org/?page_id=15
        2. Click on [+ New Folder] button
        3. Choose a name for the folder
        4. Click Create button and done.
        
      tags:
        - Getting started
  /how-to-use-ai:
    get:
      summary: How to use AI for coding
      description: |
        Pterocos includes an AI assistant to help you code:
        1. Go to your editor (on the code editor of each lang - inside editor)
        2. Click on (Use AI Builder) on sidebar
        3. After that the ai chat will appear, it'll ask you to complete a captcha 
        4. After succcessfully settings up the captcha you can use the AI
        
      tags:
        - AI for coding
  /getting-help:
    get:
      summary: Getting help
      description: |
        Need help? Here's how to get assistance:
        Use the built-in AI chat for instant help with code.
        1. Go to your editor (on the code editor of each lang - inside editor)
        2. Click on (Use AI Builder) on sidebar
        3. After that the ai chat will appear, it'll ask you to complete a captcha 
        4. After succcessfully settings up the captcha you can use the AI
      tags:
        - AI for coding
  /use-own-api:
    get:
      summary: I want to use my own API for the AI
      description: |
        How to use your own AI API on Pterocos:
        
        Follow these steps to configure your own AI API:
        
        1. Go to the inside coding editor of each language (PHP, Python, Rust, etc.).
        2. Click on "Use my own AI API" on the sidebar.
        3. Configure it (enter your API key and endpoint).
        4. Click "Save & use my API" button and done.
        
        **Privacy Note:** Pterocos does not store your AI API data on its servers. Your API key is hidden and stored securely in your browser's local storage. Only you have access to it, and it is never sent to Pterocos servers.
        
        You can now use your own AI API for code assistance.
      tags:
        - AI for coding
  /change-preprocessors:
    get:
      summary: How to change HTML CSS Javascript Preprocessors
      description: |
        Pterocos supports preprocessors for HTML, CSS, and JavaScript:
        Two methods:
        Method 1: Outside the code editor from the file creation area, 
        1. Click on [+ New File] button
        2. Select (HTML CSS JS) 
        3. Click on [Configuration] button.
        4. Choose the preprocessors you want.
        
        Method 2: Inside the Editor
        1. Click on the gear button ⚙️ (you'll find it inside the editor cards on html, css or js)
        2. Choose the preprocessor you want to change to
        3. Save and done. 
      tags:
        - Preprocessors
  /general-questions:
    get:
      summary: General Questions
      description: |
        **Frequently Asked Questions**
        
        **Q: Is Pterocos free to use?**
        A: Yes, Pterocos is completely free and open-source under the Apache 2.0 license.
        
        **Q: Do I need to create an account?**
        A: No, you can use Pterocos without signup or installation.
        
        **Q: What languages does Pterocos support?**
        A: PHP, Python, Rust, C#, SQL, HTML/CSS/JS, Lua, Ruby, Java, C++, C(.net) JSON, and More
        
        **Q: Can I save my projects?**
        A: Yes, you can save.
        
        **Q: Where can I report a bug?**
        A: Please report issues on our GitHub repository.
        
        (You can add more Q&A here.)
      tags:
        - FAQ
  /what-is-jc:
    get:
      summary: What is it?
      description: |
        **What are .JC Files?**
        
        .JC files work like a zip for files. Pterocos allows multiple coding language files inside it. From the same language, making it very good for complex tasks and construction. It collects all your selected language codes into one convenient file.
        
        **Benefits:**
        - **Organization:** Keep related code files together.
        - **Complex Tasks:** Manage multi-file projects easily.
        - **Construction:** Build and share complete code projects.
      tags:
        - .JC files
  /contact:
    get:
      summary: Contact
      description: |
        **Contact the Maintainer**
        
        If you have any questions, suggestions, or need support, feel free to reach out:
        
        **Email:** lackhosting@gmail.com
        
        You can also open an issue on our GitHub repository:
        https://github.com/aminkheddache-dotcom/Pterocos
      tags:
        - Contact the Maintainer