git clone https://github.com/cstlford/flask_backend.gitcd path/to/flask_backendIt’s recommended to use a virtual environment to manage your project’s dependencies.
python3 -m venv venvmacos/linux
source venv/bin/activatewindows
venv\scripts\activatepip install -r requirements.txtEnsure that MySQL Server is installed and running on your system.
Log into your MySQL server and create the database:
mysql -pnote: by default, yor mysql server may need a username and password.
mysql -u your_username -pCREATE DATABASE shapeshift;Copy the example configuration file to config.py:
cp example_config.py config.pyEdit the config.py file to include your database connection details and replace username and password with your MySQL credentials. The secret key can be modified if desired.
Set the FLASK_APP environment variable to point to your application’s entry point.
macos:
export FLASK_APP=run.pywindows:
set FLASK_APP=run.pyInitialize the Flask-Migrate migration repository:
flask db initGenerate the initial migration script:
flask db migrate -m "Initial migration."flask db upgradeexport OPENAI_API_KEY=""export GEMINI_API_KEY=""python run.py• Ensure the server is running on http://127.0.0.1:5000.
In your browser, navigate to:
http://127.0.0.1:5000you should see:
Connection successful