File size: 2,607 Bytes
f9308e4
 
 
 
 
 
 
536f4ce
f9308e4
 
 
 
536f4ce
 
9ebfcd2
536f4ce
9ebfcd2
536f4ce
9ebfcd2
536f4ce
 
 
 
9ebfcd2
 
 
536f4ce
 
9ebfcd2
 
 
536f4ce
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
---
license: mit
title: Prompta
sdk: docker
emoji: πŸš€
colorFrom: purple
colorTo: blue
short_description: 'Transform your ideas into complete websites instantly.'
---

Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference

# Prompta
Transform your ideas into complete websites instantly. Powered by AI.

Try it at: https://huggingface.co/spaces/[YOUR_USERNAME]/Prompta

This project is inspired by [llamacoder](https://github.com/Nutlope/llamacoder). Please follow [Nutlope](https://github.com/Nutlope) and give them a star.

## Tech Stack
- [Gemini API](https://ai.google.dev/gemini-api/docs) for AI generation
- [Sandpack](https://sandpack.codesandbox.io/) for code sandbox
- Next.js app router with Tailwind CSS

You can also experiment with Gemini in [Google AI Studio](https://aistudio.google.com/).

## Cloning & Running Locally
1. Clone the repo: `git clone https://github.com/[YOUR_USERNAME]/Prompta`
2. Create a `.env` file and add your [Google AI Studio API key](https://aistudio.google.com/app/apikey): `GOOGLE_AI_API_KEY=`
3. Run `npm install` and `npm run dev` to install dependencies and run locally

**This is a personal project and not a Google official project**

---

### Troubleshooting Build Issues
If your Hugging Face Space isn't building properly:

1. **Dockerfile Requirements**:
   - Ensure you have a `Dockerfile` in your root directory
   - Example Dockerfile:
     ```dockerfile
     FROM node:18-alpine
     WORKDIR /app
     COPY package*.json ./
     RUN npm install
     COPY . .
     RUN npm run build
     EXPOSE 7860
     CMD ["npm", "start"]
     ```

2. **Port Configuration**:
   - Hugging Face Spaces requires port 7860
   - In your Next.js app, add to `next.config.js`:
     ```js
     /** @type {import('next').NextConfig} */
     const nextConfig = {
       output: 'standalone',
       images: {
         unoptimized: true
       }
     }
     module.exports = nextConfig
     ```

3. **Environment Variables**:
   - Add `GOOGLE_AI_API_KEY` as a secret in your Space settings
   - Don't commit `.env` files to your repository

4. **Build Command**:
   - Ensure your `package.json` has:
     ```json
     {
       "scripts": {
         "dev": "next dev",
         "build": "next build",
         "start": "next start"
       }
     }
     ```

5. **Common Issues**:
   - Missing dependencies: Check all packages are in `package.json`
   - Build timeouts: Optimize build process or increase Space resources
   - Port conflicts: Ensure nothing else uses port 7860
   - File paths: Verify all paths in Dockerfile are correct