Skip to content

Latest commit

 

History

History
230 lines (175 loc) · 6.54 KB

File metadata and controls

230 lines (175 loc) · 6.54 KB

Step-by-Step Development Guide for GreenReguAI MVP

Use this checklist to guide your development process. You can tick off each item as you complete it.


Phase 1: Planning and Setup

  • Set Up Version Control and Project Repository
    • Initialize a Git repository for your project.
    • Create a remote repository on GitHub, GitLab, or Bitbucket.
  • Establish Project Structure
    • Frontend:
      • Initialize a React.js project using create-react-app or similar.
      • Set up folders for components, pages, assets, and services.
    • Backend:
      • Set up a Python virtual environment.
      • Initialize a FastAPI project.
      • Organize folders for routers, models, schemas, services, and database interactions.
  • Install Necessary Dependencies
    • Frontend:
      • Install React Router.
      • Install Axios for API calls.
      • Install UI libraries (e.g., Material-UI, Bootstrap).
    • Backend:
      • Install FastAPI and Uvicorn.
      • Install Pydantic for data validation.
      • Install Supabase Python client.
      • Install Langchain for LLM integration.

Phase 2: Designing User Flows and Wireframes

  • Define User Stories and Flows
    • Revisit user personas and stories from the PRD.
    • Map out user journeys for:
      • Registration
      • Logging in
      • Querying the AI
      • Purchasing credits
  • Create Wireframes for Core Pages
    • Use a v0 or bolt.new:
      • Home/Landing Page
      • Sign Up/In Page
      • Dashboard
      • AI Chat Interface
      • Document Search Interface
      • Billing Page

Phase 3: Implementing User Authentication

  • Backend - Set Up Supabase Authentication
    • Create a project on Supabase.
    • Configure authentication for email/password sign-up and login.
    • Set up user tables and configure policies.
  • Frontend - Develop Authentication Pages
    • Build the Sign Up page with form validation and error handling.
    • Build the Login page with form validation and error handling.
    • Connect the forms to Supabase authentication APIs.
  • Implement Protected Routes
    • Ensure only authenticated users can access protected pages.
    • Implement route guards or higher-order components in React.

Phase 4: Document Management System Setup

  • Set Up Document Storage Infrastructure
    • Configure Supabase Storage for official PDFs
    • Create document metadata tables in Supabase:
      • Documents table (title, date, region, category)
      • Document chunks table
    • Implement Document Search Functionality
      • Backend part
      • Frontend part

Phase 5: Document Library Implementation

  • Backend - Document Library APIs

    • Create endpoints for document listing
    • Implement filtering and search functionality
    • Add document metadata retrieval
    • Set up PDF serving endpoints
  • Frontend - Document Library Interface

    • Enhance existing Document Library page:
      • Add document browsing interface
      • Implement filtering system
      • Implement metadata-based search
    • Create document detail view

Phase 6: AI Assistant Integration

  • Document Processing Pipeline

    • PDF Processing Service
    • Chunking Service
    • Embedding Service
  • Query Processing System

    • Query Handler
    • Retrieval System
    • Response Generator
  • Backend API Development

    • Create chat endpoint
    • Implement citation retrieval
    • Set up error handling
    • Add logging system
  • Frontend Enhancement

    • PDF Preview Functionality:
      • Implement PDF viewer modal
      • Add citation highlighting
      • Enable section navigation
    • Update chat interface with citations

Phase 7: Document Library Enhancement

  • Performance Optimization

    • Implement pagination for document listing
    • Optimize document fetching and loading
    • Add loading states and error handling
  • Content Population

    • Research and compile list of essential environmental regulations
    • Upload and process at least 100 key documents
    • Ensure global coverage of regulations
    • Verify document processing quality

Phase 8: Payment Integration and Pricing

  • Stripe Integration

    • Set up Stripe account and API keys
    • Implement checkout session endpoints
    • Handle webhook events for payment confirmation
    • Update credit balance system
  • Pricing Implementation

    • Update landing page with new pricing structure
    • Create billing page with credit packages
    • Implement credit purchase flow
    • Add credit balance display

Phase 9: Testing and Deployment

  • User Testing

    • Conduct comprehensive testing with new users
    • Document and fix identified issues
    • Test all payment flows
  • Deployment Preparation

    • Set up production hosting environments
    • Configure SSL certificates
    • Update API endpoints for production
    • Set up monitoring and logging
  • Launch

    • Deploy backend API
    • Deploy frontend application
    • Perform final testing in production
    • Official product launch

Deployment Guide

Prerequisites

  • GitHub repository connected to Render
  • Supabase project set up
  • Pinecone index created
  • OpenAI API key

Environment Variables Setup

Backend (Render Web Service)

Required environment variables:

  • ENV=production
  • PORT=8000
  • SUPABASE_URL
  • SUPABASE_KEY
  • SUPABASE_SERVICE_KEY
  • OPENAI_API_KEY
  • PINECONE_API_KEY
  • PINECONE_ENVIRONMENT
  • PINECONE_INDEX_NAME
  • STORAGE_BUCKET=official_documents

Frontend (Render Static Site)

Required environment variables:

  • NODE_ENV=production
  • REACT_APP_API_URL=/api
  • REACT_APP_SUPABASE_URL
  • REACT_APP_SUPABASE_ANON_KEY

Deployment Steps

  1. Backend Deployment

    • Build Command: pip install -r requirements.txt
    • Start Command: uvicorn main:app --host 0.0.0.0 --port $PORT
    • Auto-Deploy: Enabled
    • Environment: Python 3.12
  2. Frontend Deployment

    • Build Command: npm install && npm run build
    • Output Directory: build
    • Auto-Deploy: Enabled
    • Environment Variables: Configure as listed above
  3. Post-Deployment Verification

    • Check health endpoint: /health
    • Verify CORS configuration
    • Test document upload functionality
    • Test chat functionality
    • Monitor rate limiting