https://github.com/subhadeeproy3902/next-clerk-mongo-template
https://github.com/subhadeeproy3902/next-clerk-mongo-template
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/subhadeeproy3902/next-clerk-mongo-template
- Owner: subhadeeproy3902
- Created: 2024-05-11T07:41:56.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-05-11T07:46:00.000Z (about 1 year ago)
- Last Synced: 2024-05-12T08:32:02.900Z (about 1 year ago)
- Language: TypeScript
- Size: 19.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Next Clerk Mongo Template
This is a template for a Next Js application with Clerk authentication and MongoDB and Typescript.
Along with it, it includes Shadcn usage as well
(no need to bunx shadcn init anymore LOL)## Features
- Clerk Auth
- MongoDB
- Middeware
- Error handling
- Typesafe## Installation
1. Clone the repository `git clone https://github.com/subhadeeproy3902/next-clerk-mongo-template.git` or download the zip file.
2. Open the project in your favorite code editor.
3. Navigate to the project directory `cd next-clerk-mongo-template`.
4. Create a `.env` file in the frontend directory and add the following environment variables:```
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=CLERK_SECRET_KEY=
MONGO_URI=
WEBHOOK_SECRET=
NEXT_PUBLIC_CLERK_SIGN_IN_URL=/sign-in
NEXT_PUBLIC_CLERK_SIGN_UP_URL=/sign-up
NEXT_PUBLIC_CLERK_AFTER_SIGN_IN_URL=/
NEXT_PUBLIC_CLERK_AFTER_SIGN_UP_URL=/
```
NOTE : Create then get the Webhook secret from Clerk Dashboad. For more information. Read [Clerk Webhook Docs](https://clerk.com/docs/integrations/webhooks/overview)
Also do select `user` in the filter box
4. Start the development server `npm run dev` or `yarn dev` or `pnpm dev` or `bun dev`.
5. Open [http://localhost:3000](http://localhost:3000) in your browser.## Working
1. The user can sign up with email and password or with Google or with any other auth providers as per your clerk setup. The Credentials are stored in Clerk and the user data is stored in MongoDB.
3. The user will be redirected to the respective dashboard page.
4. The user can sign out from the dashboard page and will be redirected to the home page (`/`).
## Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
## Where to Contact
- [Subhadeep Roy](https://www.linkedin.com/in/subhadeeproy3902/)
## Support
If you like the project, give a star ⭐ to the repository and share it with others. Also you can use this as a template too for your works as well