/vk-auth-react-nestjs

πŸ“ [Article] VK Auth in NestJS + React

Primary LanguageTypeScript

Авторизация Ρ‡Π΅Ρ€Π΅Π· Π’Πš NestJS + React

ΠŸΡ€ΠΈΠΌΠ΅Ρ€ Ρ€Π΅Π°Π»ΠΈΠ·ΠΎΠ²Π°Π½Π½ΠΎΠΉ Π°Π²Ρ‚ΠΎΡ€ΠΈΠ·Π°Ρ†ΠΈΠΈ ΠΏΠΎ способу Authorization code flow Π½Π° ΠΏΡ€ΠΈΠΌΠ΅Ρ€Π΅ NestJS + React.

Π‘Ρ‚Π°Ρ‚ΡŒΡ

Установка

git clone git@github.com:ndrwbv/vk-auth-react-nestjs.git
cd vk-auth-react-nestjs

Backend

$ vk-auth-react-nestjs: cd backend
$ vk-auth-react-nestjs/backend: docker-compose up -d
$ vk-auth-react-nestjs/backend: yarn
$ vk-auth-react-nestjs/backend: yarn dev

Frontend

$ vk-auth-react-nestjs: cd frontend
$ vk-auth-react-nestjs/frontend: yarn
$ vk-auth-react-nestjs/frontend: yarn dev

Настройка

Для Ρ€Π°Π±ΠΎΡ‚Ρ‹ с вашим ΠΏΡ€ΠΈΠ»ΠΎΠΆΠ΅Π½ΠΈΠ΅ΠΌ Π½Π΅ΠΎΠ±Ρ…ΠΎΠ΄ΠΈΠΌΠΎ:

  1. Π‘ΠΎΠ·Π΄Π°Ρ‚ΡŒ ΠΏΡ€ΠΈΠ»ΠΎΠΆΠ΅Π½ΠΈΠ΅ Π²ΠΎ Π’ΠΊΠΎΠ½Ρ‚Π°ΠΊΡ‚Π΅ https://vk.com/editapp?act=create
  2. ΠžΡ‚Ρ€Π΅Π΄Π°ΠΊΡ‚ΠΈΡ€ΠΎΠ²Π°Ρ‚ΡŒ Ρ„Π°ΠΉΠ»Ρ‹ .env Π² ΠΏΠ°ΠΏΠΊΠ΅ frontend ΠΈ backend
frontend/.env: REACT_APP_CLIENT_ID -- ID прилоТСния
backend/.env: CLIENT_ID -- ID прилоТСния
backend/.env: CLIENT_SECRET -- Π—Π°Ρ‰ΠΈΡ‰Ρ‘Π½Π½Ρ‹ΠΉ ΠΊΠ»ΡŽΡ‡