Key Concepts
- React: A JavaScript library for building user interfaces.
- Node.js: A JavaScript runtime environment that allows you to run JavaScript on the server-side.
- Git: A distributed version control system for tracking changes in source code.
- GitHub: A web-based platform for version control and collaboration using Git.
- Firebase: A backend-as-a-service (BaaS) platform that provides various tools and services for building web and mobile applications.
- API Key: A code used to identify and authenticate an application or user when accessing an API.
- SSH Key: A cryptographic key pair used for secure identification.
- Terminal: A command-line interface used to interact with the operating system.
- Homebrew: A package manager for macOS that simplifies the installation of software.
- NPM (Node Package Manager): A package manager for Node.js that allows you to install and manage dependencies.
- Localhost: A hostname that refers to the local computer.
- High-Risk Variables: Sensitive data, such as API keys and passwords, that should be protected from unauthorized access.
- .env file: A file used to store environment variables, which are configuration settings that can be used to customize the behavior of an application.
- Firebase CLI (Command Line Interface): A tool for managing Firebase projects from the command line.
- Firebase Hosting: A service for hosting web applications and static content.
- Monorepo: A software development strategy where all projects and their dependencies are stored in a single repository.
- Polyrepo: A software development strategy where each project and its dependencies are stored in separate repositories.
Setting Up the Development Environment
Creating Accounts on Relevant Platforms
- Firebase and GCP (Google Cloud Platform):
- Go to firebase.com and click "Get started."
- Create an account or log in. It's free to start.
- Bumpups:
- Go to bubs.com and create an account.
- Enable the API in settings and create an API key (e.g., "tube stamp").
- Consider restricting the API key by endpoint for security.
- New users get $5 of free API credits.
- GitHub:
- Go to github.com and sign up with your email.
- It's free to start.
- Monetization (Future):
- Google Ads will be used for monetization in later episodes.
- Alternative: Stripe for subscription-based models (e.g., $20/$40 per month or annual plans).
Installing Dependencies
- Node.js: Required for using React.
- Git: Required for using GitHub.
- Firebase: Required for connecting to the backend.
- Detailed Instructions:
- A Google Doc with commands for Mac, Linux, and Windows is provided in the description.
- Use a terminal window.
- Mac: Search for "terminal."
- Windows: Search for "terminal."
- Homebrew (Mac Only):
- Install Homebrew using the provided command.
- Add Homebrew to the path using the provided command, replacing "your name" with your actual Mac username.
- Install Node.js using
brew install node.
- Creating the Code Folder:
- Right-click and create a new folder.
- Name the folder in lowercase with no spaces or special characters (e.g., "tube stamp prod").
- Place the folder in a known location (e.g., Documents).
- Open the folder in Cursor AI (or VS Code, etc.) using "Open Project."
Creating a React App
- Accessing the Folder in Terminal:
- Option 1 (Within Cursor AI): Open the terminal within Cursor AI. The terminal should display the folder name (e.g., "tube stamp prod").
- Option 2 (Separate Terminal Window):
- Open a new terminal window (command+N on Mac).
- Use the
cdcommand to navigate to the folder:cd ~/Documents/tube stamp prod(replace with your actual path).
- Creating the React App:
- Use the command
npx create-react-app .(the dot specifies the current directory). - This will install the necessary React files and dependencies.
- Use the command
- Running the React App:
- Use the command
npm startin a separate terminal window. - This will render the app in localhost:3000.
- Changes made to the code will be reflected live in the browser.
- Use the command
Connecting to GitHub
Creating a Private Repository
- Go to your GitHub account and click "New."
- Name the repository (ideally the same as the local folder, e.g., "tube stamp prod").
- Choose "Private" for the repository visibility.
- Click "Create repository."
Setting Up SSH Keys
- Go to GitHub settings -> SSH and GPG keys.
- Click "New SSH key."
- Generating the SSH Key (Terminal):
- Open a new terminal window.
- Use the command
ssh-keygen -t ed25519 -C "[email protected]"(replace with your GitHub email). - Press enter for all prompts (accept defaults).
- Use the command
cat ~/.ssh/id_ed25519.pubto display the public key.
- Adding the SSH Key to GitHub:
- Copy the entire public key.
- Paste the key into the "Key" field on GitHub.
- Give the key a title (e.g., "MacBook key").
- Click "Add SSH key."
- Installing Git:
- Use
brew install git(if you have Homebrew).
- Use
- Connecting Local Code to GitHub:
git init(initializes a Git repository in the folder)git remote add origin <repository_URL>(replace with your repository URL from GitHub)git add .(adds all files to the staging area)git commit -m "First commit"(commits the changes with a message)git branch -M main(renames the branch to main)git push -u origin main(pushes the code to the GitHub repository)
Committing Changes
- Make changes to the code.
git add .git commit -m "Your commit message"git push origin main
Connecting to Firebase
Creating a Firebase Project
- Go to Firebase and click "Create Firebase project."
- Name the project (e.g., "tube stamp prod").
- Enable Google Analytics (optional).
- Create a Google Analytics account or select an existing one.
- Choose "Web app" as the platform.
- Name the app (e.g., "tube stamp").
- Set up Firebase Hosting.
- Register the app.
Connecting Local Code to Firebase
- Install Firebase:
npm install firebase
- Create
firebase.js:- Create a new file named
firebase.jsin thesrcfolder. - Copy the Firebase configuration code from the Firebase console and paste it into
firebase.js.
- Create a new file named
- Create
.env:- Create a new file named
.envin the root directory. - Store high-risk variables (API keys, etc.) in the
.envfile. - Example:
REACT_APP_API_KEY=your_api_key
- Create a new file named
- Update
firebase.js:- Modify
firebase.jsto reference the variables from the.envfile usingprocess.env.REACT_APP_API_KEY.
- Modify
- Create
.gitignore:- Create a new file named
.gitignorein the root directory. - Add
.envto the.gitignorefile to prevent it from being committed to GitHub.
- Create a new file named
- Install Firebase CLI:
npm install -g firebase-tools
- Login to Firebase:
firebase logout(if you've logged in before)firebase login- Choose the email associated with your Firebase account.
- Allow Firebase CLI to access your account.
- Use the Correct Project:
firebase use <your_project_id>(replace with your Firebase project ID)
- Initialize Firebase:
firebase init- Select "Hosting."
- Use "public" as the public directory.
- Configure as a single-page app: No
- Overwrite index.html: No
- Deploy to Firebase Hosting:
npm run build(builds the React app)firebase deploy(deploys the app to Firebase Hosting)
- Troubleshooting White Screen:
- If you get a white screen, create
firebase.jsonandfirebase.ercfiles in the root directory. firebase.json:{ "hosting": { "public": "build", "ignore": [ "firebase.json", "**/.*", "**/node_modules/**" ], "rewrites": [ { "source": "**", "destination": "/index.html" } ] } }firebase.erc:{ "projects": { "default": "<your_project_id>" } }- Replace
<your_project_id>with your Firebase project ID. - Redeploy:
firebase deploy
- If you get a white screen, create
Final Commit
git add .git commit -m "Firebase get react all set up"git push origin main
Conclusion
The video provides a comprehensive guide to setting up a development environment for coding with AI, covering essential tools and platforms like React, Node.js, Git, GitHub, and Firebase. It includes step-by-step instructions for installing dependencies, creating a React app, connecting to GitHub using SSH keys, and deploying the app to Firebase Hosting. The video also emphasizes the importance of securing high-risk variables and provides troubleshooting tips for common issues. The final result is a fully functional development environment with version control and a live website link.
AI summaries can miss context or contain errors. Check important details against the original video.





