Build your own TicTacToe game using TicTacToeGPT Template. Free template for developers to customize and build upon.
TicTacToeGPT brings the classic game to life with a smart AI opponent and customizable gameplay. Challenge yourself with different board sizes and AI difficulties to improve your strategic thinking.
Built with Next.js and OpenAI, this open-source template lets developers create their own version of an AI-powered Tic Tac Toe game. Features include user accounts, multiple board sizes (3x3 to 5x5), and three AI difficulty levels to match your skill.
https://tic-tac-toe-gpt.vercel.app/
1. Clone the repository:
1 2
git clone https://github.com/0xmetaschool/tic-tac-toe-gpt.git cd tic-tac-toe-gpt
2. Install dependencies:
1
npm install
3. Set up the database: Ensure you have MongoDB installed and running on your system, or use a cloud-hosted MongoDB service like MongoDB Atlas. Create a new Cluster, select a free plan, and copy the connection string, this will be required in the next step.
4. Set up environment variables: Create a .env.local file in the root directory and add:
1 2 3 4
MONGODB_URI= JWT_SECRET= OPENAI_API_KEY= NEXT_PUBLIC_API_URL=http://localhost:3000/api
5. Run the development server:
1
npm run dev
6. Open your browser and navigate to http://localhost:3000
Contributions are welcome! Here's how you can help:
This project is licensed under the MIT License - see the LICENSE file for details.
Please open an issue in the GitHub repository for any queries or support.
Select a file to view its content
Last updated 3 days ago