Lin / README.md
Zelyanoth's picture
fff
25f22bf
metadata
title: Lin - LinkedIn Community Manager
sdk: docker
app_file: app.py
license: mit

Lin - Community Manager Assistant for LinkedIn

A comprehensive community management tool that helps you automate and streamline your LinkedIn activities.

πŸš€ Quick Start

Prerequisites

  • Node.js (v16 or higher)
  • Python (v3.8 or higher)
  • npm (v8 or higher)

Installation

Option 1: Using the root package.json (Recommended)

# Clone the repository
git clone <repository-url>
cd Lin

# Install all dependencies
npm install

# Setup the project
npm run setup

# Start both frontend and backend
npm start

Option 2: Manual installation

# Install frontend dependencies
cd frontend
npm install

# Install backend dependencies
cd ../backend
pip install -r requirements.txt

# Return to root directory
cd ..

πŸ“ Project Structure

Lin/
β”œβ”€β”€ package.json              # Root package.json with combined scripts
β”œβ”€β”€ frontend/                 # React frontend application
β”‚   β”œβ”€β”€ package.json          # Frontend-specific dependencies
β”‚   β”œβ”€β”€ src/                  # React source code
β”‚   β”œβ”€β”€ public/               # Static assets
β”‚   └── build/                # Build output
β”œβ”€β”€ backend/                  # Flask backend API
β”‚   β”œβ”€β”€ app.py                # Main application file
β”‚   β”œβ”€β”€ requirements.txt      # Python dependencies
β”‚   β”œβ”€β”€ api/                  # API endpoints
β”‚   β”œβ”€β”€ models/               # Data models
β”‚   β”œβ”€β”€ services/             # Business logic
β”‚   └── utils/                # Utility functions
└── README.md                 # This file

πŸ› οΈ Development

Available Scripts

From the project root directory, you can use the following commands:

Installation

  • npm install - Install root dependencies
  • npm run install:frontend - Install frontend dependencies
  • npm run install:backend - Install backend dependencies
  • npm run install:all - Install all dependencies
  • npm run install:all:win - Install all dependencies (Windows-specific)

Development Servers

  • npm run dev:frontend - Start frontend development server
  • npm run dev:backend - Start backend development server
  • npm run dev:all - Start both servers concurrently
  • npm run start - Alias for npm run dev:all
  • npm run start:frontend - Start frontend only
  • npm run start:backend - Start backend only

Build & Test

  • npm run build - Build frontend for production
  • npm run build:prod - Build frontend for production
  • npm run preview - Preview production build
  • npm run test - Run frontend tests
  • npm run test:backend - Run backend tests
  • npm run lint - Run ESLint
  • npm run lint:fix - Fix ESLint issues

Setup & Maintenance

  • npm run setup - Full setup (install + build)
  • npm run setup:win - Full setup (Windows-specific)
  • npm run clean - Clean build artifacts
  • npm run reset - Reset project (clean + install)

Directory Navigation

Important: Most npm commands should be run from the project root directory where the main package.json is located.

Command Prompt (Windows)

# Navigate to project root (if not already there)
cd C:\Users\YourUser\Documents\Project\Lin_re\Lin

# Install dependencies
npm install

# Start development servers
npm start

# Or start individually
npm run dev:frontend
npm run dev:backend

PowerShell (Windows)

# Navigate to project root (if not already there)
cd C:\Users\YourUser\Documents\Project\Lin_re\Lin

# Install dependencies
npm install

# Start development servers
npm start

# Or start individually
npm run dev:frontend
npm run dev:backend

Linux/macOS

# Navigate to project root (if not already there)
cd /path/to/your/project/Lin

# Install dependencies
npm install

# Start development servers
npm start

# Or start individually
npm run dev:frontend
npm run dev:backend

πŸ”§ Environment Setup

Frontend Environment

# Copy environment file
cd frontend
cp .env.example .env.local

# Edit environment variables
# Open .env.local and add your required values

Backend Environment

# Copy environment file
cd backend
cp .env.example .env

# Edit environment variables
# Open .env and add your required values

Required Environment Variables

Frontend (.env.local)

Backend (.env)

  • SUPABASE_URL - Your Supabase project URL
  • SUPABASE_KEY - Your Supabase API key
  • CLIENT_ID - LinkedIn OAuth client ID
  • CLIENT_SECRET - LinkedIn OAuth client secret
  • REDIRECT_URL - LinkedIn OAuth redirect URL
  • HUGGING_KEY - Hugging Face API key
  • JWT_SECRET_KEY - Secret key for JWT token generation
  • SECRET_KEY - Flask secret key
  • DEBUG - Debug mode (True/False)
  • SCHEDULER_ENABLED - Enable/disable task scheduler (True/False)
  • PORT - Port to run the application on (default: 5000)

🌐 Development URLs

πŸ” Troubleshooting

Common Issues

1. ENOENT Error: no such file or directory

Problem: Running npm commands from the wrong directory Solution: Always run npm commands from the project root directory where package.json is located

# Check if you're in the right directory
ls package.json

# If not, navigate to the root directory
cd /path/to/project/Lin

2. Port Already in Use

Problem: Port 3000 or 5000 is already in use Solution: Change ports or stop conflicting services

Command Prompt:

# Check what's using port 3000
netstat -ano | findstr :3000

# Check what's using port 5000
netstat -ano | findstr :5000

PowerShell:

# Check what's using port 3000
netstat -ano | Select-String ":3000"

# Check what's using port 5000
netstat -ano | Select-String ":5000"

3. Python/Node.js Not Recognized

Problem: Python or Node.js commands not found Solution: Ensure Python and Node.js are added to your system PATH

Windows:

  1. Open System Properties > Environment Variables
  2. Add Python and Node.js installation directories to PATH
  3. Restart your terminal

4. Permission Issues

Problem: Permission denied errors Solution: Run terminal as Administrator or check file permissions

Windows-Specific Issues

File Copy Commands

Command Prompt:

# Copy frontend environment file
copy frontend\.env.example frontend\.env.local

# Copy backend environment file
copy backend\.env.example backend\.env

PowerShell:

# Copy frontend environment file
Copy-Item frontend\.env.example -Destination frontend\.env.local

# Copy backend environment file
Copy-Item backend\.env.example -Destination backend\.env

Python Installation Issues

# If pip fails, try using python -m pip
cd backend
python -m pip install -r requirements.txt

πŸ“š Additional Resources

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

  • Built with React, Flask, and Tailwind CSS
  • Powered by Supabase for authentication and database
  • LinkedIn API integration for social media management
  • Hugging Face for AI-powered content generation