I am building an application in Angular 17
So, the app has a screen and home with onboarding, where users can log in and sign up, etc.
What I want to achieve is that when the user logs in, he goes to the subdomain of the app "app.site.com",
I don't understand how this works exactly. Do I have to create a separate project for such a thing, and how do I save my access and refresh tokens that the user gets when he does the login
Can someone explain to me the logic behind it and how to manage it
#How to make app route to subdomain
13 messages · Page 1 of 1 (latest)
Leaving out the question of why you'd want this...
Yes, this sounds like you should have a separate Angular app for that (you can have multiple apps in one workspace). To store the tokens, store them in a cookie and make sure to set the domain attribute, so that it is available across all subdomains.
Hmm, honestly, a great question. "Leaving out the question of why you'd want this..." . I am also not sure about whether I am making the correct choice or not
Well, the app is for doctor management and dashboard, and there is also a part for patients. I wanted to leave the normal app for landing page purposes, onboarding, and for patients to also get an appointment in it even without logging in.
and leaving the main "app" dashboard and management functionalities in a subdomain so users can differentiate between them. I've seen this used in clickUp; I don't know if it's the correct choice or not
and how do I save my access and refresh tokens that the user gets when he does the login
There are SDKs / Libraries that take care of this for you.
But yes, I think it is not uncommon for this approach. Even more so, the landing page can be, and probably offen is, a different technology than the app itself.
That would be a valid choice to make, if you needed a separate app for the dashboard for SEO purposes, etc. Although Angular fulfills this now, too, with SSG/SSR
I just think, often, these are build by two different teams / department.
Marketing vs Engineering.
But ofcourse, depends on the company (size).
We're a very small team of a startup and still trying to figure out the best approaches so we try and avoid as many problemes as possible and also. I want to understand the concept well and see what the correct choices are
really appreciate your responses. If you have any advice, let me know. I am still trying to figure out how I should architect the project
I would go with a multi-workspace Angular project (limit technologies to just one, better for a small team, see above for more info).
Then create two Applications in this workspace one for the "landing page" and one for the actual app. For the "landing page" app I would enable SSG/SSR for optimal site performance and SEO. For the actual web app you might not want to bother, but could still be useful.
Then the "landing page" app can be deployed at example.com and the app at app.example.com. Only app.example.com would handle all the login machinery and example.com would just be a static landing page.
Thank you Very much I will probably follow this approach.
really appreciate it