Cards in group
This card covers Firestore setup within the app code, including imports, initialization, and configuration. It does not cover advanced Firestore data modeling, querying syntax, security rules in depth, or Firebase Storage integration.
Learn how to initialize and configure Firestore within a Codeex AI-generated application, enabling efficient database connectivity and data operations.
Steps
- Install Firebase SDK if not already included in the Codeex project.
- Import Firebase app and Firestore modules at the beginning of your main application code.
- Create a Firebase configuration object containing your project's API key, project ID, and other settings from the Firebase console.
- Initialize the Firebase app with the configuration object using the Firebase initializeApp method.
- Initialize Firestore by calling getFirestore on the initialized Firebase app instance.
- Verify the Firestore instance is linked correctly by attempting to read or write a simple document in your app's initial run.
- Configure environment settings to securely store your Firebase configuration details and prevent exposure in public repos or builds.
Materials: https://firebase.google.com/docs/web/setup, https://firebase.google.com/docs/firestore/quickstart, Codeex AI-generated app documentation for Firebase integration
15 minDifficulty: beginnerDomains: software development, cloud databases, Firebase, Firestore
This card covers structuring Firestore collections and documents, schema design principles, and query optimization strategies within Firestore. It does not cover Firestore connection setup, data security rules beyond structural implications, or Firebase Storage file management.
You will learn best practices for organizing Firestore data using collections and documents, enabling efficient queries and maintainable data structures tailored for Codeex AI-generated applications.
Steps
- Understand the Firestore data model: collections contain documents, documents contain fields and can embed subcollections.
- Learn to avoid deeply nested data to maintain query efficiency and flexibility.
- Design collections around entities or logical groupings relevant to your application domain.
- Use document IDs thoughtfully: structured IDs for meaningful data or auto-generated for simplicity.
- Implement one-to-many relationships by embedding or using subcollections depending on query needs.
- Apply data duplication judiciously to optimize read performance while managing consistency.
- Create indexes thoughtfully to support frequent queries, enabling efficient retrieval without full scans.
- Example: For a blogging app, have a 'posts' collection with individual post documents, and subcollections like 'comments' within each post document.
- Example: In Codeex apps, organize user data in 'users' collection, with embedded preferences fields and a 'user_activity' subcollection for scalable activity tracking.
- Review sample Firestore schemas and test query performance within the Codeex application environment.
Materials: https://firebase.google.com/docs/firestore/data-model, https://firebase.google.com/docs/firestore/manage-data/structure-data, https://firebase.google.com/docs/firestore/query-data/index-overview, https://firebase.google.com/docs/firestore/security/rules-structure, Codeex Firestore integration documentation
20 minDifficulty: intermediateDomains: Software Development, Database Design, Cloud Computing, Firestore, Firebase
This card focuses on programmatic data operations in Firestore using Codeex-generated applications, covering basic CRUD operations. It does not cover advanced querying techniques like aggregation, offline persistence, or complex transaction management.
You will gain practical skills to perform create, read, update, and delete (CRUD) operations on Firestore documents within a Codeex AI-generated app, enabling dynamic data interaction.
Steps
- Initialize Firestore in your Codeex app following the setup from the previous card.
- Create a reference to the Firestore collection where data will be stored.
- Add a new document programmatically to the collection using Firestore's add method.
- Retrieve documents from a collection using get() and understand how to handle query snapshots.
- Update specific fields within an existing document using update() method.
- Delete a document by referencing its ID and invoking delete().
- Handle asynchronous operations and errors using async/await or Promises to ensure data consistency.
- Test each CRUD operation within the app to verify correct behavior and error handling.
Materials: https://firebase.google.com/docs/firestore/manage-data/add-data, https://firebase.google.com/docs/firestore/query-data/get-data, https://firebase.google.com/docs/firestore/manage-data/delete-data, https://firebase.google.com/docs/firestore/manage-data/update-data
25 minDifficulty: beginnerDomains: software development, cloud databases, firebase, app development
This card focuses exclusively on Firebase Storage setup and file operations within Codeex AI-generated apps. It does not cover Firestore database usage, advanced security rules beyond basics, or integration with other Firebase services such as Authentication or Cloud Functions.
You will gain hands-on experience configuring Firebase Storage in Codeex-generated applications, enabling you to upload, retrieve, and delete files programmatically while managing permissions effectively.
Steps
- Initialize Firebase Storage module in the Codeex app environment following best practices for environment configuration.
- Write code to upload files from local or user input to Firebase Storage, including progress monitoring and error handling.
- Implement file retrieval by generating downloadable or viewable URLs for stored files, explaining use cases for public and authenticated access.
- Show how to delete files from Firebase Storage programmatically and handle potential failure cases.
- Demonstrate how to set and update Storage security rules in Firebase to control read/write permissions according to app user roles or authentication status.
- Test all operations within the Codeex-generated app to validate correct Storage integration and permissions setup.
Materials: https://firebase.google.com/docs/storage/web/start, https://firebase.google.com/docs/storage/security, https://firebase.google.com/docs/storage/web/upload-files, https://firebase.google.com/docs/storage/web/download-files, Codeex official documentation on integrating Firebase Storage module
30 minDifficulty: beginnerDomains: cloud storage, mobile development, web development, firebase, codeex AI, file management
This card covers crafting and implementing security rules for Firestore databases and Firebase Storage buckets. It explains the syntax and logic to configure granular access control based on user authentication, data attributes, and roles. It does not cover Firebase Authentication setup itself or advanced auditing beyond rule logic.
You will learn to write and apply security rules for Firestore and Firebase Storage that enforce appropriate read and write permissions, protect sensitive data, ensure data integrity, and maintain user privacy in your Codeex AI-generated applications.
Steps
- Understand the role and importance of security rules in Firestore and Firebase Storage.
- Learn the basic syntax and structure of Firestore security rules and Storage security rules.
- Explore examples of common Firestore rules controlling read and write access based on user authentication and document fields.
- Learn to write Storage rules that control file upload, download, and deletion permissions based on user identity and metadata.
- Understand how to test security rules using Firebase emulator or console to validate access controls.
- Review best practices for writing maintainable, least-privilege security rules.
- Deploy security rules to your Firebase project and monitor their effect via Firebase console analytics.
Materials: https://firebase.google.com/docs/firestore/security/get-started, https://firebase.google.com/docs/storage/security, https://firebase.google.com/docs/rules/emulator-setup, https://firebase.google.com/docs/rules/basics
30 minDifficulty: intermediateDomains: cloud security, database management, mobile and web development, Firebase