{"id":18963391,"url":"https://github.com/pashamakhilkumarreddy/react-openapi","last_synced_at":"2026-04-08T18:31:12.139Z","repository":{"id":114635178,"uuid":"257691014","full_name":"pashamakhilkumarreddy/react-openapi","owner":"pashamakhilkumarreddy","description":"React OpenAPI","archived":false,"fork":false,"pushed_at":"2024-07-21T15:07:37.000Z","size":135,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-02T06:35:02.171Z","etag":null,"topics":["dockerfile","husky","nginx","openapi","react","typescript","vite"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pashamakhilkumarreddy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-04-21T19:08:51.000Z","updated_at":"2024-07-21T15:07:41.000Z","dependencies_parsed_at":null,"dependency_job_id":"33f0dcc4-5623-4f9b-8f02-7a7996efb75c","html_url":"https://github.com/pashamakhilkumarreddy/react-openapi","commit_stats":null,"previous_names":["pashamakhilkumarreddy/react-openapi"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pashamakhilkumarreddy/react-openapi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pashamakhilkumarreddy%2Freact-openapi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pashamakhilkumarreddy%2Freact-openapi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pashamakhilkumarreddy%2Freact-openapi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pashamakhilkumarreddy%2Freact-openapi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pashamakhilkumarreddy","download_url":"https://codeload.github.com/pashamakhilkumarreddy/react-openapi/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pashamakhilkumarreddy%2Freact-openapi/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31568576,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-08T14:31:17.711Z","status":"ssl_error","status_checked_at":"2026-04-08T14:31:17.202Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dockerfile","husky","nginx","openapi","react","typescript","vite"],"created_at":"2024-11-08T14:19:08.877Z","updated_at":"2026-04-08T18:31:12.132Z","avatar_url":"https://github.com/pashamakhilkumarreddy.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# React OpenAPI\n\nThis project is a React OpenAPI project built with React (Vite + Typescript + SWC), a framework designed for efficient and scalable UI applications. It also employs Docker for containerization, NVM for managing Node.js versions.\n\n## Prerequisites\n\n-   Node.js version 20.x.x (LTS)\n-   Docker (Optional)\n-   NVM (optional, for managing Node.js versions)\n\n## Table of Contents\n\n-   [Installation](#installation)\n-   [Usage](#usage)\n-   [Docker](#docker)\n-   [Testing](#testing)\n-   [Linting and Formatting](#linting-and-formatting)\n\n## Installation\n\nBefore starting, ensure you have [Node.js](https://nodejs.org/) installed. It's recommended to use [NVM](https://github.com/nvm-sh/nvm) to manage Node.js versions. The project uses the Node.js version specified in `.nvmrc`.\n\n1. Clone this repository:\n\n    ```bash\n    git clone https://github.com/pashamakhilkumarreddy/react-openapi.git\n    ```\n\n2. Navigate to the project directory:\n\n    ```bash\n    cd react-openapi\n    ```\n\n3. If using NVM, set the correct Node.js version:\n\n    ```bash\n    nvm use\n    ```\n\n4. Create a `.env` file in the project root directory and add the required environment variables (use `.env.example` as a reference).\n\n    ```bash\n    cp .env.example .env\n    ```\n\n5. Install dependencies:\n\n    ```bash\n    npm install\n    ```\n\n## Usage\n\nTo start the application:\n\n-   Development Mode:\n\n    ```bash\n    npm run dev\n    ```\n\n-   Production Mode:\n\n    ```bash\n    npm run build\n    ```\n\n## Docker\n\nThe project includes Docker Compose files for various environments. Ensure the necessary environment variables are set in the corresponding `.env` files (use `.env.example` as a reference).\n\n### Building Docker Images\n\nTo build and run the Dockerfile you provided, you'll need to follow these steps. The Dockerfile describes a multi-stage build process where the first stage is for building a Node.js application and the second stage is for serving the built application using Nginx. Here’s how you can do it:\n\n#### Step-by-Step Instructions\n\n1. **Build the Docker Image**\n\n    Open a terminal, navigate to the directory where your Dockerfile is located, and run the following command to build the Docker image. Replace `react-openapi` with your desired image name if different:\n\n    ```bash\n    docker build -t react-openapi .\n    ```\n\n    The `-t` flag tags the image with a name (`react-openapi` in this case). The `.` specifies the build context, which is the current directory.\n\n2. **Run the Docker Container**\n\n    Once the image is built, you can run a container from it using the following command:\n\n    ```bash\n    docker run -d -p 80:80 --name react-app react-openapi\n    ```\n\n3. **Access Your Application**\n\n    After running the container, you can access your application in a web browser by navigating to `http://localhost`. If you mapped a different port, adjust the URL accordingly.\n\n4. **Check Logs (Optional)**\n\n    If you need to check the logs to see if everything is running smoothly, you can use:\n\n    ```bash\n    docker logs my-react-app\n    ```\n\n5. **Stop and Remove the Container (Optional)**\n\n    To stop the container, use:\n\n    ```bash\n    docker stop my-react-app\n    ```\n\n    To remove the container, use:\n\n    ```bash\n    docker rm my-react-app\n    ```\n\n## Testing\n\n1. Run Tests:\n\n    ```bash\n    npm test\n    ```\n\n## Linting and Formatting\n\n1. Run ESLint:\n\n    ```bash\n    npm run lint\n    ```\n\n2. Format Code:\n\n    ```bash\n    npm run format:fix\n    ```\n\n### Pre-commit Hook\n\nPre-commit hooks using Husky and lint-staged enforce linting and formatting. To bypass these hooks temporarily:\n\n```bash\ngit commit --no-verify -m \"Your commit message\"\n```\n\n## Scripts\n\nKey npm scripts include:\n\n-   `npm run build`: Build the application for production.\n-   `npm run format`: Format code using Prettier.\n-   `npm run lint`: Lint code using ESLint.\n-   `npm run start`: Start the application in production mode.\n-   `npm run start:dev`: Start the application in development mode.\n-   `npm run start:debug`: Start the application in debug mode.\n\nRefer to the `package.json` file for more details.\n\n## Contributing\n\nFor contributing guidelines, see the [Contributing guide](./CONTRIBUTING.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpashamakhilkumarreddy%2Freact-openapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpashamakhilkumarreddy%2Freact-openapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpashamakhilkumarreddy%2Freact-openapi/lists"}