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

10 months ago

^

77 Replies

smoothcubegit
HOBBYOP

10 months ago

N/A


passos
MODERATOR

10 months 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

10 months ago

I dont have anything to work off for the API however


passos
MODERATOR

10 months 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

10 months ago

and where is this?



smoothcubegit
HOBBYOP

10 months 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?


passos
MODERATOR

10 months ago

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


passos
MODERATOR

10 months ago

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


smoothcubegit
HOBBYOP

10 months ago

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


smoothcubegit
HOBBYOP

10 months ago

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


passos
MODERATOR

10 months 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

10 months 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

10 months ago

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

just because railway acts different to the C# i know


passos
MODERATOR

10 months ago

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


smoothcubegit
HOBBYOP

10 months ago

okay, Thank you, lots!


smoothcubegit
HOBBYOP

10 months ago

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


passos
MODERATOR

10 months 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

10 months ago

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


passos
MODERATOR

10 months ago

great, that's a valid point


smoothcubegit
HOBBYOP

10 months ago

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


passos
MODERATOR

10 months ago

can I ask on why you need C#?


smoothcubegit
HOBBYOP

10 months ago

creating a somewhat multiplayer service


smoothcubegit
HOBBYOP

10 months ago

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


passos
MODERATOR

10 months ago

but that can be done in any language


smoothcubegit
HOBBYOP

10 months ago

realtime game multiplayer service


passos
MODERATOR

10 months ago

that still can be done in any language, including Python


smoothcubegit
HOBBYOP

10 months ago

Python is heavyweight and slow, no?


smoothcubegit
HOBBYOP

10 months ago

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


passos
MODERATOR

10 months ago

how many players are you expecting?


smoothcubegit
HOBBYOP

10 months ago

around 100 for now


passos
MODERATOR

10 months ago

Python can be pretty capable of running a beef game


smoothcubegit
HOBBYOP

10 months ago

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


passos
MODERATOR

10 months ago

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


smoothcubegit
HOBBYOP

10 months ago

You sure it will work?


smoothcubegit
HOBBYOP

10 months ago

and wont be too slow?


smoothcubegit
HOBBYOP

10 months ago

I got told C# was lightweight and speedy XD

If python works, it works


passos
MODERATOR

10 months ago

depends on what you're doing


passos
MODERATOR

10 months ago

I would create a POC and see how it goes


smoothcubegit
HOBBYOP

10 months ago

Vr game which syncs players over the network and their actions


smoothcubegit
HOBBYOP

10 months ago

POC?


passos
MODERATOR

10 months ago

Proof of Concept


smoothcubegit
HOBBYOP

10 months ago

ah… so python it is or C#?


smoothcubegit
HOBBYOP

10 months ago

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


smoothcubegit
HOBBYOP

10 months ago

We could always just do this?

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


passos
MODERATOR

10 months ago

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


passos
MODERATOR

10 months ago

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


smoothcubegit
HOBBYOP

10 months ago

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


passos
MODERATOR

10 months ago

np


smoothcubegit
HOBBYOP

10 months ago

thanx! A lot :D

(github railway deployable template)



kampouse
HOBBY

10 months ago

check this out


smoothcubegit
HOBBYOP

10 months ago

alr


kampouse
HOBBY

10 months ago


kampouse
HOBBY

10 months ago

this alread a discord bot


smoothcubegit
HOBBYOP

10 months ago

ah! I see


kampouse
HOBBY

10 months ago

so you can already get something close to what u want


smoothcubegit
HOBBYOP

10 months ago

thats true


smoothcubegit
HOBBYOP

10 months ago

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


smoothcubegit
HOBBYOP

10 months 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?


passos
MODERATOR

10 months ago

Go is the way


smoothcubegit
HOBBYOP

10 months ago

got it working!


smoothcubegit
HOBBYOP

10 months ago

1361709289257046000


passos
MODERATOR

10 months ago

pog


passos
MODERATOR

10 months ago

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


passos
MODERATOR

10 months ago

but for your use case it should be fine


smoothcubegit
HOBBYOP

10 months 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

10 months ago

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


passos
MODERATOR

10 months ago

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


smoothcubegit
HOBBYOP

10 months 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)


passos
MODERATOR

10 months ago

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


passos
MODERATOR

10 months ago

but try Gin first, it's easier to understand


smoothcubegit
HOBBYOP

10 months ago

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


passos
MODERATOR

10 months ago

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


smoothcubegit
HOBBYOP

10 months ago

Okie


passos
MODERATOR

10 months ago

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



Loading...