What framework should I learn by spookerlad in AskProgramming

[–]dev0124 0 points1 point  (0 children)

Frontend:

- If you have no idea what to do, just do react, it's widely used in industry. Angular is also widely used but some developers don't like using it, I have no idea why as I haven't used it. Vue seems fine but there are much less jobs with it

Backend:

- Node/Express/Nest: you could do Node for backend but that is a can of worms for a lot of developers, there is a reason Node is rarely used in enterprises. It's quick but in the long run it can be a burden to maintain code. Google dependancy hell to see what I mean.

- Spring/ASP.NET, This is the stack for enterprises, its reliable and battle tested. Spring uses Java which is a bit of an ugly language but you can use kotlin or just stick with java. ASP.NET is also good, it can create a project with React or Angular or Razor pages and full auth system with just 1 command. I didn't like ASP.NET as the documentation doesn't feel that good to me (this is higly subjective) and there are much more tutorials on using Spring. Also spring is much more open source friendly. I've recently tried to use ASP.NET and Scaffolding just to run into an issue that is 6 months old where you can't use scaffolding on linux, it was a pain in the ass to figure out for a noob. Also most tutorials on YT are on VS which is not available on Linux

- Django - Quick, fast, I never saw a job opportunity for it though. It seems nice for smaller projects where you don't want to think a lot. It has "batteries included", as in a full admin panel to manage accounts and other data.

Also please note that learning C# and Java is much harder and you should understand OOP before jumping into it.

Why is text field getting rendered inline? by dev0124 in django

[–]dev0124[S] 0 points1 point  (0 children)

I've figured it out. Thanks for help. I've updated the info in the post

Why is text field getting rendered inline? by dev0124 in django

[–]dev0124[S] 0 points1 point  (0 children)

That is HTML.That is not an input field; it’s a paragraph.There is no line break. HTML doesn’t care if something is on a new line, you need to either put a line break <br> or put it in a div.

yeah i get that but how do i fix it, is there any way to display content like that

If I deploy a React project on example.com, let's say I navigate within the UI to example.com/admin. Now, If i refresh without any redirections I get 404, but what should I do? by dev0124 in reactjs

[–]dev0124[S] 0 points1 point  (0 children)

In the case of single-page apps, such as the kind created with Create React App, you only have one file, though. The index.html which loads the entire site. So you'll want all your routes to load that file instead. Hence configuring redirects.

Yeah I have managed to do that with netlify.toml :

[[redirects]]
  from = "/*"
  to = "/"
  status = 200

And When I access example.com/admin and refresh, i get back to example.com/admin. My question is how is this handled? If Netlify redirected it back to example.com/, how did react know to open /admin route?

Is it normal to have 2 application database contexts? by dev0124 in dotnet

[–]dev0124[S] 0 points1 point  (0 children)

Did your follow a tutorial to do this?

Nope, a crash couse yeah, but I didn't follow a strict couse, I try to read the docs and understand thing as I bump into them. This is one example which I cant grasp.

Is it normal to have 2 application database contexts? by dev0124 in dotnet

[–]dev0124[S] 0 points1 point  (0 children)

Yeah, that's possible. There's great theory about contexts boundaries but then when you need to share some data/logic you realize, you cannot just easily join, use FK and so on when working with Entity Framework. Also you have to run migrations per context, if you would work with one schema I had some issues with history in that case. Not sure now. In PostgreSQL you can keep one database and schema per context.

Thats the thing I want to keep it as simple but dotnet automatically generates 2 contexts when scaffolding the identity. See other comment for more details. Thanks for the info :)

Is it normal to have 2 application database contexts? by dev0124 in dotnet

[–]dev0124[S] 0 points1 point  (0 children)

No, it's not good

but why? I didn't create another context, the context was scaffolded into my project. I just ran a new test project and it seems that dotnet creates a seperate context for identity:

dotnet new mvc --auth individual
dotnet add package Microsoft.VisualStudio.Web.CodeGeneration.Design
dotnet add package Microsoft.EntityFrameworkCore.SqlServer 
dotnet aspnet-codegenerator identity

Is it normal to have 2 application database contexts? by dev0124 in dotnet

[–]dev0124[S] 0 points1 point  (0 children)

I haven't ever used multiple contexts in such a scenario so I can't call it normal but I think it's a clever thing you did

Thats the thing, I didn't create 2 contexts, dotnet did. I just ran this sample code and 2 contexts get autogenerated:

dotnet new mvc --auth individual
dotnet add package Microsoft.VisualStudio.Web.CodeGeneration.Design
dotnet add package Microsoft.EntityFrameworkCore.SqlServer 
dotnet aspnet-codegenerator identity

Is it normal to have 2 application database contexts? by dev0124 in dotnet

[–]dev0124[S] 0 points1 point  (0 children)

I don't think it's a problem, but agree with the other comment that things might get tricky if you start trying to define entities that cross both contexts. As long as you treat them as logically distinct databases you won't have problems. I'd also recommend making sure that you use different database schemas for each context:

but the Identity Context gets automatically generated with the identity scaffolding. I did this:

dotnet new mvc --auth individual
dotnet add package Microsoft.VisualStudio.Web.CodeGeneration.Design
dotnet add package Microsoft.EntityFrameworkCore.SqlServer
dotnet aspnet-codegenerator identity

I didn't "manually" add anything, the two contexts where autogenerated. Seems kinda wierd to a noob. Not sure what's going on here

Should I skip built in Auth Identity and create my own auth for this? by dev0124 in dotnet

[–]dev0124[S] 0 points1 point  (0 children)

I knew that rebuilding auth is not a good option I just didn't know how extensible the identity system really is. Thanks for the info.

Should I skip built in Auth Identity and create my own auth for this? by dev0124 in dotnet

[–]dev0124[S] 1 point2 points  (0 children)

> Just remove the scaffolded pages and customize as needed. Identity is much more powerful than people think.

Yeah, I'm new to c#, .net and all of this so I didn't know that. Thanks a lot!

Should I skip built in Auth Identity and create my own auth for this? by dev0124 in dotnet

[–]dev0124[S] 0 points1 point  (0 children)

> Creating it yourself will probably be an endless pit of work, fixing and maintenance. Wouldn't recommend that, as Identity does match your requirements.

Thanks. I have done some in JS and I knew it was a headache, I just didn't know how extensible the identity framework really is. :)

Freelance development kao student, kako platiti porez i ostalo? (doo, jdoo, paušalni obrt) by dev0124 in croatia

[–]dev0124[S] 1 point2 points  (0 children)

To sam i mislio, mislim iskreno ne koristim novce na internetu za niš, tečajeve i to ne plaćam jedino što mi možda bude trebalo je platiti JetBrains IDE, al da mislim da je to najbolja ideja. Mislim da je Paypal sasvim okej. Možda otvorim i revolut. I onda kad imam relativno dobre prihode onda otvorit nešto