A Key Account Manager (KAM) Lead Management System built to efficiently manage Restaurants, Contacts, and Interactions, providing an intuitive interface for streamlined operations.
- 🏢 Manage Restaurants: Add, update, and track restaurant details.
- 📇 Manage Contacts: Maintain and organize contacts effortlessly.
- 📅 Manage Interactions: Keep track of communications and follow-ups.
- 🔒 Authentication: User login and access control.
- 📊 Metrics Dashboard: Analytics and key performance indicators (KPIs).
- 🌐 Tech Stack:
- Frontend: React.js, Vite with Material-UI
- Backend: Flask with SQLAlchemy + Redis + Gunicorn
- Database: PostgreSQL
Ensure the following tools are installed on your system:
- Node.js (v16+)
- Python (v3.8+)
- PostgreSQL
- Git
- Redis (v6+)
- Gunicorn
- npm or yarn
- pip
git clone https://github.com/CulturalProfessor/kam-system
cd kam-system
-
Navigate to the Backend Directory:
cd server
-
Create and Activate a Virtual Environment:
python3 -m venv venv source venv/bin/activate
-
Install Dependencies:
pip install -r requirements.txt
-
Configure Environment Variables:
Create a.env
file in the server directory with the following content:SECRET_KEY=some-super-secret-key DATABASE_URL=your-db-url JWT_SECRET_KEY=some-random-value CACHE_REDIS_URL=redis://localhost:6379/0 REDIS_HOST=localhost REDIS_PORT=6379 REDIS_DB=0 API_URL=http://127.0.0.1:5000/api
-
Initialize and Apply Migrations:
flask db init flask db migrate -m "Initial migration" flask db upgrade
-
Run the Backend Server:
python3 app.py
The backend will be accessible at http://127.0.0.1:5000.
-
Navigate to the Frontend Directory:
cd client
-
Install Dependencies:
npm install
(Or
yarn install
if you prefer Yarn.) -
Configure Environment Variables:
Create a.env
file in the frontend directory with the following content:VITE_SERVER_URL=http://127.0.0.1:5000/api
-
Start the Frontend Server:
npm run dev
The frontend will be accessible at http://127.0.0.1:5173.
-
Start the Backend Server:
Open a terminal and run:flask run
-
Start the Frontend Server:
Open another terminal and run:npm run dev
Now you can access the full application at http://127.0.0.1:5173.
You can deploy the backend on platforms like Render, Heroku, or AWS EC2.
We'll use Render for this example.
- Add a Redis Addon in Render (if using free tier).
- The Redis URL will be provided by Render, and should replace the local Redis URL in the
.env
file.
- Push your code to a GitHub repository and connect it with Render.
- Set up the environment variables in Render’s dashboard.
- Deploy the app using Gunicorn with:
gunicorn -b 0.0.0.0:5000 app:flask_app
Connect your GitHub repository to Vercel. Vercel automatically detects the frontend framework (Vite) and handles the build and deployment.
Set the following environment variable for the frontend on Vercel:
VITE_SERVER_URL=https://your-backend-url.onrender.com/api
- Ensure PostgreSQL is running locally or have any other deployed instance, and the
DATABASE_URL
in the.env
file matches your database configuration. - Use
npm
oryarn
based on your preference to install and manage frontend dependencies. - For any issues, check the terminal logs for debugging information.