Skip to content

Commit 467b863

Browse files
committed
Initial commit
Created from https://vercel.com/new
0 parents  commit 467b863

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+25326
-0
lines changed

.dockerignore

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
*.md
2+
Dockerfile
3+
docker-compose.yml
4+
LICENSE
5+
netlify.toml
6+
vercel.json
7+
node_modules
8+
.vscode

.env.example

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Your API Key for GEMINI_API
2+
GEMINI_API_KEY=
3+
# Custom base url for OpenAI API. default: https://generativelanguage.googleapis.com
4+
API_BASE_URL=
5+
# Inject analytics or other scripts before </head> of the page
6+
HEAD_SCRIPTS=
7+
# Secret string for the project. Use for generating signatures for API calls
8+
PUBLIC_SECRET_KEY=
9+
# Set password for site, support multiple password separated by comma. If not set, site will be public
10+
SITE_PASSWORD=
11+
# Set the maximum number of historical messages used for contextual contact
12+
PUBLIC_MAX_HISTORY_MESSAGES=

.eslintignore

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
dist
2+
public
3+
node_modules
4+
.netlify
5+
.vercel
6+
.github
7+
.changeset

.eslintrc.js

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
module.exports = {
2+
extends: ['@evan-yang', 'plugin:astro/recommended'],
3+
rules: {
4+
'no-console': ['error', { allow: ['error'] }],
5+
'react/display-name': 'off',
6+
'react-hooks/rules-of-hooks': 'off',
7+
'@typescript-eslint/no-use-before-define': 'off',
8+
},
9+
overrides: [
10+
{
11+
files: ['*.astro'],
12+
parser: 'astro-eslint-parser',
13+
parserOptions: {
14+
parser: '@typescript-eslint/parser',
15+
extraFileExtensions: ['.astro'],
16+
},
17+
rules: {
18+
'no-mixed-spaces-and-tabs': ['error', 'smart-tabs'],
19+
},
20+
},
21+
{
22+
// Define the configuration for `<script>` tag.
23+
// Script in `<script>` is assigned a virtual file name with the `.js` extension.
24+
files: ['**/*.astro/*.js', '*.astro/*.js'],
25+
parser: '@typescript-eslint/parser',
26+
rules: {
27+
'prettier/prettier': 'off',
28+
},
29+
},
30+
],
31+
}

.gitattributes

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Auto detect text files and perform LF normalization
2+
* text=auto
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: 🐞 Bug report (When using)
2+
description: Report an issue or possible bug when using `Gemini Pro Chat`
3+
labels: ['pending triage', 'use']
4+
body:
5+
- type: markdown
6+
attributes:
7+
value: |
8+
### Before submitting...
9+
Thanks for taking the time to fill out this bug report! Please confirm the following points before submitting:
10+
11+
✅ I have checked the bug was not already reported by searching on GitHub under issues.
12+
✅ Use English to ask questions. This allows more people to search and participate in the issue.
13+
- type: input
14+
id: os
15+
attributes:
16+
label: What operating system are you using?
17+
placeholder: Mac, Windows, Linux
18+
validations:
19+
required: true
20+
- type: input
21+
id: browser
22+
attributes:
23+
label: What browser are you using?
24+
placeholder: Chrome, Firefox, Safari
25+
validations:
26+
required: true
27+
- type: textarea
28+
id: bug-description
29+
attributes:
30+
label: Describe the bug
31+
description: A clear and concise description of what the bug is.
32+
placeholder: Bug description
33+
validations:
34+
required: true
35+
- type: textarea
36+
id: prompt
37+
attributes:
38+
label: What prompt did you enter?
39+
description: If the issue is related to the prompt you entered, please fill in this field.
40+
- type: textarea
41+
id: console-logs
42+
attributes:
43+
label: Console Logs
44+
description: Please check your browser and fill in the error message if it exists.
45+
- type: checkboxes
46+
id: will-pr
47+
attributes:
48+
label: Participation
49+
options:
50+
- label: I am willing to submit a pull request for this issue.
51+
required: false
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: 🐞 Bug report (When self-deploying)
2+
description: Report an issue or possible bug when deploy to your own server or cloud.
3+
labels: ['pending triage', 'deploy']
4+
body:
5+
- type: markdown
6+
attributes:
7+
value: |
8+
### Before submitting...
9+
Thanks for taking the time to fill out this bug report! Please confirm the following points before submitting:
10+
11+
✅ I am using **latest version of GeminiProChat**.
12+
✅ I have checked the bug was not already reported by searching on GitHub under issues.
13+
✅ Use English to ask questions. This allows more people to search and participate in the issue.
14+
- type: dropdown
15+
id: server
16+
attributes:
17+
label: How is Gemini Pro Chat deployed?
18+
description: Select the used deployment method.
19+
options:
20+
- Node
21+
- Docker
22+
- Vercel
23+
- Netlify
24+
- Railway
25+
- Others (Specify in description)
26+
validations:
27+
required: true
28+
- type: textarea
29+
id: bug-description
30+
attributes:
31+
label: Describe the bug
32+
description: A clear and concise description of what the bug is.
33+
placeholder: Bug description
34+
validations:
35+
required: true
36+
- type: textarea
37+
id: console-logs
38+
attributes:
39+
label: Console Logs
40+
description: Please check your browser and node console, fill in the error message if it exists.
41+
- type: checkboxes
42+
id: will-pr
43+
attributes:
44+
label: Participation
45+
options:
46+
- label: I am willing to submit a pull request for this issue.
47+
required: false

.github/ISSUE_TEMPLATE/config.yml

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: 💬 Discussions
4+
url: https://github.com/babaohuang/GeminiProChat/discussions
5+
about: Use discussions if you have an idea for improvement or for asking questions.
+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: 🚀 Feature request
2+
description: Suggest a feature or an improvement
3+
labels: ['enhancement']
4+
body:
5+
- type: markdown
6+
attributes:
7+
value: |
8+
### Before submitting...
9+
Thank you for taking the time to fill out this feature request! Please confirm the following points before submitting:
10+
11+
✅ I have checked the feature was not already submitted by searching on GitHub under issues or discussions.
12+
✅ Use English. This allows more people to search and participate in the issue.
13+
- type: textarea
14+
id: feature-description
15+
attributes:
16+
label: Describe the feature
17+
description: A clear and concise description of what you think would be a helpful addition.
18+
validations:
19+
required: true
20+
- type: textarea
21+
id: additional-context
22+
attributes:
23+
label: Additional context
24+
description: Any other context or screenshots about the feature request here.
25+
- type: checkboxes
26+
id: will-pr
27+
attributes:
28+
label: Participation
29+
options:
30+
- label: I am willing to submit a pull request for this feature.
31+
required: false

.github/ISSUE_TEMPLATE/typo.yml

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: 👀 Typo / Grammar fix
2+
description: You can just go ahead and send a PR! Thank you!
3+
labels: []
4+
body:
5+
- type: markdown
6+
attributes:
7+
value: |
8+
## PR Welcome!
9+
10+
If the typo / grammar issue is trivial and straightforward, you can help by **directly sending a quick pull request**!
11+
If you spot multiple of them, we suggest combining them into a single PR. Thanks!
12+
- type: textarea
13+
id: context
14+
attributes:
15+
label: Additional context

.github/PULL_REQUEST_TEMPLATE.md

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<!-- DO NOT IGNORE THE TEMPLATE!
2+
Thank you for contributing!
3+
Before submitting the PR, please make sure you do the following:
4+
- Discuss first. It's always better to open a feature request issue first to discuss with the maintainers whether the feature is desired and the design of those features.
5+
- Use [Conventional Commits](https://www.conventionalcommits.org/) for commit messages.
6+
- Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
7+
-->
8+
9+
### Description
10+
11+
<!-- Please insert your description here and provide especially info about the "what" this PR is solving -->
12+
13+
### Linked Issues
14+
15+
16+
### Additional context
17+
18+
<!-- e.g. is there anything you'd like reviewers to focus on? -->

.gitignore

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# build output
2+
dist/
3+
.vercel/
4+
.netlify/
5+
6+
# generated types
7+
.astro/
8+
9+
# dependencies
10+
node_modules/
11+
12+
# logs
13+
npm-debug.log*
14+
yarn-debug.log*
15+
yarn-error.log*
16+
pnpm-debug.log*
17+
18+
# environment variables
19+
.env
20+
.env.production
21+
22+
# macOS-specific files
23+
.DS_Store
24+
25+
# Local
26+
*.local
27+
28+
**/.DS_Store
29+
30+
# Editor directories and files
31+
.idea

.npmrc

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
registry=https://registry.npmjs.org/
2+
strict-peer-dependencies=false
3+
auto-install-peers=true
4+
shamefully-hoist=true

.vscode/extensions.json

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"recommendations": ["astro-build.astro-vscode","dbaeumer.vscode-eslint","antfu.unocss"],
3+
"unwantedRecommendations": [],
4+
}

.vscode/launch.json

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"command": "./node_modules/.bin/astro dev",
6+
"name": "Development server",
7+
"request": "launch",
8+
"type": "node-terminal"
9+
}
10+
]
11+
}

.vscode/settings.json

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"editor.codeActionsOnSave": {
3+
"source.fixAll.eslint": "explicit"
4+
},
5+
"editor.formatOnSave": false,
6+
"eslint.validate": [
7+
"javascript",
8+
"javascriptreact",
9+
"astro", // Enable .astro
10+
"typescript", // Enable .ts
11+
"typescriptreact" // Enable .tsx
12+
]
13+
}

Dockerfile

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Use node:alpine as the base image
2+
FROM node:18.15-alpine
3+
4+
# Set the working directory
5+
WORKDIR /usr/src
6+
7+
# Copy all necessary files to the working directory
8+
COPY . .
9+
10+
# Install global dependencies
11+
RUN npm install -g pnpm
12+
13+
# Install project dependencies
14+
RUN pnpm install
15+
16+
# Build the project
17+
RUN pnpm run build
18+
19+
# Copy the hack directory to the container
20+
COPY hack ./
21+
22+
# Set environment variables
23+
ENV HOST=0.0.0.0 PORT=3000 NODE_ENV=production LANG=C.UTF-8
24+
25+
# Expose the port the app runs on
26+
EXPOSE $PORT
27+
28+
# Ensure the entrypoint script is executable
29+
RUN chmod +x ./docker-entrypoint.sh
30+
31+
# Set the command to run when the container starts
32+
CMD ["/bin/sh", "docker-entrypoint.sh"]

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2023 Diu
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)