{"id":17657045,"url":"https://github.com/indrajeetpatil/chatgpt-clone","last_synced_at":"2025-10-25T10:10:04.937Z","repository":{"id":258568825,"uuid":"867667262","full_name":"IndrajeetPatil/chatgpt-clone","owner":"IndrajeetPatil","description":"A Minimal Clone of ChatGPT","archived":false,"fork":false,"pushed_at":"2025-03-21T17:40:13.000Z","size":48072,"stargazers_count":7,"open_issues_count":4,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-31T09:41:14.436Z","etag":null,"topics":["full-stack-web-development"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/IndrajeetPatil.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2024-10-04T13:47:02.000Z","updated_at":"2025-02-06T22:16:21.000Z","dependencies_parsed_at":"2025-01-04T02:34:05.767Z","dependency_job_id":"6032b205-851b-4aa5-bfd6-8c9620e09431","html_url":"https://github.com/IndrajeetPatil/chatgpt-clone","commit_stats":null,"previous_names":["indrajeetpatil/chatgpt-clone"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IndrajeetPatil%2Fchatgpt-clone","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IndrajeetPatil%2Fchatgpt-clone/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IndrajeetPatil%2Fchatgpt-clone/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IndrajeetPatil%2Fchatgpt-clone/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/IndrajeetPatil","download_url":"https://codeload.github.com/IndrajeetPatil/chatgpt-clone/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252873851,"owners_count":21817708,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["full-stack-web-development"],"created_at":"2024-10-23T14:37:57.478Z","updated_at":"2025-10-25T10:09:59.885Z","avatar_url":"https://github.com/IndrajeetPatil.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ChatGPT Clone\n\n\nThis is a minimal clone of the [ChatGPT\nwebsite](https://chat.openai.com/).\n\n## Requirements\n\nThe specified requirements were the following:\n\n- Use Django as the backend and React as the frontend.\n- Allow users to select between GPT-4o and GPT-4o mini and change the\n  temperature of the responses (0.2, 0.7, and 0.9).\n- Request answers in Markdown format and display the answers in respect\n  to the given format.\n\n## Implementation\n\n![](demo.mov)\n\nIf the video is not accessible on GitHub README, have a look at it\n[here](https://github.com/IndrajeetPatil/chatgpt-clone/blob/main/demo.mov).\n\n## Architecture/Design\n\nThe project is structured as a monorepo with two services:\n\n- `frontend`: A React application that allows users to interact with the\n  GPT-4o model.\n- `server`: A Django application that serves as the backend for the\n  frontend application.\n\nThe frontend service is a Next.js application that uses the `swr`\nlibrary to fetch data from the backend service. The backend service is a\nDjango application that uses the `djangorestframework` library to expose\na REST API that interacts with the OpenAI GPT-4o model.\n\nThe UI is built with [Material\nUI](https://mui.com/material-ui/getting-started/) components and follows\nGoogle’s Material Design.\n\n## Setup\n\n- Clone the repository\n- Create `server/.env` file (cf. `server/.env.example`)\n- Restore needed dependencies:\n\n``` bash\n# backend\ncd server\nuv sync --frozen\n\n# frontend\ncd frontend\nnpm install\n```\n\n- Run the services:\n\n``` bash\ndocker-compose up\n```\n\n- The frontend service is available at `http://localhost:3000`\n- The backend service is available at `http://localhost:8000`\n\nREST API can be interactively explored using Swagger UI:  \n`http://localhost:8000/api/schema/swagger-ui/`\n\n## Quality Assurance\n\n### Automated checks\n\nThe frontend and backend services have their own quality checks\n(linters, formatters, static type checkers, OpenAPI schema validation,\nunit testing, code coverage).\n\nAssuming you have the necessary tools locally installed, these checks\ncan be run locally using the following commands:\n\n``` bash\nmake qa\n```\n\nMore specifically:\n\n| Step            | Frontend   | Backend  |\n|-----------------|------------|----------|\n| Package Manager | npm        | uv       |\n| Formatter       | biome      | ruff     |\n| Linter          | biome      | ruff     |\n| Type checking   | Typescript | mypy     |\n| Unit testing    | jest       | pytest   |\n| End-to-end test | Playwright | \\-       |\n| Code coverage   | jest       | coverage |\n| API client      | axios      | openai   |\n| API server      | \\-         | django   |\n| Import sorter   | biome      | ruff     |\n| Logger          | pino       | loguru   |\n\nThese checks are also run on every push to the repository using GitHub\nActions.\n\n### Manual checks\n\n- UI (Desktop + mobile view) checked on multiple browsers: Chrome,\n  Safari, Edge\n- Deployment checked on two Operating Systems: macOS, Windows\n- Accessibility and performance checks with\n  [Lighthouse](https://developers.google.com/web/tools/lighthouse)\n\n![Lighthouse report](./lighthouse.png)\n\n## Grievances/Mistakes\n\n- Using Django framework only for the API server seemed like an\n  overkill. fastAPI would have been a better choice.\n\n- Using Next.js only for the frontend was a total overkill. A vanilla\n  React app would have sufficed. But it was a good exercise to learn\n  Next.js, especially server-side rendering, the distinction between\n  client and server components, and the API routes.\n\n## Room for Improvement\n\n- Although this is PoC project that uses a monorepo approach to host the\n  entire stack, the production-grade project should use separate\n  repositories for the ease of development, maintenance, and deployment.\n\n- The project could be improved by adding more features like user\n  authentication and saving chat history.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Findrajeetpatil%2Fchatgpt-clone","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Findrajeetpatil%2Fchatgpt-clone","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Findrajeetpatil%2Fchatgpt-clone/lists"}