Skip to content

chrisnoden/nuxt-symfony-client

Repository files navigation

Introduction

This repo is part of a client/server project. The client (front-end) is served using Nuxt v3 and the server (back-end) serves RESTful JSON API using Symfony 7.2 built on PHP 8.3

The intention is that the back-end server is deployed behind a firewall and is only accessible by the front-end (Nuxt) server. The BFF (back-end for front-end) pattern is used in the front-end.

Thus, this Nuxt project provides server/api code that, in effect, proxies the communications between the front-end and the back-end.

Key cookies for the Symfony Security bundle are automatically passed to the back-end. CSRF is injected into nearly all the api routes.

This nuxt implementation uses the v4 compatability mode.

NB

I use a Mac (with Apple Silicon) so all my bash commands are tested on the Mac terminal.

Dev Setup

Make sure to create a .env file and install the dependencies:

cp .env.example .env
yarn install

You should edit the .env file to suit your environment

Install a local certificate for SSL browsing:

brew install mkcert
mkcert fe.nss.wip
mkcert -install

You will need to edit your etc/hosts file (on MacOs this is sudo vi /etc/hosts) add the line 127.0.0.1 fe.nss.wip

Start the development server and open a browser tab to it:

yarn dev -o

Good To Know Stuff

There are a number of tools/libraries/frameworks that I love and have used some of them in this project:

I also try very hard to do "TypeScript" (but can't promise I'm good at it) and I use the composition API for the vue components.

About

A client/server framework with Nuxt v3/v4 (using BFF) as the front-end client

Topics

Resources

License

Stars

Watchers

Forks