If you use any GPL code on your front-end, or any other code that is being "distributed" to users, your entire codebase needs to be open sourced. You are free to use GPL on the server side without having to open source your code.
AGPL takes the above and applies it to the backend. So if you use any code licensed under AGPL anywhere in your application, you need to release the source code for your entire application.