making API with c# some help with the structure
smoothcubegit
HOBBYOP

a year ago

^

77 Replies

smoothcubegit
HOBBYOP

a year ago

N/A


a year ago

basically there's dotnet the web framework, people usually likes to use it's default version (which follows the MVC model, Model View Controller)


smoothcubegit
HOBBYOP

a year ago

I dont have anything to work off for the API however


a year ago

and then there's the dotnet minimal APIs (same framework, different strategy), which are very easy to understand and build something quick


smoothcubegit
HOBBYOP

a year ago

and where is this?



smoothcubegit
HOBBYOP

a year ago

so by the end i should have a github repo with the API launched from github on railway like a python api?
also is there example finished code of this minimal api?


a year ago

hopefully it'll be Railway ready but if something happens when deploying it just send a message on this help thread.


a year ago

there may be some examples on Github but not specially made for Railway


smoothcubegit
HOBBYOP

a year ago

okay… I'll try, if all else fails would you be down to help me?


smoothcubegit
HOBBYOP

a year ago

(mainly because i dont know what the github file structure is meant to look like)


a year ago

I can try but I would recommend following a tutorial, on Railway we can't teach an entire language just by help threads.


smoothcubegit
HOBBYOP

a year ago

true. however this is all i have right now, and i dont think its going to deploy with just this XD

1361460912174661600


smoothcubegit
HOBBYOP

a year ago

do i need like a requirements.txt type of thing?

just because railway acts different to the C# i know


a year ago

I may be able to get a simple template for you, give me a minute


smoothcubegit
HOBBYOP

a year ago

okay, Thank you, lots!


smoothcubegit
HOBBYOP

a year ago

im used to flask, this is new lol, however i know C# is lightweight, especially for a server


a year ago

I would recommend to stick to the language you know, C# can get pretty big and if you're looking for lightweight solutions, Go is the option


smoothcubegit
HOBBYOP

a year ago

its good to learn something new + i really need C# for what im creating


a year ago

great, that's a valid point


smoothcubegit
HOBBYOP

a year ago

I'm going to head off, if you can get the template i would be blown away XD


a year ago

can I ask on why you need C#?


smoothcubegit
HOBBYOP

a year ago

creating a somewhat multiplayer service


smoothcubegit
HOBBYOP

a year ago

I dont mind paying for the costs, I want to have control over it all


a year ago

but that can be done in any language


smoothcubegit
HOBBYOP

a year ago

realtime game multiplayer service


a year ago

that still can be done in any language, including Python


smoothcubegit
HOBBYOP

a year ago

Python is heavyweight and slow, no?


smoothcubegit
HOBBYOP

a year ago

if not then forget this entire thing, however i thought it was…


a year ago

how many players are you expecting?


smoothcubegit
HOBBYOP

a year ago

around 100 for now


a year ago

Python can be pretty capable of running a beef game


smoothcubegit
HOBBYOP

a year ago

its a vr game, so it will need to be like photon ig


a year ago

pretty sure it can handle + you know Python so I would do it in Python


smoothcubegit
HOBBYOP

a year ago

You sure it will work?


smoothcubegit
HOBBYOP

a year ago

and wont be too slow?


smoothcubegit
HOBBYOP

a year ago

I got told C# was lightweight and speedy XD

If python works, it works


a year ago

depends on what you're doing


a year ago

I would create a POC and see how it goes


smoothcubegit
HOBBYOP

a year ago

Vr game which syncs players over the network and their actions


smoothcubegit
HOBBYOP

a year ago

POC?


a year ago

Proof of Concept


smoothcubegit
HOBBYOP

a year ago

ah… so python it is or C#?


smoothcubegit
HOBBYOP

a year ago

i wouldnt mind doing c#, i know a bit because of unity
and software developement


smoothcubegit
HOBBYOP

a year ago

We could always just do this?

again if you think python might work, i can use it


a year ago

I highly recommend doing a POC in the language you know and see how it goes


a year ago

but I've seen some real-time games made in Python


smoothcubegit
HOBBYOP

a year ago

do you mind providing a template as well? so i can rollback if it doesnt work?


a year ago

np


smoothcubegit
HOBBYOP

a year ago

thanx! A lot :D

(github railway deployable template)



kampouse
HOBBY

a year ago

check this out


smoothcubegit
HOBBYOP

a year ago

alr



kampouse
HOBBY

a year ago

this alread a discord bot


smoothcubegit
HOBBYOP

a year ago

ah! I see


kampouse
HOBBY

a year ago

so you can already get something close to what u want


smoothcubegit
HOBBYOP

a year ago

thats true


smoothcubegit
HOBBYOP

a year ago

alright, going to bed, cant wait for this template in the morning! Thanks a lot


smoothcubegit
HOBBYOP

a year ago

Okayie Tried python and its response times, they are fine, however the CPU usage is not, what is a lightweight language I can use on railway to minimise CPU usage?


a year ago

Go is the way


smoothcubegit
HOBBYOP

a year ago

got it working!


smoothcubegit
HOBBYOP

a year ago

1361709289257046000


a year ago

pog


a year ago

just watch out, Gin can use a lot of memory and in some benchmarks Gin lose to ElysiaJS (yes a js framework)


a year ago

but for your use case it should be fine


smoothcubegit
HOBBYOP

a year ago

Uh ohs, as long as I dont eat up my money with the cpu, (thats why i switched from python to go)


smoothcubegit
HOBBYOP

a year ago

So it wont hammer my cpu as much as python does?


a year ago

The only way to find out is by testing but Go is pretty lightweight overall


smoothcubegit
HOBBYOP

a year ago

Alright, as i said I did a stress test, and it came out at $10 for 50 clients on python xD (10 mins usage)


a year ago

if you're looking for something focused on being lightweight, there's Go-Chi
https://go-chi.io/#/


a year ago

but try Gin first, it's easier to understand


smoothcubegit
HOBBYOP

a year ago

Alright, so just to make sure, it wont destroy my cpu?


a year ago

time for a load test, that's all i can say


smoothcubegit
HOBBYOP

a year ago

Okie


a year ago

i forgot to mention but I did a C# template 😅



Loading...