The NBA Betting Assistant is a Next.js application that provides users with AI-powered insights for NBA betting. It leverages the X.AI API to generate concise and relevant information to help users make informed bets on NBA games.
- Next.js 14 - React framework for server-side rendering and static site generation
- React 18 - JavaScript library for building user interfaces
- TypeScript - Typed superset of JavaScript
- Tailwind CSS - Utility-first CSS framework
- Shadcn UI - Re-usable components built with Radix UI and Tailwind CSS
- OpenAI SDK - Official OpenAI API library for Node.js
- X.AI API - AI model API for generating betting insights
- User-friendly interface for querying NBA betting information
- AI-powered responses using the X.AI API
- Responsive design for mobile and desktop devices
- Node.js 18.x or later
- npm or yarn package manager
-
Clone the repository:
git clone https://github.com/your-username/betting-assistant.git cd nba-betting-assistant
-
Install dependencies:
npm install
or
yarn install
-
Set up environment variables:
- Copy the
.env.example
file to.env.local
:cp .env.example .env.local
- Open
.env.local
and add your X.AI API key:Note: You can obtain an API key from the X.AI documentation.XAI_API_KEY=your_api_key_here
- Copy the
-
Run the development server:
npm run dev
or
yarn dev
-
Open http://localhost:3000 in your browser to see the application.
- Enter your NBA betting question in the input field.
- Click the "Get Betting Info" button.
- Wait for the AI-generated response to appear below the input field.
app/
: Next.js app directory containing pages and API routescomponents/
: React components, including the main NBABettingAssistant componentlib/
: Utility functions and shared codepublic/
: Static assetsstyles/
: Global CSS styles
The application uses a custom API route to communicate with the X.AI API:
This route handles POST requests, forwards the user's query to the X.AI API, and returns the AI-generated response.
The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.
Check out the Next.js deployment documentation for more details.
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.