r/FastAPI • • Jun 28 '24

Question FastAPI + React

Hey
I am using FastAPI and React for an app. I wanted to ask a few questions:

  1. Is this is a good stack?

  2. What is the best way to send sensitive data from frontend to backend and backend to frontend? I know we can use cookies but is there a better way? I get the access token from spotify and then i am trying to send that token to the frontend.

  3. How do I deploy an app like this? Using Docker?

Thanks!

25 Upvotes

33 comments sorted by

View all comments

1

u/pint Jun 28 '24
  1. yes. spa?

  2. explain

  3. first ask yourself the question where do you want to host it.

1

u/[deleted] Jun 28 '24

Thanks for replying

  1. Wdym by spa?

  2. Like getting the access token for oauth and then sending that token to the backend

  3. I have just used vercel to host an app with only react

1

u/Amocon Jun 28 '24

For the auth token you should use a auth header. Bearer token are an solution.