r/csharp • • 4d ago

Beginner tips

Hello,

Short intro

I have basic knowledge on c++ c# and sql and im looking to build my own app for a small shop, just a quick gig i got to make some extra cash on the side while studying

Classic ones like you see at lidl ikea etc...

Aesthetic not that important to them just functionality

I was thinking of using c# and sql

And no deadline what are the best tips someon could give me

6 Upvotes

12 comments sorted by

3

u/chic_luke 4d ago

Web. Your customer is going to need a server to host the application and people will access it through a website.

The typical web application will have the following components, top to bottom:

  • Presentation layer (Frontend)
  • API and business logic layers (both covered by the Backend)
  • Persistence layer (Database/s)

The first thing I recommend is getting an idea about how HTTP works: did your university already cover it? Otherwise, you'll have to go learn that online. Once you're done with HTTP fundamentals and you know how a basic network connection works, you should learn what a REST API is and how it works. A REST API will be composed of a series of endpoints, each with its own HTTP method for its specific purpose (GET, POST, PUT, DELETE, QUERY etc.). You can think about these endpoints like "plugs" or "doors". They are the "interface" that makes your user interface, the graphical part the user can click, interact with the backend system, which is going to be the program that handles the bulk of the instructions.

The backend is going to be the central part of your application. It talks to the user interface from the bottom up, and it talks to the database from the top down. For the backend, since you like C#, you're going to use .NET 10 with ASP .NET Core 10. Microsoft Learn should have several tutorials and learning paths for that.

For the database, just use PostgreSQL. It's great, it's free, and it's one of the most .NET-friendly choices. About that, avoid MySql, MariaDb or Oracle SQL, as it is going to be pretty painful to use them with dotnet. Possible, but the experience won't be as smooth.

You will use a library called Entity Framework Core to interact with the SQL database from the backend. Microsoft Learn, once again, has tutorials and learning paths about it.

As for the UI: do you know any frontend web technologies, like React, Vue.js or Angular? The best way nowadays is to create a SPA in a major web framework like React (more popular) or Vue 3 (easier) and use that to interact with your API. Else, you could also look into .NET MVC with Razor. It's going to be much uglier, and it will be served directly from the backend, but it will work.


How much of what I said is new to you? How much do you know?

If everything is new, and you have already said yes, I hope you have ample deadlines. I am going to be fair: it will not be easy or immediate the first time you do it. If you already knew a lot of this, it should be doable.

One last thing: look at the .NET eShop project if you need a reference implantation. It's a bit complex, but it's useful.

Best or luck!

2

u/Money-Condition9267 4d ago

Oh not a web app, a software app that can and will be accesable with no internet, i have already built it, linked sql with c# now i need to fix some F key functions (reciept reseting to 0) and extra easy access and variable customisability if one item for ex bread can cost 1 usd 1 loaf a different loaf of bread can cost 1.5usd and i want it all to be under the same code just i can edit the price

1

u/chic_luke 4d ago

Okay, splendid! I didn't fully understand the problem you are trying to solve but as a general idea I'd look at data modelling first. Is your data modelled in a way that makes it natural to add this functionality, or does it need to change shape?

1

u/Money-Condition9267 4d ago

I need it to change as i input it in like 30 articles only tho the rest are fixed prices and i have them on a usb just need to fix a flexible variable and that should be it about that and most of the work should be arround F keys for reciept reset and so

2

u/BornAgainBlue 4d ago

We don't know what kind of app it is.  I don't know what your example was . Sorry to be incoherent. I'm typing this between barfing having the flu.

1

u/Money-Condition9267 4d ago

For example You scan one product with a reader, the code inputs itself in the app and says there for example Code. | Product | Quantity | Price | And somewhwre on the screen it says the total amount for the entire reciept Also with functions to enter new products, change prices, print out reciepts and so on

13

u/hattrick07 4d ago

Make no mistakes

4

u/completemomentum 4d ago

WinForms or WPF? Decide that first and stick to it. WPF has a steeper learning curve but it'll save you a headache later if the app grows. For a quick shop tool, just slap some DataGrids on there, bind them to your SQL tables, and call it a day.

Don't overthink the architecture. You're not building a spaceship, it's a point-of-sale system that tracks inventory and prints receipts. Keep it stupid simple, get paid, move on.

1

u/BornAgainBlue 4d ago

That actually took me a minute to get that joke.

2

u/buzzon 4d ago

I suggest WPF with DataGrid and bindings; but WinForms is more beginner friendly.

-2

u/zeGenicus 4d ago

Just ask an ai , fully understand the pros & cons.

It’s money lol you’re confused thinking ikea software will be easy

1

u/Money-Condition9267 4d ago

Lol fully dont expect it to be easy, just used it as a reference, but will do as much as possible to simplify it just some basic info (bar code, name, quantity, price) in a expandable grid

And whqt ai claude or?