A simple authentication form built with React for the frontend and PHP for the backend, using JWT tokens for access and refresh authentication.
- User registration and login
- JWT-based access and refresh tokens
- Logout functionality
- React form using React Hook Form
- Zustand store for managing user state
- PHP backend for handling authentication
- Cookie-based refresh token storage
- Form validation with React Hook Form
Frontend:
- TypeScript
- React
- Zustand
- Axios
Backend:
- PHP
- Firebase JWT (
firebase/php-jwt) - MySQL
- Cookie-based refresh token handling
- Clone the repository:
git clone https://github.com/rahilevych/form-php.git cd php-form/backend composer install - Config .env
- JWT_ACCESS_SECRET=your_access_secret
- JWT_REFRESH_SECRET=your_refresh_secret
- DB_HOST=localhost
- DB_NAME=your_db
- DB_USER=root
- DB_PASS=your_password
-
php -S localhost:8000 -t public
cd php-form/frontned
cd auth-form
npm install
npm run dev


