Skip to content

ArthurWish/MindScratch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

MindScratch

MindScratch is a project that leverages AI to assist students in learning programming. The front end is developed with Vue.js, and the back end is built using Python's Flask framework, with OpenAI's GPT API integrated for conversational assistance.

Project Structure

MindScratch/
├── frontend/          # Vue.js front-end application
└── backend/           # Flask back-end API server

Requirements

  • Node.js (for the Vue front-end)
  • Python 3.7+ (for the Flask back-end)
  • An API key from OpenAI for GPT integration

Setup Instructions

1. Clone the Repository

git clone https://github.com/your-username/MindScratch.git
cd MindScratch

2. Frontend Setup (Vue.js)

  1. Navigate to the frontend directory:

    cd frontend
  2. Install dependencies:

    npm install
  3. Run the development server:

    npm run serve
  4. The Vue.js application should now be running at http://localhost:8080.

3. Backend Setup (Flask)

  1. Navigate to the backend directory:

    cd ../backend
  2. Set up a virtual environment:

    python3 -m venv venv
    source venv/bin/activate  # On Windows, use `venv\Scripts\activate`
  3. Install dependencies:

    pip install -r requirements.txt
  4. Set up your OpenAI API key:

    • Create a .env file in the backend directory:
      touch .env
    • Add your API key to the .env file:
      OPENAI_API_KEY=your_openai_api_key_here
      
  5. Run the Flask server:

    flask run
  6. The Flask API should now be running at http://localhost:5500.

4. Integration

The Vue front-end communicates with the Flask back-end through RESTful API calls. Ensure both the front-end and back-end servers are running to allow interaction between the two.

Usage

  1. Access the front-end application at http://localhost:8080.
  2. Use the app interface to interact with the GPT-powered assistant.
  3. The assistant will respond based on the logic provided in the Flask back-end and GPT API responses.

Environment Variables

The following environment variables should be set in the .env file in the backend folder:

  • OPENAI_API_KEY - Your OpenAI GPT API key.

License

This project is licensed under the MIT License.

Acknowledgments

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published