Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
df6299c
Русификация интерфейса и настройка Railway
Nik-Maltcev Sep 7, 2025
88fc4f9
Исправление конфигурации Railway
Nik-Maltcev Sep 7, 2025
7a54a45
Дополнительные исправления Railway + Dockerfile
Nik-Maltcev Sep 7, 2025
4d3147e
Исправление синхронизации lockfile и Dockerfile
Nik-Maltcev Sep 7, 2025
488f7bf
Исправление проблемы lightningcss в Railway
Nik-Maltcev Sep 7, 2025
762f3ef
Обновление до TailwindCSS v4: замена устаревших плагинов и конфигурации
Nik-Maltcev Sep 7, 2025
5b6d67a
Исправление ошибок TypeScript для успешной сборки
Nik-Maltcev Sep 7, 2025
37f8e90
Исправление null-проверок для TypeScript strict mode
Nik-Maltcev Sep 7, 2025
0c4b3c7
Исправление импорта типов next-themes
Nik-Maltcev Sep 7, 2025
d32e407
🔧 Исправление неопределенной переменной results
Nik-Maltcev Sep 7, 2025
d198485
Исправлены ошибки TypeScript и подготовлен проект для деплоя
Nik-Maltcev Sep 7, 2025
f379534
Исправлен деплой на Railway - переместил TypeScript в dependencies
Nik-Maltcev Sep 7, 2025
35830d5
Улучшена конфигурация для Railway деплоя
Nik-Maltcev Sep 7, 2025
4536abd
Увеличено время жизни sandbox с 15 до 60 минут
Nik-Maltcev Sep 8, 2025
4e8e76a
Добавлен блок тарифов на главную страницу
Nik-Maltcev Sep 13, 2025
8865f17
feat: add industry-aware site generation
Nik-Maltcev Sep 25, 2025
5be43dd
feat: Add PayAnyWay payment integration with basic and professional p…
Nik-Maltcev Sep 29, 2025
0230e90
feat: Add Supabase integration with complete setup
Nik-Maltcev Sep 30, 2025
3ea1280
fix: TypeScript error in supabase-helpers.ts for postgres_changes
Nik-Maltcev Sep 30, 2025
016ee9e
fix: Make Supabase integration build-safe
Nik-Maltcev Sep 30, 2025
0584faf
feat: Add authentication system with user dashboard
Nik-Maltcev Sep 30, 2025
0a85e3e
fix: Add missing SiReact import and remove unused imports
Nik-Maltcev Sep 30, 2025
234becb
feat: Add auth button to home screen
Nik-Maltcev Sep 30, 2025
34fc761
feat: Add usage limits system with subscription tiers
Nik-Maltcev Sep 30, 2025
3d24de3
feat: Connect PayAnyWay payment with subscription system
Nik-Maltcev Oct 4, 2025
6fb2028
Refresh REBUILDR landing design
Nik-Maltcev Oct 8, 2025
96a0b0a
Fix Railway build warnings and restore landing content
Nik-Maltcev Oct 8, 2025
a23766b
Improve hero layout readability
Nik-Maltcev Oct 8, 2025
f935417
Allow hero overlay to scroll
Nik-Maltcev Oct 8, 2025
4178998
Fix hero copy encoding
Nik-Maltcev Oct 8, 2025
b6db204
Restore hero overlay baseline
Nik-Maltcev Oct 8, 2025
f185fc2
Normalize app/page.tsx encoding
Nik-Maltcev Oct 8, 2025
f694632
fix: restore russian copy on landing
Nik-Maltcev Oct 8, 2025
ad8a2ab
fix: only restore sandbox when id present
Nik-Maltcev Oct 8, 2025
ee36795
fix: hide sandbox controls while home overlay is visible
Nik-Maltcev Oct 8, 2025
b9f0527
Fix encoding: Convert all files to UTF-8 without BOM
Nik-Maltcev Oct 9, 2025
1a5c887
fix: исправлена синтаксическая ошибка JSX в app/page.tsx
Nik-Maltcev Oct 9, 2025
e8dc15e
fix: добавлен meta charset для корректной кодировки кириллицы
Nik-Maltcev Oct 9, 2025
72546cc
chore: добавлен .gitattributes для правильной кодировки
Nik-Maltcev Oct 9, 2025
c4fadaf
fix: исправлена кодировка кириллицы в page.tsx
Nik-Maltcev Oct 9, 2025
00badc4
Fix Cyrillic character encoding and rendering issues
google-labs-jules[bot] Oct 9, 2025
a48a69d
Merge pull request #1 from Nik-Maltcev/fix/cyrillic-encoding-and-rend…
Nik-Maltcev Oct 9, 2025
28454a7
Fix Russian text encoding issues in the UI.
google-labs-jules[bot] Oct 10, 2025
d3edd03
Merge pull request #2 from Nik-Maltcev/fix/cyrillic-encoding-and-rend…
Nik-Maltcev Oct 10, 2025
d1a19a1
Fix Russian text encoding issues in the UI.
google-labs-jules[bot] Oct 10, 2025
4cab3e2
Fix Russian text encoding issues in the UI.
google-labs-jules[bot] Oct 10, 2025
2ca915c
Merge pull request #3 from Nik-Maltcev/fix/cyrillic-encoding-and-rend…
Nik-Maltcev Oct 10, 2025
605e2c7
fix: hide auth when Supabase not configured
Nik-Maltcev Oct 10, 2025
be57e9f
revert: restore auth button
Nik-Maltcev Oct 10, 2025
a138214
fix: add Supabase env vars to next config
Nik-Maltcev Oct 10, 2025
c155f71
fix: remove env from config - use Railway vars directly
Nik-Maltcev Oct 10, 2025
c756623
add: production env template for Railway
Nik-Maltcev Oct 10, 2025
15adfb2
debug: add logging to check env vars
Nik-Maltcev Oct 10, 2025
f2ea93a
fix: hardcode Supabase credentials
Nik-Maltcev Oct 10, 2025
9d40afd
feat: support both NEXT_PUBLIC_ and non-prefixed env vars
Nik-Maltcev Oct 10, 2025
84dac49
Fix Russian text encoding issues throughout the UI.
google-labs-jules[bot] Oct 11, 2025
041e10e
Merge pull request #4 from Nik-Maltcev/fix/cyrillic-encoding-and-rend…
Nik-Maltcev Oct 11, 2025
6e0c2cb
feat: add save project to dashboard
Nik-Maltcev Oct 12, 2025
4ce79e2
feat: save projects as ZIP archives in Supabase Storage
Nik-Maltcev Oct 12, 2025
d79079a
Fix Next.js 15 dynamic route params type error
Nik-Maltcev Oct 12, 2025
b32e631
Remove sandbox_id reference from dashboard
Nik-Maltcev Oct 12, 2025
0033fcf
Always recreate sandbox on new chat request
Nik-Maltcev Oct 12, 2025
17d5494
Always recreate sandbox in URL reference mode
Nik-Maltcev Oct 12, 2025
df9250a
Update model to Gemini 3 Pro and add Tilda block support
google-labs-jules[bot] Nov 29, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
# REQUIRED - Sandboxes for code execution
# Get yours at https://e2b.dev
E2B_API_KEY=your_e2b_api_key_here
# Переменные окружения для Railway

# REQUIRED - Web scraping for cloning websites
# Get yours at https://firecrawl.dev
# Обязательные переменные:
E2B_API_KEY=your_e2b_api_key_here
FIRECRAWL_API_KEY=your_firecrawl_api_key_here

# OPTIONAL - AI Providers (need at least one)
# Get yours at https://console.anthropic.com
# Дополнительные ИИ провайдеры (нужен минимум один):
ANTHROPIC_API_KEY=your_anthropic_api_key_here

# Get yours at https://platform.openai.com
OPENAI_API_KEY=your_openai_api_key_here

# Get yours at https://aistudio.google.com/app/apikey
GEMINI_API_KEY=your_gemini_api_key_here
GROQ_API_KEY=your_groq_api_key_here

# Supabase Configuration
NEXT_PUBLIC_SUPABASE_URL=https://your-project.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key_here
SUPABASE_SERVICE_ROLE_KEY=your_supabase_service_role_key_here

# Get yours at https://console.groq.com
GROQ_API_KEY=your_groq_api_key_here
# Railway переменные
NODE_ENV=production
PORT=3000
5 changes: 5 additions & 0 deletions .env.production
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# This file is used by Railway for production builds
# Railway will inject these from environment variables
NEXT_PUBLIC_SUPABASE_URL=${NEXT_PUBLIC_SUPABASE_URL}
NEXT_PUBLIC_SUPABASE_ANON_KEY=${NEXT_PUBLIC_SUPABASE_ANON_KEY}
SUPABASE_SERVICE_ROLE_KEY=${SUPABASE_SERVICE_ROLE_KEY}
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* text=auto eol=lf
*.{tsx,ts,js,jsx,json,css,md} text eol=lf encoding=utf-8
130 changes: 85 additions & 45 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,58 +1,98 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
**/node_modules/
/.pnp
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/versions

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem
# Dependencies
node_modules/
.pnp
.pnp.js

# Production
.next/
out/
build/
dist/

# debug
# Environment variables
.env
.env.local
.env.development.local
.env.test.local
.env.production.local

# Logs
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*

# env files (can opt-in for committing if needed)
.env*
.env.local
!.env.example
# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Coverage directory used by tools like istanbul
coverage/
*.lcov

# nyc test coverage
.nyc_output

# Dependency directories
jspm_packages/

# Optional npm cache directory
.npm

# vercel
.vercel
# Optional eslint cache
.eslintcache

# typescript
*.tsbuildinfo
next-env.d.ts
# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# E2B template builds
*.tar.gz
e2b-template-*
# Optional REPL history
.node_repl_history

# IDE
# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next

# Nuxt.js build / generate output
.nuxt
dist

# Storybook build outputs
.out
.storybook-out

# Temporary folders
tmp/
temp/

# Editor directories and files
.vscode/
.idea/
*.swp
*.swo
*~

# OS generated files
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db

# Temporary files
*.tmp
*.temp
repomix-output.txt
bun.lockb
# TypeScript
*.tsbuildinfo
190 changes: 190 additions & 0 deletions AUTH_SETUP.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,190 @@
# 🔐 Система аутентификации

## ✅ Что было создано

### 1. Компоненты аутентификации
- **`components/auth/AuthModal.tsx`** - модальное окно входа/регистрации
- **`components/auth/UserButton.tsx`** - кнопка пользователя с выпадающим меню
- **`components/PageHeader.tsx`** - хедер страницы с кнопкой пользователя

### 2. Контекст пользователя
- **`contexts/AuthContext.tsx`** - управление состоянием аутентификации
- Автоматическое отслеживание сессии
- Глобальный доступ к данным пользователя

### 3. Страница личного кабинета
- **`app/dashboard/page.tsx`** - личный кабинет пользователя
- Список проектов
- Статистика
- Управление проектами

### 4. Интеграция
- **`app/layout.tsx`** - обернут в `AuthProvider`
- Готово к использованию во всем приложении

## 🚀 Как использовать

### Вариант 1: Использовать готовый компонент PageHeader

В `app/page.tsx` замените существующий хедер на:

```tsx
import PageHeader from '@/components/PageHeader';

// В компоненте:
<PageHeader
status={status}
aiModel={aiModel}
onModelChange={(model) => {
setAiModel(model);
// обновить URL параметры
}}
availableModels={appConfig.ai.availableModels}
modelDisplayNames={appConfig.ai.modelDisplayNames}
onCreateSandbox={createSandbox}
onReapply={reapplyLastGeneration}
onDownloadZip={downloadZip}
canReapply={!!conversationContext.lastGeneratedCode && !!sandboxData}
hasSandbox={!!sandboxData}
/>
```

### Вариант 2: Добавить только кнопку пользователя

Просто добавьте в нужное место:

```tsx
import UserButton from '@/components/auth/UserButton';

// Р’ JSX:
<UserButton />
```

## 📱 Функционал

### Для неавторизованных пользователей:
- Кнопка "Войти"
- Модальное окно с формами входа/регистрации
- Переключение между входом и регистрацией
- Валидация email и пароля

### Для авторизованных пользователей:
- Аватар с первой буквой email
- Выпадающее меню с:
- Email пользователя
- Ссылка на личный кабинет
- Кнопка выхода

## 🏠 Личный кабинет

Доступен по адресу: `/dashboard`

**Функции:**
- Просмотр всех проектов пользователя
- Статистика (всего, активных, в архиве)
- Ссылки на preview проектов
- Информация о sandbox'ах
- Кнопка создания нового проекта

## 🔒 Защита роутов

Личный кабинет автоматически перенаправляет неавторизованных пользователей на главную страницу.

## 🎨 Стилизация

Все компоненты используют:
- Tailwind CSS
- Dark mode support
- Адаптивный дизайн
- Анимации и transitions

## 📝 Использование в коде

### Получить текущего пользователя:

```tsx
import { useAuth } from '@/contexts/AuthContext';

function MyComponent() {
const { user, loading, signOut } = useAuth();

if (loading) return <div>Loading...</div>;

if (!user) {
return <div>Пожалуйста, войдите</div>;
}

return (
<div>
<p>Привет, {user.email}!</p>
<button onClick={signOut}>Выйти</button>
</div>
);
}
```

### Работа с проектами:

```tsx
import { getUserProjects, createProject } from '@/lib/supabase-projects';

// Получить проекты пользователя
const projects = await getUserProjects({ status: 'active' });

// Создать новый проект
const newProject = await createProject({
name: 'My Project',
description: 'Project description',
sandbox_id: 'sandbox-123'
});
```

## 🔧 Настройка

### Email подтверждение

По умолчанию Supabase требует подтверждение email. Чтобы отключить:

1. Откройте [Supabase Dashboard](https://supabase.com/dashboard/project/lyuxhqhusukvpvwtkkum/auth/users)
2. Перейдите в **Authentication → Settings**
3. Отключите **Enable email confirmations**

### Кастомизация email шаблонов

1. Откройте **Authentication → Email Templates**
2. Настройте шаблоны для:
- Подтверждение регистрации
- Сброс пароля
- Изменение email

## 🎯 Следующие шаги

1. **Замените хедер** в `app/page.tsx` на `PageHeader` компонент
2. **Примените миграцию** из `supabase/migrations/001_initial_schema.sql`
3. **Настройте email** в Supabase Dashboard
4. **Протестируйте** регистрацию и вход

## рџђ› Troubleshooting

### Ошибка "User already registered"
- Пользователь уже существует, используйте вход вместо регистрации

### Не приходит email подтверждения
- Проверьте настройки SMTP в Supabase
- Проверьте папку спам
- Отключите email подтверждение для тестирования

### Не работает вход
- Убедитесь, что переменные окружения Supabase установлены
- Проверьте консоль браузера на ошибки
- Убедитесь, что RLS политики настроены правильно

## 📚 Дополнительные ресурсы

- [Supabase Auth Docs](https://supabase.com/docs/guides/auth)
- [Row Level Security](https://supabase.com/docs/guides/auth/row-level-security)
- [Auth Helpers](https://supabase.com/docs/guides/auth/auth-helpers/nextjs)

---

**Готово!** Система аутентификации полностью настроена и готова к использованию. 🎉
Loading