{"id":48781377,"url":"https://github.com/nothing9537/ai-companion","last_synced_at":"2026-04-13T14:34:48.737Z","repository":{"id":206306070,"uuid":"716267279","full_name":"nothing9537/ai-companion","owner":"nothing9537","description":"This is a project, where you can talk to AI Companions in real-time, which was pre-created by me, and create your custom Companions, by accept a fake subscription","archived":false,"fork":false,"pushed_at":"2024-01-19T18:06:55.000Z","size":1415,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-05-19T03:48:23.558Z","etag":null,"topics":["ai","clerk","langchain","nextjs","openai","pinecone","prisma-orm","react","react-hook-form","react-hooks","replicate","shadcn-ui","stripe","tailwindcss","upstash-redis","zustand"],"latest_commit_sha":null,"homepage":"https://ai-companion-dusky-five.vercel.app","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/nothing9537.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}},"created_at":"2023-11-08T19:27:58.000Z","updated_at":"2023-11-23T00:38:45.000Z","dependencies_parsed_at":"2023-11-15T22:28:53.265Z","dependency_job_id":null,"html_url":"https://github.com/nothing9537/ai-companion","commit_stats":null,"previous_names":["nothing9537/ai-companion"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/nothing9537/ai-companion","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nothing9537%2Fai-companion","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nothing9537%2Fai-companion/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nothing9537%2Fai-companion/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nothing9537%2Fai-companion/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nothing9537","download_url":"https://codeload.github.com/nothing9537/ai-companion/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nothing9537%2Fai-companion/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31757482,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-13T13:27:56.013Z","status":"ssl_error","status_checked_at":"2026-04-13T13:21:23.512Z","response_time":93,"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":["ai","clerk","langchain","nextjs","openai","pinecone","prisma-orm","react","react-hook-form","react-hooks","replicate","shadcn-ui","stripe","tailwindcss","upstash-redis","zustand"],"created_at":"2026-04-13T14:34:48.104Z","updated_at":"2026-04-13T14:34:48.729Z","avatar_url":"https://github.com/nothing9537.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).\n\n## Getting Started\n\nInstall dependencies and run the project\n\n```bash\nnpm i\n# and\nnpm run dev\n# or\nyarn dev\n# or\npnpm dev\n# or\nbun dev\n```\n----\n\n## About\n\nThis is an application for communicating with AI companions. All base variants were created using OpenAI, Replicate llama-2-13b model. The user can communicate with them in real time, create their own custom companions, but only with a subscription. The subscription is fake, and is regulated by Stripe.\n\nThe app supports theming, application has 2 themes: Dark and Light. \n\nIt also supports adaptability out of the box, thanks to TailwindCSS and shadcn-ui.\n\nAlso, the user can search for companions by category and description/name.\n\nThis is the basic functionality, let's look at each section in more detail\n\nSometimes companions may take a long time to respond, or not respond at all. You should either choose another companion, wait, or retry your request\n----\n\n## Architecture\n\nThe project was written on a modern Front-end architecture - FSD (Feature Sliced Design)\n\nRead more about the architecture - [here](https://feature-sliced.design/docs/get-started/overview)\n\nIn a nutshell, the architecture is a file structure divided into layers (hereafter referred to as `LAYER`'s). Each `LAYER` has its own slice (hereinafter referred to as `SLICE`'s), and each `SLICE` has its own segments (hereinafter referred to as `SEGMENT`'s).\n\nThe architecture is presented in a hierarchical structure: **`app/pages/widgets/features/entities/shared`**\n\n3 pillars of the architecture:\n\n1) Each `LAYER` can only import from underlying `LAYER`'s. That is, from pages can't import anything from app, can't use in `enitities` something from `widgets` / `features`, `shared` can't use anything \"from above\" at all. There are valid exceptions that are customized for the project, like redux state, some configs and such.\n\n2) Every SLICE should have a public-api, from which only what is really needed is exported, and nothing more.\n\n3) Also, you can't use `LAYER-in-LAYER`. The exceptions are `entities` (more on the types level) and `shared`. Shared doesn't really have much structure, basic `lib/api/types/config/ui` are welcome there. \n\n\n----\n\n## Users\n\nWhen a user accesses the site for the first time, they need to register / authorize through any available method, through the Clerk authentication system.\n\nIn the basic version of the account, the user can communicate with the available companions, but he can only create companions after signing up.\n\nFor fake subscription, use the following data: [here](/docs/subsciption.md)\n\n----\n\n## Companions\n\nCompanions are user-created AI models based on incoming data. They are close to communicating like a real person, with their own unique character that depends on the input parameters.\n\nYou can communicate with them without a fake subscription, and create your own with a fake subscription.\n\nThe llama-2-13b model was used for the companion model.\n\nList of project libraries related to AI\n\n- `pinecone` - vector database\n- `openai` - AI models, requests, Embeddings\n- `upstash`- Also Redis DB\n- `langchain`\n- `ai` - from vercel, used for live chat\n\n----\n\n## Scripts\n\n- `npm run dev - ` application launch in development mode\n- `npm run build - ` building an application for production mode via webpack\n- `npm run lint - ` runs ESlint rules compliance check\n- `npm run lint:fix - ` fix all auto-fixable ESLint problems\n- `npm run studio` - runs prisma.js studio to manage Database\n- `npm run db:update` - updates db and Schema in project\n- `npm run add:component` - adds component from shadcn-ui, for ex `npm run add:component button`\n\n----\n\n## Technology Stack\n\nThe main infrastructure of the application is built on a modern framework for building fullstack applications, NextJS 13. \n\nA complete list of the entire technology stack is given below\n\n- **[React 18](https://react.dev/learn)**\n- **[NextJS 13](https://nextjs.org/docs)**\n- **[Tailwind CSS](https://tailwindcss.com/docs/installation)**\n- **[Clerk](https://clerk.com/docs/quickstarts/nextjs)**\n- **[PlanetScale](https://planetscale.com/docs/concepts/what-is-planetscale)**\n- **[Prisma.js](https://www.prisma.io/docs/getting-started)**\n- **[react-hook-form](https://react-hook-form.com/get-started)**\n- **[shadcn-ui](https://ui.shadcn.com/docs)**\n- **[zustand](https://docs.pmnd.rs/zustand/getting-started/introduction)**\n- **[Stripe](https://stripe.com/docs/api)**\n- **[langchain](https://js.langchain.com/docs/get_started/introduction)**\n- **[pineconde](https://sdk.pinecone.io/typescript/)**\n- **[ai](https://sdk.vercel.ai/docs)**\n- **[replicate](https://github.com/replicate/replicate-javascript)**\n\n----\n\n## ORM\n\nPrisma.js, one of the most advanced solutions in this area, was chosen as ORM (Object-Oriental Mapping) technology for database querying. \n\nIn conjunction with the [vs-code extension](https://marketplace.visualstudio.com/items?itemName=Prisma.prisma), it allows you to conveniently compose models, generate a database object, as well as provides a convenient API for working with the database.\n\nAll described types in the model are installed in the project as a package, and they can be imported from any place from a single package throughout the project. \n\nPrisma also provides a handy prisma-studio **`(npx prisma studio)`** that allows direct interaction with the database, and supports all CRUD operations.\n\n----\n\n## Database\n\nPlanetScale cloud database was chosen as the database, which makes it very easy to set up databases. I used a MySQL database from PlanetScale to store all the application information.\n\nFor uploading images used [Cloudinary service](https://cloudinary.com/documentation/react_integration).\n\n----\n\n## Environment\n\nThe application infrastructure is built on the requirement of **Next JS** framework as it works based on the file and folder structure in the application.\n\nNavigation and working with backend endpoints is done through the folder and file structure.\n\nAs described above, the project was developed on FSD-architecture. It allows to easily decompose the code into its own areas of responsibility, no unnecessary dependencies between components are created, the project is easily scalable and maintainable\n\nThe `shared` layer contains many handy utilities for interacting with libraries. Hooks, classes, functions, and so on.\n\n----\n\n## Working with forms\n\nAlthough the application is not large, it contains a large number of forms. In the course of development we developed a wrapper component FormFieldWrapper, based on React.Context, which allows you to conveniently interact with props on the top level. [More about the component](/docs/form-field-wrapper.md)\n\n----\n\n## ENV Structure\n\n```js\nNEXT_PUBLIC_CLERK_PUBLISHABLE_KEY= /* Key for interaction with Clerk Authorization API */\n\nCLERK_SECRET_KEY= /* Clerk Secret Key */\n\nDATABASE_URL= /* Reference to the database, including authorization data */\n\nNEXT_PUBLIC_CLOUDINARY_CLOUD_NAME= /* Cloudinary key for images uploading */\n\nPINECONE_INDEX=\nPINECONE_ENVIRONMENT=\nPINECONE_API_KEY=\n\nUPSTASH_REDIS_REST_URL=\nUPSTASH_REDIS_REST_TOKEN=\n\nOPENAI_API_KEY=\n\nREPLICATE_API_TOKEN=\n\nSTRIPE_API_KEY=/* Stripe payment system */\nSTRIPE_WEBHOOK_SECRET=/* Stripe webhook */\n\nNEXT_PUBLIC_APP_URL=/* Website url */\n\n\n```\n----\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnothing9537%2Fai-companion","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnothing9537%2Fai-companion","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnothing9537%2Fai-companion/lists"}