Skip to content

saulpatinojr/Personal-WAFLens

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WAFLens Project

This project is a web application built with Next.js, TypeScript, and Firebase. It's designed to be a well-structured, secure, and easily deployable application.

📝 Project Status

The initial setup and deployment of the WAFLens application are complete. The project is now in a stable state, with a functional CI/CD pipeline that deploys the front-end to Firebase Hosting and the backend services to Firebase Functions and Data Connect.

✅ Next Steps

The development roadmap and a detailed list of the next tasks are outlined in the TODO.md file. Please refer to it for the latest project priorities.

➡️ View the Project TODO List


🚀 Project Setup

Prerequisites

Installation

  1. Clone the repository:
    git clone <your-repository-url>
    cd <your-project-directory>
  2. Install root dependencies:
    npm install
  3. Install Firebase Functions dependencies:
    cd functions
    npm install
    cd ..

🔥 Firebase Configuration

1. Link Your Local Project

  • The .firebaserc file should be updated with your actual Firebase Project ID.
  • Log in to Firebase using the CLI:
    firebase login

2. Environment Variables

Gemini API Key

This project uses Genkit to interact with Google's Gemini models. You can get a key from Google AI Studio.

  • Local Development: Create a file named .env.local in the root of your project and add your API key:
    GEMINI_API_KEY="your-api-key-here"
    
  • Production (Firebase): Add the Gemini API key as a secret in your CI/CD environment (e.g., GitHub Actions).

📜 Available Scripts

  • npm run dev: Runs the Next.js front-end in development mode.
  • npm run build: Builds the application for production.
  • npm run lint: Lints the codebase.

Firebase Functions Scripts (from the functions/ directory)

  • npm run build: Compiles the TypeScript source code.
  • npm run lint: Lints the TypeScript code.

🚀 Deployment with GitHub Actions

This project is configured for CI/CD using GitHub Actions. The workflow automatically deploys the application to Firebase on every push to the main branch.

GitHub Secrets Configuration

For the deployment to work, you must configure secrets in your GitHub repository settings:

  1. FIREBASE_SERVICE_ACCOUNT:

    • In the Firebase Console, go to Project settings > Service accounts.
    • Click Generate new private key to download a JSON file.
    • Create a GitHub secret named FIREBASE_SERVICE_ACCOUNT and paste the entire content of the JSON file as the value.
  2. GEMINI_API_KEY:

    • Create a secret named GEMINI_API_KEY with your Gemini API key.

💿 Data Connect

This project uses Firebase Data Connect to provide a type-safe GraphQL data layer.

  • Schema: The GraphQL schema is defined in dataconnect/schema/schema.gql. A markdown version is also available for quick reference at dataconnect_schema.md.
  • Generated SDK: The TypeScript SDK is automatically generated by Data Connect and located in waflens-code/src/dataconnect-generated.

🔒 Security Rules

The firestore.rules file provides a basic security template that denies all reads and writes by default. This should be updated as you implement authentication.

Important Notes

  • ESLint v9: The functions directory uses the modern, flat eslint.config.js for improved code quality.
  • Performance: A page load delay was resolved by embedding an inline SVG favicon.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published