Configure your development environment with Cursor, React Native, and Firebase
Before diving into app development, we need to configure our environment. In this lesson, we'll set up Cursor, React Native with Expo, and Firebase to prepare for building the MealSnap app.
Key Takeaway: A properly configured development environment is crucial for productivity. We'll use AI tools to streamline this process.
Let's start by installing Cursor, the AI-powered code editor we'll use throughout this course:
"Why Cursor? It combines VS Code's functionality with integrated AI features that will dramatically accelerate our development process."
Next, we'll configure React Native using Expo, which simplifies mobile development:
npm install -g expo-cli
Create a new project directory and initialize a React Native app:
mkdir MealSnap
cd MealSnap
npx create-expo-app .
We'll set up Firebase to handle authentication and data storage:
Install the Firebase SDK in your project:
npm install firebase
Create a firebase.js file in your project:
// firebase.js
import { initializeApp } from "firebase/app";
import { getAuth } from "firebase/auth";
import { getFirestore } from "firebase/firestore";
const firebaseConfig = {
apiKey: "YOUR_API_KEY",
authDomain: "YOUR_PROJECT_ID.firebaseapp.com",
projectId: "YOUR_PROJECT_ID",
storageBucket: "YOUR_PROJECT_ID.appspot.com",
messagingSenderId: "YOUR_MESSAGING_SENDER_ID",
appId: "YOUR_APP_ID"
};
const app = initializeApp(firebaseConfig);
const auth = getAuth(app);
const db = getFirestore(app);
export { app, auth, db };
To maximize AI assistance, we'll set up Cursor rules for our project:
// .cursor-rules
{
"language": "javascript",
"component_style": "functional",
"css_framework": "react-native",
"file_naming": "lowercase-with-dashes",
"architecture": {
"state_management": "react-hooks",
"api_layer": "firebase"
},
"folder_structure": {
"components": "src/components",
"screens": "src/screens",
"services": "src/services",
"utils": "src/utils"
}
}
Follow the steps from this lesson to create your own development environment: