Upload 11 files
Browse files- .eslintrc.json +3 -0
- .gitignore +37 -0
- .prettierrc +3 -0
- LICENSE +21 -0
- README.md +24 -0
- next.config.mjs +4 -0
- package-lock.json +0 -0
- package.json +45 -0
- postcss.config.mjs +8 -0
- tailwind.config.ts +31 -0
- tsconfig.json +26 -0
.eslintrc.json
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"extends": "next/core-web-vitals"
|
3 |
+
}
|
.gitignore
ADDED
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
|
2 |
+
|
3 |
+
# dependencies
|
4 |
+
/node_modules
|
5 |
+
/.pnp
|
6 |
+
.pnp.js
|
7 |
+
.yarn/install-state.gz
|
8 |
+
|
9 |
+
# testing
|
10 |
+
/coverage
|
11 |
+
|
12 |
+
# next.js
|
13 |
+
/.next/
|
14 |
+
/out/
|
15 |
+
|
16 |
+
# production
|
17 |
+
/build
|
18 |
+
|
19 |
+
# misc
|
20 |
+
.DS_Store
|
21 |
+
*.pem
|
22 |
+
|
23 |
+
# debug
|
24 |
+
npm-debug.log*
|
25 |
+
yarn-debug.log*
|
26 |
+
yarn-error.log*
|
27 |
+
|
28 |
+
# local env files
|
29 |
+
.env*.local
|
30 |
+
.env
|
31 |
+
|
32 |
+
# vercel
|
33 |
+
.vercel
|
34 |
+
|
35 |
+
# typescript
|
36 |
+
*.tsbuildinfo
|
37 |
+
next-env.d.ts
|
.prettierrc
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"plugins": ["prettier-plugin-tailwindcss"]
|
3 |
+
}
|
LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
MIT License
|
2 |
+
|
3 |
+
Copyright (c) 2024 Hassan El Mghari
|
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.
|
README.md
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<h1 align="center">InstantCoder</h1>
|
2 |
+
<p align="center">
|
3 |
+
Generate small apps with one prompt. Powered by the Gemini API.
|
4 |
+
</p>
|
5 |
+
|
6 |
+
Try it in https://huggingface.co/spaces/osanseviero/InstantCoder
|
7 |
+
|
8 |
+
This project is fully based on [llamacoder](https://github.com/Nutlope/llamacoder). Please follow [Nutlope](https://github.com/Nutlope) and give them a star.
|
9 |
+
|
10 |
+
## Tech stack
|
11 |
+
|
12 |
+
- [Gemini API](https://ai.google.dev/gemini-api/docs) to use Gemini 1.5 Pro, Gemini 1.5 Flash, and Gemini 2.0 Flash Experimental
|
13 |
+
- [Sandpack](https://sandpack.codesandbox.io/) for the code sandbox
|
14 |
+
- Next.js app router with Tailwind
|
15 |
+
|
16 |
+
You can also experiment with Gemini in [Google AI Studio](https://aistudio.google.com/).
|
17 |
+
|
18 |
+
## Cloning & running
|
19 |
+
|
20 |
+
1. Clone the repo: `git clone https://github.com/osanseviero/GemCoder`
|
21 |
+
2. Create a `.env` file and add your [Google AI Studio API key](https://aistudio.google.com/app/apikey): `GOOGLE_AI_API_KEY=`
|
22 |
+
3. Run `npm install` and `npm run dev` to install dependencies and run locally
|
23 |
+
|
24 |
+
**This is a personal project and not a Google official project**
|
next.config.mjs
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/** @type {import('next').NextConfig} */
|
2 |
+
const nextConfig = {};
|
3 |
+
|
4 |
+
export default nextConfig;
|
package-lock.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|
package.json
ADDED
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"name": "llamacoder-new",
|
3 |
+
"version": "0.1.0",
|
4 |
+
"private": true,
|
5 |
+
"scripts": {
|
6 |
+
"dev": "next dev",
|
7 |
+
"build": "prisma generate && prisma migrate deploy && next build",
|
8 |
+
"start": "next start",
|
9 |
+
"lint": "next lint"
|
10 |
+
},
|
11 |
+
"dependencies": {
|
12 |
+
"@codesandbox/sandpack-react": "^2.18.2",
|
13 |
+
"@codesandbox/sandpack-themes": "^2.0.21",
|
14 |
+
"@conform-to/zod": "^1.1.5",
|
15 |
+
"@google/generative-ai": "^0.21.0",
|
16 |
+
"@heroicons/react": "^2.1.5",
|
17 |
+
"@prisma/client": "^5.18.0",
|
18 |
+
"@radix-ui/react-radio-group": "^1.2.0",
|
19 |
+
"@radix-ui/react-select": "^2.1.1",
|
20 |
+
"@radix-ui/react-switch": "^1.1.0",
|
21 |
+
"@radix-ui/react-tooltip": "^1.1.2",
|
22 |
+
"@vercel/og": "^0.6.2",
|
23 |
+
"dedent": "^1.5.3",
|
24 |
+
"eventsource-parser": "^1.1.2",
|
25 |
+
"framer-motion": "^11.3.19",
|
26 |
+
"next": "14.2.5",
|
27 |
+
"react": "^18",
|
28 |
+
"react-dom": "^18",
|
29 |
+
"sonner": "^1.5.0",
|
30 |
+
"zod": "^3.23.8"
|
31 |
+
},
|
32 |
+
"devDependencies": {
|
33 |
+
"@types/node": "^20",
|
34 |
+
"@types/react": "^18",
|
35 |
+
"@types/react-dom": "^18",
|
36 |
+
"eslint": "^8",
|
37 |
+
"eslint-config-next": "14.2.3",
|
38 |
+
"postcss": "^8",
|
39 |
+
"prettier": "^3.3.3",
|
40 |
+
"prettier-plugin-tailwindcss": "^0.6.5",
|
41 |
+
"prisma": "^5.18.0",
|
42 |
+
"tailwindcss": "^3.4.1",
|
43 |
+
"typescript": "^5"
|
44 |
+
}
|
45 |
+
}
|
postcss.config.mjs
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/** @type {import('postcss-load-config').Config} */
|
2 |
+
const config = {
|
3 |
+
plugins: {
|
4 |
+
tailwindcss: {},
|
5 |
+
},
|
6 |
+
};
|
7 |
+
|
8 |
+
export default config;
|
tailwind.config.ts
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import type { Config } from "tailwindcss";
|
2 |
+
import colors from "tailwindcss/colors";
|
3 |
+
import defaultTheme from "tailwindcss/defaultTheme";
|
4 |
+
|
5 |
+
const config: Config = {
|
6 |
+
darkMode: "class",
|
7 |
+
content: [
|
8 |
+
"./pages/**/*.{js,ts,jsx,tsx,mdx}",
|
9 |
+
"./components/**/*.{js,ts,jsx,tsx,mdx}",
|
10 |
+
"./app/**/*.{js,ts,jsx,tsx,mdx}",
|
11 |
+
],
|
12 |
+
theme: {
|
13 |
+
extend: {
|
14 |
+
colors: {
|
15 |
+
brand: "#E1E7EC",
|
16 |
+
gray: colors.slate,
|
17 |
+
},
|
18 |
+
backgroundColor: {
|
19 |
+
dark: "#0B1120",
|
20 |
+
},
|
21 |
+
backgroundImage: {
|
22 |
+
'dark-radial': 'radial-gradient(circle at center, rgba(255,255,255,0.1) 0%, transparent 70%)',
|
23 |
+
},
|
24 |
+
fontFamily: {
|
25 |
+
sans: ['"Aeonik"', ...defaultTheme.fontFamily.sans],
|
26 |
+
},
|
27 |
+
},
|
28 |
+
},
|
29 |
+
};
|
30 |
+
|
31 |
+
export default config;
|
tsconfig.json
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"compilerOptions": {
|
3 |
+
"lib": ["dom", "dom.iterable", "esnext"],
|
4 |
+
"allowJs": true,
|
5 |
+
"skipLibCheck": true,
|
6 |
+
"strict": true,
|
7 |
+
"noEmit": true,
|
8 |
+
"esModuleInterop": true,
|
9 |
+
"module": "esnext",
|
10 |
+
"moduleResolution": "bundler",
|
11 |
+
"resolveJsonModule": true,
|
12 |
+
"isolatedModules": true,
|
13 |
+
"jsx": "preserve",
|
14 |
+
"incremental": true,
|
15 |
+
"plugins": [
|
16 |
+
{
|
17 |
+
"name": "next"
|
18 |
+
}
|
19 |
+
],
|
20 |
+
"paths": {
|
21 |
+
"@/*": ["./*"]
|
22 |
+
}
|
23 |
+
},
|
24 |
+
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
|
25 |
+
"exclude": ["node_modules"]
|
26 |
+
}
|