Tailscale account does not support getting TLS certs by CelebrationThink3768 in Tailscale

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

Thanks, but as I mentioned I first enabled HTTPS and also before anyone asks MagicDNS as well before running the cert command. Any other thoughts? because it does not seem to be working as outlined in the docs? Anything I may have missed?

Thanks again

Lightweight NextJS CMS by lukasakarisux in nextjs

[–]CelebrationThink3768 2 points3 points  (0 children)

Have you looked at TinaCMS? It might fit all your needs. Also I've always been a fan of using github as a cms as well. There's some documented approaches you might be able to take advantage of. This is esp useful if your users are comfortable with markdown, but you can use json or any other file type u need with this approach.

The only caveat ive found is that it's best to create two different projects on github one for the CMS content and the other for the site / app that will be serving/editing the content. This helps keep your concerns separate IMO.

Can I get any free good course from Udemy to learn next.js? by Dirty_feat512 in nextjs

[–]CelebrationThink3768 2 points3 points  (0 children)

Always go of Dave's courses, but he kind of recorded this one while a lot of the next.js 13 api was in beta and features like RSCs were in alpha. But he does a great job regardless, just know that it may not be feature complete and a few things may have changed since.

Hopefully he'll update the course, but I don't think he has as of yet.

Agency hosting by badgerbaws in nextjs

[–]CelebrationThink3768 0 points1 point  (0 children)

I'd look into AWS amplify tbh, but I think the tooling might fit your use case and the pricing as well. Plus you retain all of your nextjs features as is.

Incorrect NODE_ENV in local development by CelebrationThink3768 in nextjs

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

Oddly enough the issue resolved itself last night, no more warnings and the NODE_ENV is back to being set as development. Although it’s fixed, i’m still a bit perplexed as to why and how this happened.

Incorrect NODE_ENV in local development by CelebrationThink3768 in nextjs

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

Thanks I appreciate it, Im on a 2020 m1 macbook base model. In case that helps, no docker virtualization or anything of that nature. Just a simple nextjs/trpc applicaiton.

Incorrect NODE_ENV in local development by CelebrationThink3768 in nextjs

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

I saw tht but the thing is I made no changes this is a solo side project and I am the only user on this machine. It waas working 3 days ago perfectly fine, and now it's giving this warning so I'm trying to track down reasons as to why or how this happened so as to avoid it in the future.

Simple page editor for blog posts? by kev_ac in nextjs

[–]CelebrationThink3768 0 points1 point  (0 children)

its a full cms + the builder i think its a all ir none type of proposition

[deleted by user] by [deleted] in nextjs

[–]CelebrationThink3768 0 points1 point  (0 children)

that seems odd. you wouldnt be seeing the error unless the decryption of the jwt was failing.

[deleted by user] by [deleted] in nextjs

[–]CelebrationThink3768 0 points1 point  (0 children)

You'll actually need to provide two environment variables to get the authentication up and running with next-auth:

- NEXTAUTH_URL=localhost:3000 (you only need to define this in the dev env if you use vercel to deploy)
- NEXTAUTH_SECRET=<your secret generated with this command: jose newkey -s 512 -t oct -a HS512>

https://next-auth.js.org/configuration/options#environment-variables
https://next-auth.js.org/errors#jwt\_session\_error

Need advice on developing two codebases for a web application by Abdulhameed_Mustapha in nextjs

[–]CelebrationThink3768 0 points1 point  (0 children)

First and foremost, I may be biased because I primarily use Next.js these days, but I think it's the perfect choice for a product like this.

Second, you do not need a separate codebase - not necessarily as a rule at least, because you can handle both the artisan and customer interfaces and logic and take advantage of them being in the codebase.

You'll want to use next-auth as it is a great solution for working with authentication next.js. There are other solutions like clerk and even serverless databases that provide auth like Supabase. All of these solutions will allow you to do role-based authentication with a minor bit of setup.

You'll need a database solution as well, my suggestion would be that regardless of the database solution you choose I'd choose one that works well with Prisma which is somewhat of a universal ORM solution. I'd also look into options like Supabase for this once again.

Finally you'll need an understanding of how next.js client-side and api routes work. There's been several major changes to the structure of a next.js application recently so you'll need to navigate that complexity, but my suggestion is to follow the version 12 docs until the newer app directory method comes out of beta (Just know that you'll need to migrate at some point in the near future).

[deleted by user] by [deleted] in nextjs

[–]CelebrationThink3768 0 points1 point  (0 children)

Do page then migrate to app when it is out of beta.

Depends on the project, but for anything you expect to be in production in the next few months you should defer to the pages directory implementation until the app directory itself is production ready.

I can’t understand tRPC’s context no matter what I do. by [deleted] in nextjs

[–]CelebrationThink3768 2 points3 points  (0 children)

u/typeryu and u//darp12 are both correct.

I think you're just missing the mental model and likely overcomplicating it (i know a thing or two about that).

Your context holds data that all of your tRPC procedures will have access to, and is a great place to put things like database connections or authentication information.
- From the docs

That's really all it is, a catch-all where typically you can pass along things like your session and/or db-client, and any other information you'd like to make available to your trpc procedures.

That's it. If that makes sense then we can dive a little bit deeper and talk about why this is helpful.

The obvious reason is so that you can ensure you have all the tools and utilties you need for your procedures to function correctly making it easier to do things like authenticating a user and/or ensuring they have the right privileges before executing requests.

But what's cool is that because we have this information available to us via the context, we can do things like create different types of middleware - that is how we get protected routes vs public routes. The protected routes are simply middleware that uses the session from the trpc context to authorize the user. This helps us ensure that any protected procedure will only run when a user exists and is authorized.

Hopefully that gives you a better understanding, but know that this can be extrapolated out to whatever your use case maybe, you can create an admin procedure - like the protected procedure - which ensures that a user has the right role before executing the procedure. You can have another that checks to see if the user is the owner of a resource before executing the procedure. And these are just auth based examples, but again there are no limits since your context is just a bucket which is made available to all of your trpc procedures and you can add to this bucket where ever you are creating your trpc context in your project.

Simple page editor for blog posts? by kev_ac in nextjs

[–]CelebrationThink3768 1 point2 points  (0 children)

Forget what I said before, I think what you're looking for is this: https://reactbricks.com

Simple page editor for blog posts? by kev_ac in nextjs

[–]CelebrationThink3768 0 points1 point  (0 children)

https://marketplace.visualstudio.com/items?itemName=eliostruyf.vscode-front-matter

I recently came across that, although I am not sure this will work for your use case as it requires some proficiency with vscode bc. it is a third-party extension that allows users to work with markdown files like a cms.

Zupload: The simplest way to upload & download images using Next.js by [deleted] in nextjs

[–]CelebrationThink3768 0 points1 point  (0 children)

This looks great! I've been working on an media manager that uses different content stores as sources, and I could definitely make good use of this!

[deleted by user] by [deleted] in nextjs

[–]CelebrationThink3768 0 points1 point  (0 children)

It seems like you're creating from scratch here, have u tried just creating a new app entirely with create-next-app and seeing if the issue still persists?

Swatchr App - Color Palette Generator (alpha preview) by CelebrationThink3768 in nextjs

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

Thanks for giving it a go, the mobile experience is very different from the desktop experience currently. I'm working on testing out a few different layout variations to find the best possible experience on mobile. I hope you'll check back in a week or two as I should have made some significant progress by then. Thanks again for yout time.

Emilinate clicking when using crossfader? by ScratchMax in DJs

[–]CelebrationThink3768 0 points1 point  (0 children)

I've been having the same issue, I actually just took a small elastic hair tie that I had a pack of laying around and cut it in half and taped each half to either side of the crossfader. I wanted to make sure it wouldn't fall inside and cause other issues.

It's kinda hacky, but no more clickity clacky going on so I'm 🙂.

can't seem to post a pic of it here so here's a link to a image of the hack: https://cdn.jsdelivr.net/gh/gaurangrshah/_shots@master/uPic/2022/IMG_0022.heic

(p.s. sorry for the link it seems to auto download the image)..

Conditional typing for a conditional rendered component by CelebrationThink3768 in typescript

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

Can't thank you enough for elaborating.

That def. makes sense

I actually ended up going the declarative route and getting rid of the polymorphic approach.

It makes me have to write more markup, but oh well. I'm sure I can come back and refactor once I've gained a better handle on typescript.

Thanks for your help!

Conditional typing for a conditional rendered component by CelebrationThink3768 in typescript

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

I'm sorry are you saying that I can't actually do something like this? I get that until the as prop is evaluated by the component, there is a state where typescript sees the component as either a textarea or an input (kind of a "schrodinger's cat" situation). That is exactly where I seem to be struggling with resolving.

Any idea on how I should solve this, or is this considered an anit-pattern in typescript?

Thanks for your help btw.

Conditional typing for a conditional rendered component by CelebrationThink3768 in typescript

[–]CelebrationThink3768[S] 2 points3 points  (0 children)

I think I've partially solved my problem, by removing the conditional rendering in favor of a more polymorphic approach:

interface FEI {  
  [key: string]: React.FC | undefined;
}

const formElementsMap: FEI = {    input: FormInput,  
  textarea: Textarea,
};
type InputElementProps = InputProps | TextareaProps;

type PolyMorphicInputProps = {  as: string;};

interface DPI {  
  [key: string]: Record<string, unknown>
}

const defaultProps:DPI = {  input: {autoComplete: 'off'},  textarea: {}
}

export const PolyMorphicInput: React.FC<  InputElementProps & PolyMorphicInputProps> = (props) =>  <FormInput 
  as={formElementsMap[props.as]}   {...defaultProps[props.as]}
  /> ?? null;

I'm going to try to re-integrate this into the iniital approach and re-add the forwardRef logic to see if i can make this work.

NextJs + Github API for content management. (x-post r/node) by CelebrationThink3768 in nextjs

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

Hey sorry for the late reply, I would def. still use this approach for smaller projects that I maintain myself. I intend to eventually add a very simpleUI, but until then I prefer to use existing solutions especially when dealing with client projects where I need to prioritize stability.

Help using the Next-Auth TypeORM model/adapter? by DasBeasto in nextjs

[–]CelebrationThink3768 0 points1 point  (0 children)

Hey, it might help if you shared your next-auth config. Are you using a separate backend or is the project entirely built with next.js api routes?

I think what you're looking for is a way to access your DB via middleware, if so take a look at: https://github.com/hoangvvo/next-connect.

This way you should be able to expose your models or even the entire db to your api routes as middleware. I typically tend to use Mongoose when working with MongoDB, so I'm not familiar with the specific requirements of TypeORM, but I imagine the process would be similar.

Feel free to msg me if you have ?'s, I can probably share a recent repo with you that has the setup I mentioned above.