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.
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.
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.
- Node.js (v20 or later recommended)
- npm
- Firebase CLI (
npm install -g firebase-tools)
- Clone the repository:
git clone <your-repository-url> cd <your-project-directory>
- Install root dependencies:
npm install
- Install Firebase Functions dependencies:
cd functions npm install cd ..
- The
.firebasercfile should be updated with your actual Firebase Project ID. - Log in to Firebase using the CLI:
firebase login
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.localin 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).
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.
npm run build: Compiles the TypeScript source code.npm run lint: Lints the TypeScript code.
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.
For the deployment to work, you must configure secrets in your GitHub repository settings:
-
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_ACCOUNTand paste the entire content of the JSON file as the value.
-
GEMINI_API_KEY:- Create a secret named
GEMINI_API_KEYwith your Gemini API key.
- Create a secret named
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 atdataconnect_schema.md. - Generated SDK: The TypeScript SDK is automatically generated by Data Connect and located in
waflens-code/src/dataconnect-generated.
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.
- ESLint v9: The
functionsdirectory uses the modern, flateslint.config.jsfor improved code quality. - Performance: A page load delay was resolved by embedding an inline SVG favicon.