├── .editorconfig ├── .env.example ├── .eslintignore ├── .eslintrc.json ├── .github ├── ISSUE_TEMPLATE │ ├── bug-report.yml │ └── feature-request.yml ├── pull_request_template.md └── workflows │ └── auto-update-dependencies.yml ├── .gitignore ├── .husky └── pre-commit ├── .prettierignore ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── __tests__ └── .gitkeep ├── components.json ├── next.config.mjs ├── package-lock.json ├── package.json ├── postcss.config.js ├── prettier.config.js ├── public ├── favicon.ico ├── next.svg └── vercel.svg ├── src ├── app │ ├── api │ │ ├── auth │ │ │ └── [...nextauth] │ │ │ │ └── route.ts │ │ └── chat │ │ │ └── route.ts │ ├── chat │ │ └── [id] │ │ │ ├── page.tsx │ │ │ └── project.json │ ├── layout.tsx │ └── page.tsx ├── components │ ├── chat │ │ ├── chat-line.tsx │ │ └── chat.tsx │ ├── home │ │ ├── Homepage.tsx │ │ └── section │ │ │ ├── ExploreProjectsSection.tsx │ │ │ ├── FeaturesSection.tsx │ │ │ ├── HeroSection.tsx │ │ │ ├── ProjectCart.tsx │ │ │ ├── featuresData.tsx │ │ │ └── helper │ │ │ └── projects.ts │ └── ui │ │ ├── accordion.tsx │ │ ├── button.tsx │ │ ├── card.tsx │ │ ├── input.tsx │ │ ├── loginButton.tsx │ │ └── spinner.tsx ├── config │ ├── site.ts │ └── tailwind │ │ ├── colors.ts │ │ └── index.ts ├── constants │ └── .gitkeep ├── context │ └── .gitkeep ├── data │ └── .gitkeep ├── db │ └── .gitkeep ├── hooks │ └── .gitkeep ├── layout │ ├── footer │ │ └── Footer.tsx │ └── navbar │ │ └── Navbar.tsx ├── lib │ ├── config.ts │ ├── fonts.ts │ ├── index.ts │ ├── langchain.ts │ ├── llm.ts │ ├── pdf-loader.ts │ ├── pinecone-client.ts │ ├── prompt-templates.ts │ ├── utils copy.ts │ ├── utils.ts │ └── vector-store.ts ├── modules │ └── .gitkeep ├── queries │ └── .gitkeep ├── scripts │ └── pinecone-prepare-docs.ts ├── services │ └── .gitkeep ├── store │ └── .gitkeep └── styles │ └── globals.css ├── tailwind.config.ts ├── tsconfig.json └── types ├── index.ts ├── interface └── projectCard.ts └── root.d.ts /.editorconfig: -------------------------------------------------------------------------------- 1 | # editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | end_of_line = lf 7 | indent_size = 2 8 | indent_style = space 9 | insert_final_newline = true 10 | trim_trailing_whitespace = true -------------------------------------------------------------------------------- /.env.example: -------------------------------------------------------------------------------- 1 | # Required from external tools. 2 | OPENAI_API_KEY="your_openai_api_key_here" 3 | PINECONE_API_KEY="your_pinecone_api_key_here" 4 | 5 | 6 | # Usually for free Pinecone account environment is "us-east-1" 7 | PINECONE_ENVIRONMENT="your_pinecone_environment_here" 8 | 9 | # The index can be created directly or will 10 | # be created when you run prepare-data npm command 11 | PINECONE_INDEX_NAME="your_pinecone_index_name_here" 12 | 13 | 14 | # Pinecone index creation requires time so we wait for 3 minutes 15 | # If you don't want to wait, create the index on the Pinecone console 16 | # https://app.pinecone.io/organizations 17 | INDEX_INIT_TIMEOUT=5400000000 18 | 19 | # Vercel configuration 20 | VERCEL="your_vercel_configuration_here" 21 | 22 | # NextAuth configuration 23 | NEXTAUTH_URL="http://localhost:3000" 24 | NEXTAUTH_SECRET="your_nextauth_secret_here" 25 | 26 | # GitHub OAuth credentials 27 | GITHUB_ID="your_github_id_here" 28 | GITHUB_SECRET="your_github_secret_here" -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | dist/* 2 | .cache 3 | public 4 | node_modules 5 | *.esm.js -------------------------------------------------------------------------------- /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "plugins": ["@typescript-eslint"], 3 | "extends": [ 4 | "eslint:recommended", 5 | "next/core-web-vitals", 6 | "plugin:@typescript-eslint/recommended", 7 | "prettier" 8 | ], 9 | "rules": { 10 | "@typescript-eslint/no-unused-vars": "error", 11 | "@typescript-eslint/no-explicit-any": "off", 12 | "@typescript-eslint/semi": ["error"], 13 | "react-hooks/exhaustive-deps": "off" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug-report.yml: -------------------------------------------------------------------------------- 1 | name: "\U0001F41B [Bug report]:" 2 | description: Create a report to help us improve 3 | title: "\U0001F41B [Bug report]: " 4 | labels: ['bug'] 5 | assignees: [''] 6 | body: 7 | - type: markdown 8 | attributes: 9 | value: | 10 | Thanks for taking the time to fill out this bug report! 11 | 12 | - type: textarea 13 | id: what-happened 14 | attributes: 15 | label: Describe the bug? 16 | description: Tell us what you see! 17 | validations: 18 | required: true 19 | - type: textarea 20 | id: reproduce-step 21 | attributes: 22 | label: Steps to reproduce the bug? 23 | description: Steps to reproduce the behavior.. 24 | placeholder: | 25 | 1. Go to '...' 26 | 2. Click on '....' 27 | 3. Scroll down to '....' 28 | 4. See error 29 | validations: 30 | required: true 31 | 32 | - type: textarea 33 | id: expected-behavior 34 | attributes: 35 | label: Expected behavior 36 | description: A clear and concise description of what you expected to happen. 37 | validations: 38 | required: true 39 | 40 | - type: textarea 41 | id: desktop-details 42 | attributes: 43 | label: Desktop (Please provide your system information) 44 | description: | 45 | examples: 46 | - **OS**: [e.g. iOS] 47 | - **Browser** [e.g. chrome, safari] 48 | - **Version** [e.g. 22] 49 | validations: 50 | required: true 51 | 52 | - type: textarea 53 | id: mobile-browser 54 | attributes: 55 | label: Mobile (Please provide your device information) 56 | description: | 57 | examples: 58 | - **Device**: [e.g. iPhone6] 59 | - **OS**: [e.g. iOS8.1] 60 | - **Browser** [e.g. stock browser, safari] 61 | - **Version** [e.g. 22] 62 | - type: textarea 63 | id: screenshot 64 | attributes: 65 | label: Screenshot / ScreenShare 66 | description: If applicable, add screenshots to help explain your problem. 67 | 68 | - type: textarea 69 | id: additional-context 70 | attributes: 71 | label: Relevant log output 72 | description: Add any other context about the problem here. 73 | render: shell-script 74 | 75 | - type: checkboxes 76 | id: terms 77 | attributes: 78 | label: Code of Conduct 79 | description: By submitting this issue, you agree to follow our [Code of Conduct] 80 | options: 81 | - label: I agree to follow this project's Code of Conduct 82 | required: true 83 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature-request.yml: -------------------------------------------------------------------------------- 1 | name: Feature 2 | description: Add a feature request 3 | title: '[Feature Request]: ' 4 | labels: ['enhancement'] 5 | assignees: [''] 6 | body: 7 | - type: markdown 8 | attributes: 9 | value: | 10 | Please provide the issue details in below fields. 11 | 12 | - type: textarea 13 | id: problem-details 14 | attributes: 15 | label: Feature details 16 | description: Tell us in details about the problem. 17 | validations: 18 | required: true 19 | 20 | - type: textarea 21 | id: suggested-solution 22 | attributes: 23 | label: Suggested Solution 24 | description: Do you have solution in mind? Please post here. 25 | validations: 26 | required: true 27 | 28 | - type: textarea 29 | id: areas 30 | attributes: 31 | label: Affected areas 32 | placeholder: List down the affected areas 33 | validations: 34 | required: false 35 | 36 | - type: checkboxes 37 | id: terms 38 | attributes: 39 | label: Code of Conduct 40 | description: By submitting this issue, you agree to follow our [Code of Conduct] 41 | options: 42 | - label: I agree to follow this project's Code of Conduct 43 | required: true 44 | -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | > First thing, PLEASE READ THIS: [Code Review Checklist] 2 | 3 | # Description 4 | 5 | Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change. 6 | 7 | Fixes #(issue) 8 | 9 | ## Type of change 10 | 11 | Please delete options that are not relevant. 12 | 13 | - [ ] Bug fix (non-breaking change which fixes an issue) 14 | - [ ] New feature (non-breaking change which adds functionality) 15 | - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) 16 | - [ ] This change requires a documentation update 17 | 18 | # How Has This Been Tested? 19 | 20 | Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. 21 | 22 | # Checklist: 23 | 24 | - [ ] I have performed a self-review of my own code 25 | - [ ] I have commented my code, particularly in hard-to-understand areas 26 | - [ ] I have made corresponding changes to the documentation 27 | - [ ] My changes generate no new warnings 28 | - [ ] I have added tests that prove my fix is effective or that my feature works 29 | - [ ] New and existing unit tests pass locally with my changes 30 | - [ ] Any dependent changes have been merged and published in downstream modules 31 | 32 | # Screenshots or example output 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /.github/workflows/auto-update-dependencies.yml: -------------------------------------------------------------------------------- 1 | name: Update Dependencies 2 | 3 | on: 4 | schedule: 5 | - cron: '0 0 * * 0' 6 | workflow_dispatch: 7 | 8 | jobs: 9 | update: 10 | runs-on: ubuntu-latest 11 | steps: 12 | - name: Checkout code 13 | uses: actions/checkout@v4 14 | 15 | - name: Setup Node.js 16 | uses: actions/setup-node@v4 17 | with: 18 | node-version: '20' 19 | 20 | - name: Install dependencies 21 | run: npm ci 22 | 23 | - name: Check for updates 24 | id: check 25 | run: | 26 | npm outdated --json > outdated.json || echo "npm outdated command failed" 27 | if [ -s outdated.json ]; then 28 | echo "Updates found" 29 | echo "updates_found=true" >> $GITHUB_ENV 30 | else 31 | echo "No updates found" 32 | echo "updates_found=false" >> $GITHUB_ENV 33 | fi 34 | 35 | - name: Update dependencies 36 | if: env.updates_found == 'true' 37 | run: | 38 | npm update 39 | git config --global user.email "action@github.com" 40 | git config --global user.name "GitHub Action" 41 | git commit -am "Update dependencies" 42 | 43 | - name: Create Pull Request 44 | if: env.updates_found == 'true' 45 | uses: peter-evans/create-pull-request@v3 46 | with: 47 | title: 'Update dependencies' 48 | body: 'This PR updates the dependencies to their latest versions.' 49 | branch: 'update-dependencies' 50 | delete-branch: true 51 | commit-message: 'Update dependencies' 52 | labels: 'dependencies' 53 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # Logs 4 | logs 5 | *.log 6 | npm-debug.log* 7 | .env 8 | # Runtime data 9 | pids 10 | *.pid 11 | *.seed 12 | 13 | # Directory for instrumented libs generated by jscoverage/JSCover 14 | lib-cov 15 | 16 | # Coverage directory used by tools like istanbul 17 | coverage 18 | 19 | # nyc test coverage 20 | .nyc_output 21 | 22 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 23 | .grunt 24 | 25 | # node-waf configuration 26 | .lock-wscript 27 | 28 | # Compiled binary addons (http://nodejs.org/api/addons.html) 29 | build/Release 30 | 31 | # Dependency directories 32 | node_modules 33 | jspm_packages 34 | 35 | # Optional npm cache directory 36 | .npm 37 | 38 | # Optional REPL history 39 | .node_repl_history 40 | 41 | # dependencies 42 | /.pnp 43 | .pnp.js 44 | 45 | # next.js 46 | /.next/ 47 | /out/ 48 | 49 | # production 50 | /build 51 | 52 | # misc 53 | .DS_Store 54 | *.pem 55 | 56 | # debug 57 | npm-debug.log* 58 | yarn-debug.log* 59 | yarn-error.log* 60 | 61 | # local env files 62 | .env*.local 63 | .env 64 | # vercel 65 | .vercel 66 | 67 | # typescript 68 | *.tsbuildinfo 69 | next-env.d.ts 70 | 71 | .env 72 | src/app/chat/page.tsx 73 | -------------------------------------------------------------------------------- /.husky/pre-commit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | . "$(dirname -- "$0")/_/husky.sh" 3 | 4 | npx lint-staged -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | cache 2 | .cache 3 | package.json 4 | package-lock.json 5 | public 6 | CHANGELOG.md 7 | .yarn 8 | dist 9 | node_modules 10 | .next 11 | build 12 | .contentlayer -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | We as members, contributors, and leaders pledge to make participation in our 6 | community a harassment-free experience for everyone, regardless of age, body 7 | size, visible or invisible disability, ethnicity, sex characteristics, gender 8 | identity and expression, level of experience, education, socio-economic status, 9 | nationality, personal appearance, race, religion, or sexual identity 10 | and orientation. 11 | 12 | We pledge to act and interact in ways that contribute to an open, welcoming, 13 | diverse, inclusive, and healthy community. 14 | 15 | ## Our Standards 16 | 17 | Examples of behavior that contributes to a positive environment for our 18 | community include: 19 | 20 | - Demonstrating empathy and kindness toward other people 21 | - Being respectful of differing opinions, viewpoints, and experiences 22 | - Giving and gracefully accepting constructive feedback 23 | - Accepting responsibility and apologizing to those affected by our mistakes, 24 | and learning from the experience 25 | - Focusing on what is best not just for us as individuals, but for the 26 | overall community 27 | 28 | Examples of unacceptable behavior include: 29 | 30 | - The use of sexualized language or imagery, and sexual attention or 31 | advances of any kind 32 | - Trolling, insulting or derogatory comments, and personal or political attacks 33 | - Public or private harassment 34 | - Publishing others' private information, such as a physical or email 35 | address, without their explicit permission 36 | - Other conduct which could reasonably be considered inappropriate in a 37 | professional setting 38 | 39 | ## Enforcement Responsibilities 40 | 41 | Community leaders are responsible for clarifying and enforcing our standards of 42 | acceptable behavior and will take appropriate and fair corrective action in 43 | response to any behavior that they deem inappropriate, threatening, offensive, 44 | or harmful. 45 | 46 | Community leaders have the right and responsibility to remove, edit, or reject 47 | comments, commits, code, wiki edits, issues, and other contributions that are 48 | not aligned to this Code of Conduct, and will communicate reasons for moderation 49 | decisions when appropriate. 50 | 51 | ## Scope 52 | 53 | This Code of Conduct applies within all community spaces, and also applies when 54 | an individual is officially representing the community in public spaces. 55 | Examples of representing our community include using an official e-mail address, 56 | posting via an official social media account, or acting as an appointed 57 | representative at an online or offline event. 58 | 59 | ## Enforcement 60 | 61 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 62 | reported to the community leaders responsible for enforcement. 63 | All complaints will be reviewed and investigated promptly and fairly. 64 | 65 | All community leaders are obligated to respect the privacy and security of the 66 | reporter of any incident. 67 | 68 | ## Enforcement Guidelines 69 | 70 | Community leaders will follow these Community Impact Guidelines in determining 71 | the consequences for any action they deem in violation of this Code of Conduct: 72 | 73 | ### 1. Correction 74 | 75 | **Community Impact**: Use of inappropriate language or other behavior deemed 76 | unprofessional or unwelcome in the community. 77 | 78 | **Consequence**: A private, written warning from community leaders, providing 79 | clarity around the nature of the violation and an explanation of why the 80 | behavior was inappropriate. A public apology may be requested. 81 | 82 | ### 2. Warning 83 | 84 | **Community Impact**: A violation through a single incident or series 85 | of actions. 86 | 87 | **Consequence**: A warning with consequences for continued behavior. No 88 | interaction with the people involved, including unsolicited interaction with 89 | those enforcing the Code of Conduct, for a specified period of time. This 90 | includes avoiding interactions in community spaces as well as external channels 91 | like social media. Violating these terms may lead to a temporary or 92 | permanent ban. 93 | 94 | ### 3. Temporary Ban 95 | 96 | **Community Impact**: A serious violation of community standards, including 97 | sustained inappropriate behavior. 98 | 99 | **Consequence**: A temporary ban from any sort of interaction or public 100 | communication with the community for a specified period of time. No public or 101 | private interaction with the people involved, including unsolicited interaction 102 | with those enforcing the Code of Conduct, is allowed during this period. 103 | Violating these terms may lead to a permanent ban. 104 | 105 | ### 4. Permanent Ban 106 | 107 | **Community Impact**: Demonstrating a pattern of violation of community 108 | standards, including sustained inappropriate behavior, harassment of an 109 | individual, or aggression toward or disparagement of classes of individuals. 110 | 111 | **Consequence**: A permanent ban from any sort of public interaction within 112 | the community. 113 | 114 | ## Attribution 115 | 116 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], 117 | version 2.0, available at 118 | https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. 119 | 120 | Community Impact Guidelines were inspired by [Mozilla's code of conduct 121 | enforcement ladder](https://github.com/mozilla/diversity). 122 | 123 | [homepage]: https://www.contributor-covenant.org 124 | 125 | For answers to common questions about this code of conduct, see the FAQ at 126 | https://www.contributor-covenant.org/faq. Translations are available at 127 | https://www.contributor-covenant.org/translations. 128 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | When contributing to this repository, please first discuss the change you wish to make via [issue](https://github.com/chhakuli123/code-compass/issues) or any other method with the owners of this repository before making a change. 4 | 5 | Please note we have a [Code of Conduct](https://github.com/chhakuli123/code-compass/blob/main/CODE_OF_CONDUCT.md), please follow it in all your interactions with the project. 6 | 7 | - [Pull Request Process](#prp) 8 | - [Code of Conduct](#coc) 9 | - [Commit Message Format](#commit) 10 | 11 | ## Pull Request Process 12 | 13 | 1. Ensure any install or build dependencies are removed before the end of the layer when doing a 14 | build. 15 | 2. Update the README.md with details of changes to the interface, this includes new environment 16 | variables, exposed ports, useful file locations and container parameters. 17 | 3. Increase the version numbers in any examples files and the README.md to the new version that this 18 | Pull Request would represent. The versioning scheme we use is [SemVer](http://semver.org/). 19 | 4. You may merge the Pull Request in once you have the sign-off of two other developers, or if you 20 | do not have permission to do that, you may request the second reviewer to merge it for you. 21 | 22 | ## Code of Conduct 23 | 24 | ### Our Pledge 25 | 26 | In the interest of fostering an open and welcoming environment, we as 27 | contributors and maintainers pledge to making participation in our project and 28 | our community a harassment-free experience for everyone, regardless of age, body 29 | size, disability, ethnicity, gender identity and expression, level of experience, 30 | nationality, personal appearance, race, religion, or sexual identity and 31 | orientation. 32 | 33 | ### Our Standards 34 | 35 | Examples of behavior that contributes to creating a positive environment 36 | include: 37 | 38 | - Using welcoming and inclusive language 39 | - Being respectful of differing viewpoints and experiences 40 | - Gracefully accepting constructive criticism 41 | - Focusing on what is best for the community 42 | - Showing empathy towards other community members 43 | 44 | Examples of unacceptable behavior by participants include: 45 | 46 | - The use of sexualized language or imagery and unwelcome sexual attention or 47 | advances 48 | - Trolling, insulting/derogatory comments, and personal or political attacks 49 | - Public or private harassment 50 | - Publishing others' private information, such as a physical or electronic 51 | address, without explicit permission 52 | - Other conduct which could reasonably be considered inappropriate in a 53 | professional setting 54 | 55 | ### Our Responsibilities 56 | 57 | Project maintainers are responsible for clarifying the standards of acceptable 58 | behavior and are expected to take appropriate and fair corrective action in 59 | response to any instances of unacceptable behavior. 60 | 61 | Project maintainers have the right and responsibility to remove, edit, or 62 | reject comments, commits, code, wiki edits, issues, and other contributions 63 | that are not aligned to this Code of Conduct, or to ban temporarily or 64 | permanently any contributor for other behaviors that they deem inappropriate, 65 | threatening, offensive, or harmful. 66 | 67 | ### Scope 68 | 69 | This Code of Conduct applies both within project spaces and in public spaces 70 | when an individual is representing the project or its community. Examples of 71 | representing a project or community include using an official project e-mail 72 | address, posting via an official social media account, or acting as an appointed 73 | representative at an online or offline event. Representation of a project may be 74 | further defined and clarified by project maintainers. 75 | 76 | ### Enforcement 77 | 78 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 79 | reported by contacting the project authors of the project. All 80 | complaints will be reviewed and investigated and will result in a response that 81 | is deemed necessary and appropriate to the circumstances. The project team is 82 | obligated to maintain confidentiality with regard to the reporter of an incident. 83 | Further details of specific enforcement policies may be posted separately. 84 | 85 | Project maintainers who do not follow or enforce the Code of Conduct in good 86 | faith may face temporary or permanent repercussions as determined by other 87 | members of the project's leadership. 88 | 89 | ### Attribution 90 | 91 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, 92 | available at [http://contributor-covenant.org/version/1/4][version] 93 | 94 | [homepage]: http://contributor-covenant.org 95 | [version]: http://contributor-covenant.org/version/1/4/ 96 | 97 | ## Commit Message Format 98 | 99 | We have very precise rules over how our Git commit messages must be formatted. 100 | This format leads to **easier to read commit history**. 101 | 102 | Each commit message consists of a **header**, a **body**, and a **footer**. 103 | 104 | ``` 105 |
106 | 107 | 108 | 109 |