Papa Johns
Papa Johns•3mo ago

Use of Node.js with Python client

But why should I use node when I am not even using it for the code. Like If I am using python I'll need to use node to setup the env. Don't you think it is a bit of a overkill as I have to perform so many steps to setup convex for python.
14 Replies
ballingt
ballingt•3mo ago
You don't need to use it, it's just the quickest way to communicate how Convex works in the quickstart. Just pip install the library and copy in your deployment URL.
lee
lee•3mo ago
i thought node.js was required for npx convex dev command to work 😕
ballingt
ballingt•3mo ago
Ah sorry, yeah it is for deploying functions (which are written in JavaScript), but not for using them You will need to install Node.js in order to deploy Convex functions, but you don't need to do that on every computer where you access the deployment from Python.
Papa Johns
Papa JohnsOP•3mo ago
Can't python call that api internally in it's package or the utility either way it is the api that is being called for the updation of the functions for the real time updation on the client and server side. Correct me if I am wrong.
ballingt
ballingt•3mo ago
@Papa Johns I don't quite follow
Can't python call that api internally in it's package or the utility
Yeah, that's how the Python client works. You tell it the URL to hit (e.g. https://loyal-antelope-123.convex.cloud) and tell it what query to subscribe to or what mutation to run, and it does that.
either way it is the api that is being called for the updation of the functions for the real time updation on the client and server side.
the Python client can't update the functions, those are always written in JavaScript/TypeScript so you need to have Node.js installed to bundle that code via the Convex CLI. I'm not sure if I'm answering your questions here.
Papa Johns
Papa JohnsOP•3mo ago
Actually, my concern was why do I need nodejs when I working with python. Can't python do the same? @ballingt
ballingt
ballingt•3mo ago
@Papa Johns could you say more? I think we're talking past each other. What do you want Python to do?
Papa Johns
Papa JohnsOP•3mo ago
1. The same functionality that nodejs is performing 2. I was hoping if convex could be language oriented. Like if I was using python, convex should be entirely managed by python
ballingt
ballingt•3mo ago
What functionality is that?
Papa Johns
Papa JohnsOP•3mo ago
All the initialisation and dev commands should be managed by python npx convex dev Should be managed python itself instead of using nodejs for that and then using python for the development
ballingt
ballingt•3mo ago
All backend code is written in JavaScript/TypeScript, so you need some way to write that code
Papa Johns
Papa JohnsOP•3mo ago
Can't it have a language oriented backend ?
ballingt
ballingt•3mo ago
Whoever writes your Convex backend will have to write TypeScript or JavaScript code, and they'll need to bundle it (compile it) and submit it. That process requires Node.js, which seems reasonable. Ah you're asking for support on the backend for Python functions? That's not supported now but could be possible someday, that makes sense that would be nice! Then maybe we could even rewrite the CLI to be in Python (or more likely, Rust) so that you wouldn't have to install Node.js. But for now the CLI is written in JavaScript, so you need to have Node.js (or bun, or deno) downloaded to run it
Papa Johns
Papa JohnsOP•3mo ago
Yeah I think that would be better. where it is independently running @ballingt is there any upcoming feature or something where one can set default values directly while setting up the schema and also can create internal tables with some default values prefilled.

Did you find this page helpful?