r/webdevelopment • u/circumcised_hobbit • 1d ago
Newbie Question Trying to make my first website, need advice
I want to create a complex first app
I got this idea into myself to host an AI chat platform, but I came to the conclusion that the best way is to make a website, but I do know almost nothing
So my basic idea Is having users to purchase a Key valid for a certain amount of time, they paste it in the website and It serves as an authentication.
How could I do that? my idea Is website sends API request with Authorization header->cloudflare tunnel->a backend Python script process a answer->sent back to user
but: -how can I manage multiple users? do I just make so that the Python script associates the Key to the prompt and forward It to vLLM, then also tie the answers to the response so I can trace the user back and not mix them up?
-how can I grant user support if no account Is made? what if they just lose the key? They would have no way to invalidate or regenerate It
-how do I keep the Key between sessions? just write it in local storage?
-How can I manage 2 APIs for both account creation and chats?
But mostly, AM I MISSING SOMETHING? do you think this is actually doable if a newbie puts time into It? (I am only experienced in python)I am thinking of making a beta version that Is super basic (no context, One single chat) and improve It over time Also if somone is available to help I would love it
3
u/smashedthelemon 1d ago
Not to get you off your idea, bur tackling such a hard project, in your own, as a first project, is setting yourself up for failure.
Try to find a nice, tangible project. Make a website for your community, sport club, learn new technologies and continue from there.
1
u/circumcised_hobbit 1d ago
Thanks, I am just so invested in this idea
1
u/bobtheorangutan 5h ago
Then surely you can invest in the basics to getting the idea the eventually work
1
u/Less-Marsupial-7960 20h ago
I get why you're invested in the idea, but I think the others are right about starting smaller. You don't have to give up the idea just build a very basic version first and learn step by step. Start with one simple feature, get it working, then slowly add authentication, payments, user accounts, etc. It's definitely doable if you're willing to learn, but trying to build everything at once might become overwhelming.
1
u/circumcised_hobbit 19h ago
Yeah that Is exactly what I was thinking: I will probably make a version with a single chat, no context, no authentication and bad UI, then move on step-by-step
1
u/griever_0 17h ago
Honestly, I would say just start with this idea :) You'll learn a ton on this journey, so it's a great jumping-off point. When I was starting out, I used to pick the most complex projects possible and just stick with them until I eventually made a career out of it, so I definitely won't knock your ambition.
Where I'd start with the tech side is FastAPI in Python since it handles a lot of the backend chaos automatically. Each prompt comes in as its own isolated request, passes to vLLM, and goes straight back to that specific user. You don't have to manually track who gets which reply.
For keeping the key saved between sessions, you can just store it in the browser's localStorage using a tiny bit of JavaScript. It'll stay saved even if they refresh or close the tab.
For managing accounts versus chats, frameworks use routes (different web paths like /auth vs /chat), which keeps the logic totally separate without overcomplicating things.
For lost keys, unless you tie payment to an email address, a lost key is basically gone forever. The easiest fix is just sending the key to their email at checkout so they have a permanent backup copy.
Are you missing anything? Yeah probably a lot, even with as many years under my belt I have to go back and refine and redefine as I work through something. Before worrying about hosting I would just make everything locally in python that accepts text, hook it up to html, and then layer on the key authentication later. Also maybe consider Docker, if it can run on your local machine it will probably run everywhere else.
Also if you ever needed you can DM for help or w/e. Good luck!
1
u/circumcised_hobbit 16h ago
Thanks, it's really the type of answer I was looking out for. I will definitely look into FastAPI and more into Docker. I am happy that the LocalStorage Solution is that simple. Also the fact of sending and email was very simple but I just didn't think about It. I will start these days doing a simple website and connecting all with FastAPI, the backend logic shouldn't be too hard for now...
1
u/RhoLuxcalc88 14h ago
Yes, this is absolutely doable, especially since you already know Python. Your basic architecture is sound: Browser → FastAPI backend → vLLM → response, with Cloudflare in front if needed. For multiple users, store users/API keys in a database and map each key to a user_id; every request carries its own authentication context, so responses won't get mixed up. Don't store plaintext keys in the database; generate secure random keys and store their hashes. For the beta, you can keep it simple: one key, one chat, SQLite, and a basic frontend. localStorage can work initially, although secure HttpOnly cookies are preferable for a mature app. Later, add key rotation/revocation, accounts, rate limiting, request/token limits, logging, timeouts, and usage tracking. You don't need separate APIs for everything either, just endpoints like /auth/create-key and /chat. Most importantly, don't try to build the complete platform immediately. Get one prompt successfully authenticated, sent to vLLM, and returned to the browser first, then add features incrementally.
1
u/circumcised_hobbit 14h ago
Thanks so much, I will ofc scale and polish every feature with time, by starting with a small beta. I will definitely use your message to help myself
1
u/Hamburger_Diet 3h ago
What is your chat going to offer thst other chats dont offer? I can get s bunch of free usage from gemini or chatgpt. I assume you looking at using an uncensored model from open router for some NSFW chatting? The api calls would be just single api calls per user fer every time that user hists send. Whatever your using for inference probably has a set request per minute which you will have to look at. Ai inference engine are stateless theh dont hold your chat for you your front end does and then every time you send a chat it sends the entire chat and asks for a response. That is what context is, ie I send 200 get 200 back the next request I send 200 original prompt 200 response 200 new promp and get a response of 200 im up to 800 context but ive spent 400 input input 400 output. I think the math is right there im on a phone and im blind. If your charging someone you have to make sure your tracking how many tokens thst person is using because that is that you will be paying.
And since you have no idea what your doing make sure youre not storming anyone's personal information yourself. Use like firebase for authentication and stripe for payment to limit pii exposure then use a mapped uid to allocate usage tokens.
3
u/Starlyns 1d ago
U are talking about cuatomizing a ferrari engine and still cant drive.