Symfony 5 Websockets Tutorial

Today we’re going to build a simple real time chat app with Websockets and Symfony 5! I’d recommend you at least know the basics of Symfony and feel comfortable with Javascript before starting this tutorial. 1. Setting up our app To start, let’s get a skeleton Symfony app up. Open a terminal and go to a directory where you want your app to be and type: composer create-project symfony/skeleton app This will create an “app” folder with a base Symfony app. Go into that folder and then we’ll install a few more libraries. Next we need to install a library

Continue reading

Portfolio Project Ideas for a Full Stack Developer

When you’re starting out as a dev it’s good to have a portfolio of projects that you can show off to a prospective employer. It’s best if the projects aren’t straight from tutorials as that will show that you are able to build something without step by step instructions. So with that, here are some ideas for projects you can add to your portfolio! 1. Virtual Terminal Build a web app that is essentially an online cash register. Allow someone to enter a credit card, enter an amount and click a button to charge. You will also need to create

Continue reading

Stateless CSRF Protection in an SPA

Coming from a traditional full stack background where both the frontend and backend were not separate apps, protecting against CSRF attacks when the two ends are separated, was a little confusing for me. How do I pass the CSRF token to my frontend app? Should I make an endpoint that generates a CSRF token? How is that even safe when anyone could access it and get one? It was a little difficult to find a straight forward answer but after a lot of reading I think I figured it out. When should you use a CSRF token and when do

Continue reading

How to store a JWT in a cookie and auto-refresh the token using LexikJWTAuthenticationBundle

Looking to store your JWT in a cookie and auto refresh it before it expires when using the LexikJWTAuthenticationBundle? There’s a setting that tells the bundle to look for a JWT cookie, but there’s nothing that actually creates the cookie for you. That needs to be done manually. I’m going to assume if you’re here, you already have the bundle installed and are just looking for a way to store the JWT in a cookie, so I’m going to get straight to how you do it. Update the LexikJWTAuthenticationBundle config To tell the bundle that you want it to look

Continue reading

How to use git

Git can be a pain to learn when you’re first starting out. It didn’t actually click with me until I started using it everyday when I got a job. So, I thought it would be good to put together this little tutorial that I wish I had seen before starting my job. It would have helped me to understand git a whole lot more. Installing Git To start if you haven’t done so already, you’ll need to install git on your computer. Go to https://git-scm.com/downloads and download the version for your operating system. I’m on Windows, but the processes should

Continue reading

Vue.js Practice Project Ideas

Once you’ve done a few tutorials, usually it’s a good idea to work on something without an exact step by step guide. So, if that’s what you’re looking for, here are three project ideas that you can build. They’re all smaller projects so you can probably get them done in a couple hours to a few days. 1. QR Code Generator (Beginner) There’s a cool little service, QRtag.net, that lets you generate QR codes on the fly without any kind of backend process. You simply append the url you want to generate a QR code for to their api url

Continue reading

Tips for Integrating Vue.js into an Existing Project

A few months back I started to integrate Vue.js into an existing site at work. There was a new page they wanted that had a somewhat complicated UI so I thought it would be a good way to get some more experience with Vue. Since most tutorials teach you Vue from a standpoint of building a new site, I had to dig a little deeper to find out the best way to use Vue on an existing site. Here’s some of the more helpful things I learned while working on this project. Note: I’ll preface this by saying prior to

Continue reading

When should you use Vuex?

Have you ever heard the response: “you’ll just know”, when asking someone when you should use Vuex. Yeah, me too. When you ask this question anywhere online you get some good advice but you also get a lot of vague answers like: “You’ll just know” or “Vuex solves specific problems” (never actually says what kinds of problems) Hopefully with this post I’ll help you to know when it’s a good time to start using Vuex. I’m assuming you have an idea of what Vuex is if you found this page but just in case you don’t, here’s how the actual

Continue reading

Vue.js Server Side Rendering with PHP

Trying to get server side rendering to work with PHP to render your Vue.js app but are stuck? There’s a lot of great resources out there but I haven’t found anything that just works out of the box without some digging. Hopefully, after this post you’ll have a better idea of how to accomplish server side rendering for your Vue.js app! Requirements PHP 7.2 Node.js (My server has v8.9.4, I’m unsure if it will work on earlier versions, but if you have at least this version you should be good!) Creating our Vue App For this example, we’re going to

Continue reading

Finishing the Question/Answer App

Creating a website with Symonfy 4: Part 4 This post is part of a series where we’ve been building a Question/Answer web app. So far we have our login system built and the ability to ask a question. Today we’ll be updating our homepage to pull questions from the database, we’ll add the ability to answer questions, update our menu and add a way to track views on a question. If you haven’t been following from the start, you can download the code up to this point here. With that said, let’s get started! Updating our Menu To get the

Continue reading