diff --git a/.env b/.env index 0ab7895..1ba920e 100644 --- a/.env +++ b/.env @@ -1,15 +1,23 @@ -MONGODB_URI=mongodb://localhost:27017/campfire +# Настройки Next.js +NEXT_PUBLIC_URL=http://localhost:3000 +NEXT_PUBLIC_API_URL=http://localhost:3001/api + +# Настройки сервера +PORT=3001 +NODE_ENV=development + +# База данных +MONGODB_URI=mongodb://localhost:27017/campfire-id + +# Безопасность +JWT_SECRET=your-super-secret-key-change-in-production + +# Telegram WebApp +NEXT_PUBLIC_BOT_USERNAME=CampFireIDBot +NEXT_PUBLIC_BOT_TOKEN=7641998551:AAF_2-av1rUy_-icQ1fsfHOyYBGFt8cEmE4 +NEXT_PUBLIC_WEBAPP_URL=https://t.me/CampFireIDBot/app # Telegram Bot TELEGRAM_BOT_TOKEN=7641998551:AAF_2-av1rUy_-icQ1fsfHOyYBGFt8cEmE4 TELEGRAM_APP_ID=your_app_id_here -TELEGRAM_APP_HASH=your_app_hash_here - - -# JWT -JWT_SECRET=campfire - -# Ap -NEXT_PUBLIC_URL=http://localhost:3000 -NEXT_PUBLIC_API_URL=http://localhost:3001/api -NODE_ENV=development \ No newline at end of file +TELEGRAM_APP_HASH=your_app_hash_here \ No newline at end of file diff --git a/env.d.ts b/env.d.ts new file mode 100644 index 0000000..3baa39a --- /dev/null +++ b/env.d.ts @@ -0,0 +1,16 @@ +declare namespace NodeJS { + interface ProcessEnv { + NEXT_PUBLIC_URL: string; + NEXT_PUBLIC_API_URL: string; + NEXT_PUBLIC_BOT_USERNAME: string; + NEXT_PUBLIC_BOT_TOKEN: string; + NEXT_PUBLIC_WEBAPP_URL: string; + PORT: string; + NODE_ENV: 'development' | 'production' | 'test'; + MONGODB_URI: string; + JWT_SECRET: string; + TELEGRAM_BOT_TOKEN: string; + TELEGRAM_APP_ID: string; + TELEGRAM_APP_HASH: string; + } +} \ No newline at end of file diff --git a/next.config.js b/next.config.js index 69c0934..583755b 100644 --- a/next.config.js +++ b/next.config.js @@ -15,6 +15,22 @@ const nextConfig = { }); return config; }, + images: { + domains: ['t.me', 'telegram.org'], + }, + async headers() { + return [ + { + source: '/:path*', + headers: [ + { + key: 'Access-Control-Allow-Origin', + value: '*', + }, + ], + }, + ]; + }, } module.exports = nextConfig \ No newline at end of file