on Eder Sampaio reactjs-auth-boilerplate.*
This is front-end React JS application for testing Symfony API project
This application uses web-sockets to listen to Pusher events set from API. You have to provide your own Pusher account data in configuration (see step 4 in installation).
This application requires user login. You can log in using pre-seeded admin user credentials:
- email: admin@greetings.com
- password: password
You can also register a new user in UI following "register" link in login form. Note, that UI registration always creates regular users (ROLE_USER). If you need more admin users you can create them in API console ( See API project documentation)
This view lists 10 latest greetings registered in API database.
User can create a new greeting, edit and delete his own greetings. If you are logged in as admin you can edit and delete any greeting.
Dropdown menu with the following items:
-
Admin Greeting (only available to admin users).
-
Profile: allows update user first / last names and password. Also, if current user has logged in from a mobile app before, this list of his registered mobile devices is also displayed. (See API project documentation on how to create user mobile app logins in Swagger Docs). Then user can log out from single device or log out from all devices (sign out). Note: this action doesn't affect current user WEB account.
-
Log out.
Send a greeting to all users currently viewing the application. This is a volatile message that is not persisted anywhere. This is a pure demo feature for Pusher connectivity.
- Clone this repo
- cd to project root folder
- cp .env.production .env.production.local
- Edit .env.production.local file: set
REACT_APP_PUSHER_APP_KEYandREACT_APP_PUSHER_CLUSTERenv variables using your account data. - Run
docker compose build - Run
docker compose up -d - Open http://localhost:8080 in your browser
- cp .env.development .env.development.local
- Edit .env.development.local file: set
REACT_APP_PUSHER_APP_KEYandREACT_APP_PUSHER_CLUSTERenv variables using your account data. - Run
npm install - Run
npm run dev - Open the link displayed in terminal when
npm run devis running (with API docker container running it will most likely point to http://localhost:3001, because port 3000 is occupied by Symfony Mercure)
Do not forget to visit https://symfony.test and accept browser security warning, otherwise all requests to API with fail.