SalesFlow AI is a Next.js application that leverages AI-powered lead processing and email generation. It integrates with FastAPI and Flask backend services for advanced data processing.
- Upload and process CSV files with AI categorization
- Automated email generation based on processed leads
- User authentication (signup, login, password reset)
- Dashboard for managing leads and emails
- Node.js (v18 or higher recommended)
- npm or yarn
- Python 3.8+ (for FastAPI and Flask services)
- pip
- Git
git clone https://github.com/your-username/salesflow-ai.git
cd salesflow-ainpm install
# or
yarn installCopy the example environment file and update values as needed:
cp .env.local.example .env.localEdit .env.local to set your database URL, API endpoints, and any required secrets.
Required fields in .env.local:
DATABASE_URLRESEND_API_KEYAPP_URLAUTH_SECRETGEMINI_API_KEY
Setup RESEND_API_KEY for mailing purposes via Resend.
This project uses Prisma for database management.
npx prisma init
# schema is predefined.npx prisma migrate dev --name init
npx prisma generateTo seed the database (optional):
npm run seedTo use Gemini AI features, you need a Gemini API key.
- Get your Gemini API key from Google AI Studio.
- Add it to your
.env.localasGEMINI_API_KEY=your_key_here.
Navigate to the fast-api-service directory:
cd fast-api-serviceCreate and activate a virtual environment:
python -m venv venv
# On Windows:
venv\Scripts\activate
# On macOS/Linux:
source venv/bin/activateInstall dependencies:
pip install -r requirements.txtStart the FastAPI server:
uvicorn main:app --reloadThe FastAPI service should run on http://localhost:8000.
Navigate to the flask-service directory:
cd ../flask-serviceCreate and activate a virtual environment:
python -m venv venv
# On Windows:
venv\Scripts\activate
# On macOS/Linux:
source venv/bin/activateInstall dependencies:
pip install -r requirements.txtRun the Flask app:
python app.pyThe Flask service should run on http://localhost:5000.
Return to the root directory and start the development server:
cd ..
npm run dev
# or
yarn devThe app will be available at http://localhost:3000.
Ensure the uploads directory exists in the project root for file uploads:
mkdir -p uploadsAny CSV file you upload must have the following headers, in this exact order:
Lead_ID,Company_Name,Company_Client_Email,Email_Open_Rate,Click_Through_Rate,Past_Purchases,Response_Time,Marketing_Spend,Engagement_Score,Lead_Score,Lead_Source,Industry,Demo_Scheduled,Converted
Example:
Lead_ID,Company_Name,Company_Client_Email,Email_Open_Rate,Click_Through_Rate,Past_Purchases,Response_Time,Marketing_Spend,Engagement_Score,Lead_Score,Lead_Source,Industry,Demo_Scheduled,Converted
1,Acme Corp,client@acme.com,0.45,0.12,3,24,5000,75.5,80.2,Web,Technology,true,falseOpen http://localhost:3000 in your browser.
- Ensure all backend services (FastAPI, Flask) are running before uploading files or generating emails.
- Check
.env.localfor correct API URLs and secrets. - For database issues, verify your database connection and run migrations.
MIT