A real-time sentiment analysis tool for tweets, built with Next.js, TypeScript, and Tailwind CSS. This project uses Natural Language Processing (NLP) to analyze the sentiment of tweets and classify them as Positive, Negative, or Neutral.
tweet-sentiment-analysis/
ā āāā package.json # Project dependencies & scripts
ā āāā tsconfig.json # TypeScript configuration
ā āāā vite.config.ts # Vite configuration
ā āāā public/ # Static assets (favicon, images, etc.)
ā āāā src/ # Main source code
ā ā āāā App.tsx # Root component
ā ā āāā main.tsx # Vite entry point
ā ā āāā index.css # Global styles
ā ā āāā types.ts # TypeScript types
ā ā āāā vite-env.d.ts # Vite environment types
ā ā āāā components/ # Reusable components
ā ā ā āāā TweetCard.tsx # Component for displaying tweets
ā ā ā āāā TweetInput.tsx # Input box for analyzing tweets
ā ā āāā services/ # API calls and utilities
ā ā ā āāā sentiment.ts # Sentiment analysis logic
ā ā ā āāā twitter.ts # Twitter API integration
ā ā āāā hooks/ # Custom hooks (if any)
ā ā āāā context/ # Global state management
ā ā āāā assets/ # Images, icons, etc.
ā āāā node_modules/ # Dependencies
ā āāā .gitignore # Files to ignore in Git
ā āāā .env.local # Environment variables
Clone the repository:
git clone https://github.com/yashumak/Tweet-Sentiment-Analysis.git
Install dependencies:
npm install
# or
yarn install
Create a .env.local file in the root directory and add your environment variables:
NEXT_PUBLIC_TWITTER_BEARER_TOKEN=your_twitter_api_key
NEXT_PUBLIC_HUGGINGFACE_API_KEY=your_huggingface_api_key
Run the development server:
npm run dev
# or
yarn dev
Open the server:
http://localhost:3000
This is fully responsive with breakpoints for:
Yash Umak