Skip to content

cstlford/flask_backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

72 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

flask_backend

Clone Repository

git clone https://github.com/cstlford/flask_backend.git

Navigate to project directory

cd path/to/flask_backend

Create a virtual env & activate

It’s recommended to use a virtual environment to manage your project’s dependencies.

python3 -m venv venv

macos/linux

source venv/bin/activate

windows

venv\scripts\activate

pip install requirements.txt

pip install -r requirements.txt

create a mysql server & start it

Ensure that MySQL Server is installed and running on your system.

create database named shapeshift

Log into your MySQL server and create the database:

mysql -p

note: by default, yor mysql server may need a username and password.

mysql -u your_username -p
CREATE DATABASE shapeshift;

create config.py based on example_config.py

Copy the example configuration file to config.py:

cp example_config.py config.py

input server information in config.py

Edit 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.

run export FLASK_APP=run.py in console

Set the FLASK_APP environment variable to point to your application’s entry point.

macos:

export FLASK_APP=run.py

windows:

set FLASK_APP=run.py

Initialize the Database

Initialize the Flask-Migrate migration repository:

flask db init

Generate and Apply Migrations

Generate the initial migration script:

flask db migrate -m "Initial migration."

run flask db upgrade

flask db upgrade

Export OPENAI and Gemini api keys in terminal

export OPENAI_API_KEY=""
export GEMINI_API_KEY=""

run flask application

python run.py

• Ensure the server is running on http://127.0.0.1:5000.

Test the Backend Endpoint

In your browser, navigate to:

http://127.0.0.1:5000

you should see:

Connection successful

run frontend & should be good to go

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors