Adding a Database to Next.js 🖖 #5 Building an Online Business

preview_player
Показать описание

ACTUALLY - it's a bird's nest of code. Half the episode is looking for bug's 🐞🐞🐞. WHAT'S NOT TO LIKE ABOUT THAT??

Pair-programming episode on Fun Fun Function

Regular Expressions ULTRA BASICS

Pusher's dotenv article

Firebase Cloud Firestore documentation

The editor is called Visual Studio Code and is free

DevTips is a weekly show for X, Y, and Z who want to be inspired 👍 and learn 🖖 about programming. Hosted by David and MPJ - two notorious bug generators 💖 and teachers 🤗. Exploring code together and learning programming along the way - yay!
Рекомендации по теме
Комментарии
Автор

This is literally what development feels like. I love this video. This should be an example to anyone who is curious.

SteelVoltagerpg
Автор

The fact that you talk what your brain is thinking at the moment of writing code makes the video more interesting IMO, because it helps people that are not that experienced to think. Most of the tutorials go on auto-pilot putting code and what people usually do is write it. But when you talk what your brain is thinking makes it interesting. Nice tutorials it helped me understand a little bit Firebase and nextjs in the previous vids.

michaelmotam
Автор

14:56 you can simply "await" on the "get()" function since it returns a promise. You can surround it with try-catch to handle the error and do the rest of the code you did in the "then" as a normal function. You kinda wrote a hybrid between an async function and a function that uses promises.
23:46 Regarding the initialization of the app, you can do it as a "singleton". Create a variable inside the db.js file which will hold the initialized app. If the variable is not undefined return it, otherwise initialize the firebase, set the variable and return it.

ProgramArtist
Автор

i love the video, even knowing if it will help me or not . This is reality of how is the developer day

luberalexanderechavarriabe
Автор

Thank u for this awesome video and series

AbhishekKumar-mqtt
Автор

One thing that I found kinda quirky about using firebase with next js (or really any server framework) was the fact that firebase auth is highly dependent on the client side (using local storage vs cookies), so server side rendering was hardly used as the client had to be the one to check if the user was authenticated.

geooot
Автор

Firebase keys are not really a security thing. They're displayed in front-end source code anyway... But yes, they're environment variables

AlissonNunes
Автор

I agree with you, google isn't the best with UI and documentation

nnajiabraham
Автор

There are a ton of new js frameworks, but you still have to figure out yourself a lot of super basic things like connecting to a database.

AndreiTelteu
Автор

It's only necessary to use ENV variables whenever you think your code will public, it doesn't really matter if your code for your server side is all in the same file (example with an express server connecting to a DB, there is no way to access that other than having access to the server) right ?

victorjozwicki
Автор

What would you recommend as the best place to store your online database? Firebase, Mlab, etc?

BrianDriesenga
Автор

Hey quick question, would it be better to have an individual external css link for each page on your website when you have multiple pages and would this be a better way to clean up your code, thanks

sonoftroy
Автор

good job! I like next.js and firebase work together. I'm waiting for more features authentication etc

grigorischaram
Автор

I really hate Firebase ATM everyone is using it. there are some cool alternatives in this space.

BenjaminSweetnam
Автор

Great video! What song is that at 26:40? It's so good!!

michaelffasd
Автор

Hey David, you don't have a linter set up (and it looks like it takes you a lot of time to fix improper formatting), is this a conscious choice? and if so, why? if not, have you looked into prettier? Because you should :)

NilsWesthoff
Автор

You don't have to keep your firebase config secret, since that would be stupid since your browser needs it to communicate with firebase and with devtools you can easily find out the firebase config, it's set up it so you can only use the keys from certain domains

mika
Автор

Oh man hate when people dont use semicolons ;

strangeQuirks
Автор

I did better for my self first time working with firebase and nextjs altogether

EduardoRodriguezRocks
Автор

No god please no. Firebase sponsored you?

BalticWind