Tying up loose ends & Stock Portfolio API (Part 4)

In the previous part of this series we’ve talked about using the Messenger component for sending emails. We’ve also talked about how to use JWT tokens as an easy way to create tokens for account activation links or password reset links. In this part we will tie up some loose ends and we’ll start implementing the basic stock portfolio entities, which we’ll extend in the future parts.

Tying up loose ends

Custom exceptions

We’ve used some general exceptions throughout our services. If you do not catch those, API Platform will throw an Internal Server Error to the client. To combat this we’ll implement custom exceptions and map those to the correct HTTP Statuscode.

Continue Reading “Tying up loose ends & Stock Portfolio API (Part 4)”

How to create a simple application using Symfony and React Native – Part 3

In part 2 of this series we’ve added a custom endpoint to make it possible for users to register themselves. In this part we’ll add an EmailService class to send emails using the Symfony Messenger component. I’ll also show you an awesome technique for generating JWT Tokens for specific user actions like activating an account or resetting a password.

The Emailservice

Our application needs to send email messages to our users. A basic example is an account activation email with a link for users to click on. When they click on the link their account will be activated and ready for use.

Continue Reading “How to create a simple application using Symfony and React Native – Part 3”

How to create a simple application using Symfony and React Native – Part 2

In part one of this series we’ve setup the API for this project using Symfony and API Platform. In part two we’ll make this API more functional by creating a user entity and allowing users to sign up. The complete application for part 2 can be found in my github repository.

Continue Reading “How to create a simple application using Symfony and React Native – Part 2”

How to create a simple application using Symfony and React Native – Part 1

This is the first part of a new series I want to do. In this series I’ll be making a simple stock portfolio application using Symfony with API Platform. For the app we will use React Native. I’ll take you through the whole process, from setting up the basic Symfony application to the deployment of the API. You can follow along with me at Github.

Continue Reading “How to create a simple application using Symfony and React Native – Part 1”

3 Useful services for Symfony applications

A lot of the time you find yourself writing a lot of the same code over and over. Not only is this annoying, but it’s also prone to copy / paste errors. That is why you should stop repeating yourself and leverage service classes in your applications. Today I’ll share some of my services for Symfony which I find very useful in my day to day life as a developer. Feel free to use them in your applications.

Logging service

Logging is essential to see what happened in your application when and error occurred. Because I didn’t want to scatter my application with log statements enclosed in null checks to see if the logger is actually available, I created this LogService.

Continue Reading “3 Useful services for Symfony applications”