Skip to content

YitzhakMizrahi/ai-image-generator-microsoft

Repository files navigation

This project is a Next.js application created using create-next-app. Powered by DALL·E 2, Chat GPT & Microsoft Azure.

Prerequisites

  • Node.js installed on your local machine
  • An Azure account
  • An OpenAI account

Setup and Installation

Follow these steps to get the project up and running:

1. Install Dependencies

Navigate to the project's root directory and run one of the following commands to install the necessary dependencies:

npm i
# or
yarn
# or
pnpm i

Then, install the dependencies for Azure Functions:

cd .\azure\ && npm i
# or
cd .\azure\ && yarn
# or
cd .\azure\ && pnpm i

2. Set Up Environment Variables

Copy the .env.example file to a new file named .env.local and update the variables accordingly:

cp .env.example .env.local

Copy the local.settings.example.json file to a new file named local.settings.json inside the azure directory and update the variables:

cd ..\azure\ && cp local.settings.example.json local.settings.json

4. Start the Development Server

From the root directory, start the development server with one of the following commands:

npm run dev
# or
yarn dev
# or
pnpm dev

5. Start Azure Functions

Start Azure Functions using one of these commands:

cd .\azure\ && npm run start

Open http://localhost:3000 with your browser to see the result.

You can start editing the page by modifying app/page.tsx. The page auto-updates as you edit the file.

API routes can be accessed on http://localhost:3000/api/[routename]. Endpoints can be edited in pages/api/[routename]/route.ts.

The pages/api directory is mapped to /api/*. Files in this directory are treated as API routes instead of React pages.

This project uses next/font to automatically optimize and load Inter, a custom Google Font.

Learn More

To learn more about Next.js, take a look at the following resources:

You can check out the Next.js GitHub repository - your feedback and contributions are welcome!

Deploy on Vercel

The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.

Check out our Next.js deployment documentation for more details.