WEBVTT

NOTE Created by CaptionSync from Automatic Sync Technologies www.automaticsync.com

00:00:00.106 --> 00:00:06.246 align:middle
Welcome to the first Symfony 7 tutorial!

00:00:06.526 --> 00:00:11.006 align:middle
My name is Ryan - I live here in the
fantasy world of Symfonycasts and...

00:00:11.276 --> 00:00:15.156 align:middle
I am beyond excited to be your
guide through this series all

00:00:15.156 --> 00:00:17.236 align:middle
about Symfony, web development...

00:00:17.426 --> 00:00:18.366 align:middle
bad jokes...

00:00:18.466 --> 00:00:23.876 align:middle
space animations, and most importantly,
building real things we can be proud of.

00:00:24.436 --> 00:00:26.886 align:middle
For me, it feels like I'm
the lucky person that gets

00:00:26.886 --> 00:00:30.106 align:middle
to give you a personal tour of the Enterprise...

00:00:30.106 --> 00:00:32.956 align:middle
or whatever nerdy thing gets you most excited.

00:00:32.956 --> 00:00:35.376 align:middle
And that's because, I love this stuff.

00:00:35.766 --> 00:00:40.706 align:middle
Bootstrapping databases, building beautiful
user interfaces, writing high-quality code...

00:00:40.896 --> 00:00:42.956 align:middle
it gets me out of bed in the morning.

00:00:43.606 --> 00:00:46.646 align:middle
And Symfony is the best tool
to do all of this...

00:00:46.896 --> 00:00:49.076 align:middle
and become a better developer along the way.

00:00:49.546 --> 00:00:54.786 align:middle
And that's really my goal: I want you
to enjoy all of this as much as I do ...

00:00:55.116 --> 00:01:00.166 align:middle
and to feel empowered to build all the amazing
things you have floating around in your mind.

00:01:00.926 --> 00:01:03.346 align:middle
Now, one of my favorite things
about teaching Symfony is

00:01:03.346 --> 00:01:05.726 align:middle
that our project is going to start tiny.

00:01:06.036 --> 00:01:07.426 align:middle
That makes it easy to learn.

00:01:07.786 --> 00:01:13.846 align:middle
But then, it'll scale up automatically as we
need more tools via a unique recipe system.

00:01:14.436 --> 00:01:19.116 align:middle
Symfony is actually a collection
of over 200 small PHP libraries.

00:01:19.286 --> 00:01:20.726 align:middle
So that's a ton of tools...

00:01:20.866 --> 00:01:22.836 align:middle
but we get to choose what we need.

00:01:23.466 --> 00:01:25.346 align:middle
Because, you might be building a pure API...

00:01:25.736 --> 00:01:30.476 align:middle
or a full web app, which is what
we'll focus on in this tutorial.

00:01:30.936 --> 00:01:35.736 align:middle
Though, if you are building an API, follow
the first few tutorials in this series,

00:01:36.016 --> 00:01:38.986 align:middle
then pop over to our API Platform tutorials.

00:01:39.606 --> 00:01:43.486 align:middle
API Platform is a mind-blowingly
fun &amp; powerful system

00:01:43.486 --> 00:01:46.736 align:middle
for making APIs, built right on top of Symfony.

00:01:47.426 --> 00:01:52.646 align:middle
Symfony is also blazingly fast, has
long-term support versions and works a lot

00:01:52.646 --> 00:01:58.696 align:middle
on creating a delightful developer experience
while keeping to programming best-practices.

00:01:59.146 --> 00:02:03.406 align:middle
This means we get to write high-quality
code and still get our work done quickly.

00:02:03.936 --> 00:02:06.086 align:middle
Ok, enough of me gushing about Symfony.

00:02:06.346 --> 00:02:07.206 align:middle
Ready to get to work?

00:02:07.516 --> 00:02:08.756 align:middle
Then beam aboard.

00:02:08.756 --> 00:02:11.906 align:middle
And head over to https://symfony.com/download.

00:02:12.406 --> 00:02:16.856 align:middle
This page has instructions on how to
download a standalone binary called symfony.

00:02:17.306 --> 00:02:19.626 align:middle
Now this is not Symfony itself...

00:02:19.656 --> 00:02:24.646 align:middle
it's just a little tool that'll help us do
things, like start new Symfony projects,

00:02:24.646 --> 00:02:28.606 align:middle
run a local web server or even
deploy our app to production.

00:02:29.286 --> 00:02:33.856 align:middle
Once you've downloaded and installed it,
open a terminal and move into any directory.

00:02:34.566 --> 00:02:37.856 align:middle
Check that the symfony binary is
ready to go by running: symfony --

00:02:37.856 --> 00:02:42.976 align:middle
help It's got a bunch of commands,
but we'll just need a few.

00:02:43.736 --> 00:02:49.836 align:middle
Before we start a project, also run symfony
check:req which stands for check requirements.

00:02:50.416 --> 00:02:53.826 align:middle
This makes sure that we have everything
on our system needed to run Symfony,

00:02:54.076 --> 00:02:57.666 align:middle
like PHP at the correct version
and some PHP extensions.

00:02:58.196 --> 00:03:01.086 align:middle
Once this is happy, we can start a new project!

00:03:01.686 --> 00:03:04.746 align:middle
Do it with symfony new and
then a directory name.

00:03:05.076 --> 00:03:06.776 align:middle
I'll call mine starshop.

00:03:07.036 --> 00:03:08.306 align:middle
More on that later.

00:03:09.356 --> 00:03:13.156 align:middle
This will give us a tiny project
with only the base things installed.

00:03:13.666 --> 00:03:17.096 align:middle
Then, we'll add more stuff
little-by-little along the way.

00:03:17.096 --> 00:03:18.146 align:middle
It's gonna be great!

00:03:18.676 --> 00:03:21.016 align:middle
But later, when you feel
comfortable with Symfony,

00:03:21.306 --> 00:03:25.666 align:middle
if you want to get started more quickly,
you can run the same command, but with --

00:03:25.666 --> 00:03:29.066 align:middle
webapp to get a project with
much more stuff pre-installed.

00:03:29.696 --> 00:03:35.176 align:middle
Anyway, move into the directory - cd starshop
- then I'll type ls to check things out.

00:03:35.676 --> 00:03:40.826 align:middle
Cool! We'll get to know these files in the
next chapter, but this is our project...

00:03:40.826 --> 00:03:42.496 align:middle
and it's already working!

00:03:43.016 --> 00:03:46.056 align:middle
To see it working in a browser,
we need to start a web server.

00:03:46.636 --> 00:03:50.966 align:middle
You can use any web server you want
- Apache, Nginx, Caddy, whatever.

00:03:51.586 --> 00:03:56.726 align:middle
But for local development, I highly recommend
using the symfony binary we just installed.

00:03:57.346 --> 00:04:03.516 align:middle
Run: symfony serve The first time you do this,
it might ask you to run another command to set

00:04:03.706 --> 00:04:08.966 align:middle
up an SSL certificate, which is nice
because then the server supports https.

00:04:09.596 --> 00:04:10.786 align:middle
And... bam!

00:04:10.946 --> 00:04:16.996 align:middle
We have a new web server for our project
running at https://127.0.0.1:8000.

00:04:17.516 --> 00:04:21.856 align:middle
Copy that, spin over to your most
favorite browser, paste and...

00:04:22.186 --> 00:04:23.756 align:middle
welcome to Symfony 7!

00:04:23.756 --> 00:04:25.286 align:middle
That's what I was going to say!

00:04:25.916 --> 00:04:29.746 align:middle
Next, let's sit down, order some
Earl Grey tea, and become friends

00:04:29.746 --> 00:04:31.776 align:middle
with every file in our new app...

00:04:31.946 --> 00:04:33.346 align:middle
which isn't very many.

