An AI wingman to sync souls across the globe.
- Install VS Code
- Install Docker
- Install VS Code Dev Containers Extension
- Clone this repository
- Copy
.env.example
to.env
and fill in the necessary environment variables.- Update
OPENAI_API_KEY
with your open ai api key. Make sure you add your payment details and purchase some credits to use the API. $5 should be more than enough.
- Update
- Run
uvicorn src.app:app --host 0.0.0.0 --port 8000 --reload
To manage database migrations in a FastAPI application with SQLAlchemy models, you can use Alembic, a lightweight database migration tool designed for use with SQLAlchemy. The process typically involves initializing Alembic in your project, creating migration scripts, and then applying these migrations to your database. Below is a step-by-step guide on how to do this:
Whenever you modify your models (like adding a_new_description
column to Item
), generate a new migration script:
alembic revision --autogenerate -m "Add a_new_description to items"
Alembic will compare your database schema (as defined by your SQLAlchemy models) against the actual database schema and generate a migration script in the alembic/versions
directory.
Check the generated script in the alembic/versions
directory to make sure it accurately represents the changes you want to make. Alembic attempts to auto-generate the correct migration commands, but it's a good practice to review and manually adjust them if necessary.
To apply the migrations to your database, run:
alembic upgrade head
This command applies all pending migrations to the database.
- If for some reason VS code is acting up, you can always reload the window by pressing
Cmd + Shift + P
and typingReload Window
orDev Containers: Rebuild Container
.
API documentation is available at http://127.0.0.1:8000/docs once you start the server.
To test the server:
curl -X 'POST' \
'http://127.0.0.1:8000/users' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"username": "ray",
"email": "ruizehung@gatech.edu",
"password": "password"
}'
curl -X POST -F 'username=ray' -F 'password=password' http://localhost:8000/token
curl -X GET -H 'Authorization: Bearer your_access_token_here' http://localhost:8000/soul_sync/ai_wingman_initiate_conversation
curl -X 'POST' \
'http://localhost:8000/soul_sync/ai_wingman_conversation' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer your_access_token_here' \
-d '{
"conversation_id": "...",
"content": "I had a nice dinner!"
}'
curl -X 'GET' \
'http://localhost:8000/conversations/' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer your_access_token_here'
curl -X 'GET' \
'http://localhost:8000/conversations/{conversation_id}/messages/?offset=0&limit=10' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer your_access_token_here'
curl -X POST "http://localhost:8000/ai_wingman_matches" \
-H "Accept: application/json" \
-H "Authorization: Bearer your_access_token_here"
<user_id>
s will be returned in the list of candidate profiles via the "/ai_wingman_matches"
api
curl -X GET "http://localhost:8000/user-profiles/<user_id>"
curl -X POST 'http://localhost:8000/matchmaking_user_rating' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer your_access_token_here' \
-d '{
"candidate_user_id": "candidate user id here",
"score": 5
}'
See https://fly.io/docs/hands-on/install-flyctl/
fly auth login
fly deploy
docker build --platform=linux/amd64 -f Dockerfile_Admin -t docker.io/ruizehung/soulsync-admin:v1.0 .
docker push docker.io/ruizehung/soulsync-admin:v1.0
cd admin_dashboard
fly deploy