storyweaver


Namestoryweaver JSON
Version 0.1.0 PyPI version JSON
download
home_pageNone
SummarySets up React with Storybook for component-driven development, including a FastAPI server to mock API responses from user-generated JSON files. Automates Storybook configuration, story generation, and optional mock server startup.
upload_time2024-05-29 22:25:19
maintainerNone
docs_urlNone
authorAli Tavallaie
requires_python<4.0,>=3.10
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # StoryWeaver

## Overview
StoryWeaver sets up a React environment with Storybook for component-driven development and testing. It includes an integrated FastAPI server to mock API responses using user-generated JSON files. The setup script automates Storybook configuration, story generation for React components, and optional FastAPI mock server startup, enhancing the development workflow.

## Features
- **Storybook Integration**: Automatically configures Storybook for your React project.
- **Story Generation**: Generates story files for each React component.
- **API Mocking**: Uses FastAPI to mock API responses from user-provided JSON files.

## Installation

1. **Clone the Repository**

   ```bash
   git clone https://github.com/yourusername/storyweaver.git
   cd storyweaver
   ```

2. **Install Dependencies**

   Using [Poetry](https://python-poetry.org/):

   ```bash
   poetry install
   ```

3. **Initialize Your React Project**

   If you haven't already, set up your React project and install Storybook:

   ```bash
   npx create-react-app my-project
   cd my-project
   npx sb init
   ```

## Usage

1. **Setup Storybook and Generate Stories**

   ```bash
   poetry run python setup_storybook.py path/to/components
   ```

2. **Optionally, Start the FastAPI Mock Server**

   ```bash
   poetry run python setup_storybook.py path/to/components --mock
   ```

3. **Run Storybook**

   ```bash
   npm run storybook
   ```

## Project Structure

- **setup_storybook.py**: Script to configure Storybook and generate stories.
- **mock_api.py**: FastAPI server script to mock API responses.
- **mock_api**: Directory containing user-generated JSON files for API responses.

<!-- ## Example

Here's an example of how you might structure your project:

```
my-project/
│
├── src/
│   ├── components/
│   │   ├── Button.js
│   │   └── Header.js
│   └── ...
├── .storybook/
│   ├── main.js
│   └── preview.js
├── mock_api/
│   ├── users.json
│   └── products.json
├── setup_storybook.py
├── mock_api.py
└── ...
``` -->

## Contributing

Contributions are welcome! Please open an issue or submit a pull request with your changes.

## License

This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.



            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "storyweaver",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.10",
    "maintainer_email": null,
    "keywords": null,
    "author": "Ali Tavallaie",
    "author_email": "a.tavallaie@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/84/e8/34a6cdf9b9105eae581b65c99502a73d06b6a95285bc3e456cf13c9cfeb1/storyweaver-0.1.0.tar.gz",
    "platform": null,
    "description": "# StoryWeaver\n\n## Overview\nStoryWeaver sets up a React environment with Storybook for component-driven development and testing. It includes an integrated FastAPI server to mock API responses using user-generated JSON files. The setup script automates Storybook configuration, story generation for React components, and optional FastAPI mock server startup, enhancing the development workflow.\n\n## Features\n- **Storybook Integration**: Automatically configures Storybook for your React project.\n- **Story Generation**: Generates story files for each React component.\n- **API Mocking**: Uses FastAPI to mock API responses from user-provided JSON files.\n\n## Installation\n\n1. **Clone the Repository**\n\n   ```bash\n   git clone https://github.com/yourusername/storyweaver.git\n   cd storyweaver\n   ```\n\n2. **Install Dependencies**\n\n   Using [Poetry](https://python-poetry.org/):\n\n   ```bash\n   poetry install\n   ```\n\n3. **Initialize Your React Project**\n\n   If you haven't already, set up your React project and install Storybook:\n\n   ```bash\n   npx create-react-app my-project\n   cd my-project\n   npx sb init\n   ```\n\n## Usage\n\n1. **Setup Storybook and Generate Stories**\n\n   ```bash\n   poetry run python setup_storybook.py path/to/components\n   ```\n\n2. **Optionally, Start the FastAPI Mock Server**\n\n   ```bash\n   poetry run python setup_storybook.py path/to/components --mock\n   ```\n\n3. **Run Storybook**\n\n   ```bash\n   npm run storybook\n   ```\n\n## Project Structure\n\n- **setup_storybook.py**: Script to configure Storybook and generate stories.\n- **mock_api.py**: FastAPI server script to mock API responses.\n- **mock_api**: Directory containing user-generated JSON files for API responses.\n\n<!-- ## Example\n\nHere's an example of how you might structure your project:\n\n```\nmy-project/\n\u2502\n\u251c\u2500\u2500 src/\n\u2502   \u251c\u2500\u2500 components/\n\u2502   \u2502   \u251c\u2500\u2500 Button.js\n\u2502   \u2502   \u2514\u2500\u2500 Header.js\n\u2502   \u2514\u2500\u2500 ...\n\u251c\u2500\u2500 .storybook/\n\u2502   \u251c\u2500\u2500 main.js\n\u2502   \u2514\u2500\u2500 preview.js\n\u251c\u2500\u2500 mock_api/\n\u2502   \u251c\u2500\u2500 users.json\n\u2502   \u2514\u2500\u2500 products.json\n\u251c\u2500\u2500 setup_storybook.py\n\u251c\u2500\u2500 mock_api.py\n\u2514\u2500\u2500 ...\n``` -->\n\n## Contributing\n\nContributions are welcome! Please open an issue or submit a pull request with your changes.\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.\n\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Sets up React with Storybook for component-driven development, including a FastAPI server to mock API responses from user-generated JSON files. Automates Storybook configuration, story generation, and optional mock server startup.",
    "version": "0.1.0",
    "project_urls": null,
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4ea1425b78ab4ff38d062d845b2e95e05014ad5c27a3253638d5f88491cee52e",
                "md5": "bfbbcaa71c2bd317712b93c5c5d8184a",
                "sha256": "7715e976da58883de96beb391cfbe7f83fe294d2224055b2b306b3511fda891d"
            },
            "downloads": -1,
            "filename": "storyweaver-0.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "bfbbcaa71c2bd317712b93c5c5d8184a",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.10",
            "size": 4648,
            "upload_time": "2024-05-29T22:25:15",
            "upload_time_iso_8601": "2024-05-29T22:25:15.374405Z",
            "url": "https://files.pythonhosted.org/packages/4e/a1/425b78ab4ff38d062d845b2e95e05014ad5c27a3253638d5f88491cee52e/storyweaver-0.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "84e834a6cdf9b9105eae581b65c99502a73d06b6a95285bc3e456cf13c9cfeb1",
                "md5": "59d3ad4f97bc1663ef8ab7cb0dd14a43",
                "sha256": "f51d89f9988cb7fedc95c2083a5a7dd0f625d11231624d480927863593127806"
            },
            "downloads": -1,
            "filename": "storyweaver-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "59d3ad4f97bc1663ef8ab7cb0dd14a43",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.10",
            "size": 3679,
            "upload_time": "2024-05-29T22:25:19",
            "upload_time_iso_8601": "2024-05-29T22:25:19.766150Z",
            "url": "https://files.pythonhosted.org/packages/84/e8/34a6cdf9b9105eae581b65c99502a73d06b6a95285bc3e456cf13c9cfeb1/storyweaver-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-05-29 22:25:19",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "storyweaver"
}
        
Elapsed time: 4.68329s