Develop
This commit is contained in:
parent
c8cf876c70
commit
d49f09e622
11 changed files with 150 additions and 79 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"projectName": "next-enterprise",
|
"projectName": "yarlis-enterprise",
|
||||||
"projectOwner": "Blazity",
|
"projectOwner": "Yarlis",
|
||||||
"repoType": "github",
|
"repoType": "github",
|
||||||
"repoHost": "https://github.com",
|
"repoHost": "https://github.com",
|
||||||
"files": [
|
"files": [
|
||||||
|
|
@ -11,31 +11,13 @@
|
||||||
"commitConvention": "angular",
|
"commitConvention": "angular",
|
||||||
"contributors": [
|
"contributors": [
|
||||||
{
|
{
|
||||||
"login": "bmstefanski",
|
"login": "siri1410",
|
||||||
"name": "Bart Stefanski",
|
"name": "Sireesh Yarlagadda",
|
||||||
"avatar_url": "https://avatars.githubusercontent.com/u/28964599?v=4",
|
"avatar_url": "",
|
||||||
"profile": "https://bstefanski.com/",
|
"profile": "https://github.com/siri1410",
|
||||||
"contributions": [
|
|
||||||
"code"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"login": "jjablonski-it",
|
|
||||||
"name": "Jakub Jabłoński",
|
|
||||||
"avatar_url": "https://avatars.githubusercontent.com/u/51968772?v=4",
|
|
||||||
"profile": "https://github.com/jjablonski-it",
|
|
||||||
"contributions": [
|
"contributions": [
|
||||||
"infra"
|
"infra"
|
||||||
]
|
]
|
||||||
},
|
|
||||||
{
|
|
||||||
"login": "neg4n",
|
|
||||||
"name": "Igor Klepacki",
|
|
||||||
"avatar_url": "https://avatars.githubusercontent.com/u/57688858?v=4",
|
|
||||||
"profile": "https://neg4n.dev/",
|
|
||||||
"contributions": [
|
|
||||||
"doc"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"contributorsPerLine": 7,
|
"contributorsPerLine": 7,
|
||||||
|
|
|
||||||
BIN
.github/assets/icon-128x128.png
vendored
Normal file
BIN
.github/assets/icon-128x128.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 13 KiB |
BIN
.github/assets/icon-96x96.png
vendored
Normal file
BIN
.github/assets/icon-96x96.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 7.8 KiB |
BIN
.github/assets/project-logo-vertical.png
vendored
BIN
.github/assets/project-logo-vertical.png
vendored
Binary file not shown.
|
Before Width: | Height: | Size: 1.5 MiB After Width: | Height: | Size: 16 KiB |
BIN
.github/assets/project-logo.png
vendored
BIN
.github/assets/project-logo.png
vendored
Binary file not shown.
|
Before Width: | Height: | Size: 394 KiB After Width: | Height: | Size: 4.7 KiB |
10
.github/workflows/check.yml
vendored
10
.github/workflows/check.yml
vendored
|
|
@ -32,6 +32,16 @@ jobs:
|
||||||
run: pnpm run lint
|
run: pnpm run lint
|
||||||
- name: Format check
|
- name: Format check
|
||||||
run: pnpm run prettier
|
run: pnpm run prettier
|
||||||
|
- name: Build check
|
||||||
|
run: pnpm run build
|
||||||
|
- name: Deploy to Vercel (Preview)
|
||||||
|
uses: amondnet/vercel-action@v25
|
||||||
|
with:
|
||||||
|
vercel-token: ${{ secrets.VERCEL_TOKEN }}
|
||||||
|
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
|
||||||
|
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}
|
||||||
|
working-directory: ./
|
||||||
|
scope: ${{ secrets.VERCEL_SCOPE }}
|
||||||
- name: Unit & Integration tests
|
- name: Unit & Integration tests
|
||||||
run: pnpm run test
|
run: pnpm run test
|
||||||
- name: Smoke & Acceptance tests
|
- name: Smoke & Acceptance tests
|
||||||
|
|
|
||||||
5
.gitignore
vendored
5
.gitignore
vendored
|
|
@ -8,6 +8,9 @@ node_modules
|
||||||
# testing
|
# testing
|
||||||
coverage
|
coverage
|
||||||
|
|
||||||
|
#Add nefi history
|
||||||
|
.nefi-history
|
||||||
|
|
||||||
# next.js
|
# next.js
|
||||||
.next/
|
.next/
|
||||||
out/
|
out/
|
||||||
|
|
@ -34,3 +37,5 @@ storybook-static/
|
||||||
/playwright/.cache/
|
/playwright/.cache/
|
||||||
|
|
||||||
/.npm-only-allow
|
/.npm-only-allow
|
||||||
|
# clerk configuration (can include secrets)
|
||||||
|
/.clerk/
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,14 @@
|
||||||
[
|
[
|
||||||
|
{
|
||||||
|
"t": 1743173521716,
|
||||||
|
"op": "commit",
|
||||||
|
"d": "Created a new commit",
|
||||||
|
"dt": {
|
||||||
|
"subject": "feat(deps): Integrate Clerk authentication and authorization",
|
||||||
|
"message": "Add comprehensive Clerk authentication system with advanced features:\n\n- Implement Clerk authentication provider\n- Set up protected routes with role-based access control\n- Configure advanced authentication flows\n- Add middleware for authentication checks\n- Implement user session management\n- Create login, signup, and profile management components\n\nThis implementation enhances application security and provides a robust authentication solution with seamless user experience.",
|
||||||
|
"branch": "feature/clerk-auth-advanced-routing"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"t": 1743173515146,
|
"t": 1743173515146,
|
||||||
"op": "branch-create",
|
"op": "branch-create",
|
||||||
|
|
|
||||||
51
README.md
51
README.md
|
|
@ -7,8 +7,6 @@
|
||||||
|
|
||||||
Welcome to the _Next.js Enterprise Boilerplate_, an open-source template for enterprise projects! It's loaded with features that'll help you build a high-performance, maintainable, and enjoyable app. We've done all the heavy lifting for you, so sit back, relax, and get ready to conquer the world with your incredible app! 🌍
|
Welcome to the _Next.js Enterprise Boilerplate_, an open-source template for enterprise projects! It's loaded with features that'll help you build a high-performance, maintainable, and enjoyable app. We've done all the heavy lifting for you, so sit back, relax, and get ready to conquer the world with your incredible app! 🌍
|
||||||
|
|
||||||
> [!NOTE]
|
|
||||||
> **Blazity** is a group of Next.js/Headless experts. Contact us at [contact@blazity.com](https://blazity.com) if you’d like to talk about your project or just to have a chat with us
|
|
||||||
|
|
||||||
### Integrated features
|
### Integrated features
|
||||||
|
|
||||||
|
|
@ -49,7 +47,6 @@ Here's an example video of [nefi](https://nefi.ai/) integrating [Clerk](https://
|
||||||
https://github.com/user-attachments/assets/5c13a110-7389-4859-909f-60a7f623e47d
|
https://github.com/user-attachments/assets/5c13a110-7389-4859-909f-60a7f623e47d
|
||||||
|
|
||||||
|
|
||||||
Leave a ⭐ for [nefi on GitHub](https://github.com/blazity/nefi) and check out the [nefi.ai docs](https://nefi.ai/)!
|
|
||||||
|
|
||||||
## Table of Contents
|
## Table of Contents
|
||||||
|
|
||||||
|
|
@ -271,58 +268,10 @@ Contributions are always welcome! To contribute, please follow these steps:
|
||||||
|
|
||||||
## Support
|
## Support
|
||||||
|
|
||||||
If you're looking for help or simply want to share your thoughts about the project, we encourage you to join our Discord community. Here's the link: [https://blazity.com/discord](https://blazity.com/discord). It's a space where we exchange ideas and help one another. Everyone's input is appreciated, and we look forward to welcoming you.
|
|
||||||
|
|
||||||
<br />
|
|
||||||
<a href="https://discord.gg/fyWtyNKmfX" style="width: 100%; display: flex; justify-content: center;">
|
|
||||||
<img src="https://discordapp.com/api/guilds/1111676875782234175/widget.png?style=banner2" alt="Blazity Discord Banner"/>
|
|
||||||
</a>
|
|
||||||
<br />
|
|
||||||
|
|
||||||
|
|
||||||
## 📜 License
|
## 📜 License
|
||||||
|
|
||||||
This project is licensed under the MIT License. For more information, see the [LICENSE](./LICENSE) file.
|
This project is licensed under the MIT License. For more information, see the [LICENSE](./LICENSE) file.
|
||||||
|
|
||||||
## Contributors
|
|
||||||
|
|
||||||
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
|
|
||||||
<!-- prettier-ignore-start -->
|
|
||||||
<!-- markdownlint-disable -->
|
|
||||||
<table>
|
|
||||||
<tbody>
|
|
||||||
<tr>
|
|
||||||
<td align="center" valign="top" width="14.28%"><a href="https://bstefanski.com/"><img src="https://avatars.githubusercontent.com/u/28964599?v=4?s=100" width="100px;" alt="Bart Stefanski"/><br /><sub><b>Bart Stefanski</b></sub></a><br /><a href="https://github.com/Blazity/next-enterprise/commits?author=bmstefanski" title="Code">💻</a></td>
|
|
||||||
<td align="center" valign="top" width="14.28%"><a href="https://github.com/jjablonski-it"><img src="https://avatars.githubusercontent.com/u/51968772?v=4?s=100" width="100px;" alt="Jakub Jabłoński"/><br /><sub><b>Jakub Jabłoński</b></sub></a><br /><a href="#infra-jjablonski-it" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a></td>
|
|
||||||
<td align="center" valign="top" width="14.28%"><a href="https://neg4n.dev/"><img src="https://avatars.githubusercontent.com/u/57688858?v=4?s=100" width="100px;" alt="Igor Klepacki"/><br /><sub><b>Igor Klepacki</b></sub></a><br /><a href="https://github.com/Blazity/next-enterprise/commits?author=neg4n" title="Documentation">📖</a></td>
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
|
||||||
<tfoot>
|
|
||||||
<tr>
|
|
||||||
<td align="center" size="13px" colspan="7">
|
|
||||||
<img src="https://raw.githubusercontent.com/all-contributors/all-contributors-cli/1b8533af435da9854653492b1327a23a4dbd0a10/assets/logo-small.svg">
|
|
||||||
<a href="https://all-contributors.js.org/docs/en/bot/usage">Add your contributions</a>
|
|
||||||
</img>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</tfoot>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
<!-- markdownlint-restore -->
|
|
||||||
<!-- prettier-ignore-end -->
|
|
||||||
|
|
||||||
<!-- ALL-CONTRIBUTORS-LIST:END -->
|
|
||||||
|
|
||||||
<!-- Badges and links -->
|
|
||||||
|
|
||||||
[check-workflow-badge]: https://img.shields.io/github/actions/workflow/status/blazity/next-enterprise/check.yml?label=check
|
|
||||||
[github-license-badge]: https://img.shields.io/github/license/blazity/next-enterprise?link=https%3A%2F%2Fgithub.com%2FBlazity%2Fnext-enterprise%2Fblob%2Fmain%2FLICENSE
|
|
||||||
[github-contributors-badge]: https://img.shields.io/github/contributors/blazity/next-enterprise?link=https%3A%2F%2Fgithub.com%2FBlazity%2Fnext-enterprise%2Fgraphs%2Fcontributors
|
|
||||||
[discord-badge]: https://img.shields.io/discord/1111676875782234175?color=7b8dcd&link=https%3A%2F%2Fblazity.com%2Fdiscord
|
|
||||||
[made-by-blazity-badge]: https://img.shields.io/badge/made_by-Blazity-blue?color=FF782B&link=https://blazity.com/
|
|
||||||
|
|
||||||
[check-workflow-badge-link]: https://github.com/Blazity/next-enterprise/actions/workflows/check.yml
|
|
||||||
[github-license-badge-link]: https://github.com/Blazity/next-enterprise/blob/main/LICENSE
|
|
||||||
[github-contributors-badge-link]: https://github.com/Blazity/next-enterprise/graphs/contributors
|
|
||||||
[discord-badge-link]: https://blazity.com/discord
|
|
||||||
[made-by-blazity-badge-link]: https://blazity.com/?utm_source=nextenterprise&utm_medium=github
|
|
||||||
|
|
|
||||||
25
env.mjs
25
env.mjs
|
|
@ -7,15 +7,34 @@ export const env = createEnv({
|
||||||
.enum(["true", "false"])
|
.enum(["true", "false"])
|
||||||
.optional()
|
.optional()
|
||||||
.transform((value) => value === "true"),
|
.transform((value) => value === "true"),
|
||||||
|
// Add Clerk secret keys (server-side only)
|
||||||
|
CLERK_SECRET_KEY: z.string().optional(),
|
||||||
|
// Add any other server-side environment variables
|
||||||
|
DATABASE_URL: z.string().optional(),
|
||||||
|
// Vercel deployment environment - this is set automatically by Vercel
|
||||||
|
VERCEL_ENV: z.enum(["production", "preview", "development"]).optional(),
|
||||||
},
|
},
|
||||||
client:{
|
client: {
|
||||||
NEXT_PUBLIC_CLERK_ENABLE_KEYLESS: z
|
NEXT_PUBLIC_CLERK_ENABLE_KEYLESS: z
|
||||||
.enum(["true", "false"])
|
.enum(["true", "false"])
|
||||||
.optional()
|
.optional()
|
||||||
.transform((value) => value === "true")
|
.transform((value) => value === "true"),
|
||||||
|
// Add Clerk publishable key
|
||||||
|
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY: z.string().optional(),
|
||||||
|
// These are set automatically by Vercel
|
||||||
|
NEXT_PUBLIC_VERCEL_URL: z.string().optional(),
|
||||||
|
NEXT_PUBLIC_VERCEL_ENV: z.enum(["production", "preview", "development"]).optional(),
|
||||||
},
|
},
|
||||||
runtimeEnv: {
|
runtimeEnv: {
|
||||||
NEXT_PUBLIC_CLERK_ENABLE_KEYLESS: process.env.NEXT_PUBLIC_CLERK_ENABLE_KEYLESS,
|
NEXT_PUBLIC_CLERK_ENABLE_KEYLESS: process.env.NEXT_PUBLIC_CLERK_ENABLE_KEYLESS,
|
||||||
|
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY: process.env.NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY,
|
||||||
|
NEXT_PUBLIC_VERCEL_URL: process.env.NEXT_PUBLIC_VERCEL_URL,
|
||||||
|
NEXT_PUBLIC_VERCEL_ENV: process.env.NEXT_PUBLIC_VERCEL_ENV,
|
||||||
|
CLERK_SECRET_KEY: process.env.CLERK_SECRET_KEY,
|
||||||
|
DATABASE_URL: process.env.DATABASE_URL,
|
||||||
|
VERCEL_ENV: process.env.VERCEL_ENV,
|
||||||
ANALYZE: process.env.ANALYZE,
|
ANALYZE: process.env.ANALYZE,
|
||||||
},
|
},
|
||||||
})
|
// Skip validation in development for easier local development
|
||||||
|
skipValidation: !!process.env.SKIP_ENV_VALIDATION,
|
||||||
|
});
|
||||||
96
scripts/get-vercel-tokens.sh
Executable file
96
scripts/get-vercel-tokens.sh
Executable file
|
|
@ -0,0 +1,96 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Script to extract Vercel tokens and IDs for GitHub Actions
|
||||||
|
# Make sure you're logged in to Vercel CLI first with: vercel login
|
||||||
|
|
||||||
|
# Create output file
|
||||||
|
OUTPUT_FILE="vercel_properties.txt"
|
||||||
|
echo "# Vercel Properties for GitHub Actions" > $OUTPUT_FILE
|
||||||
|
echo "# Generated on $(date)" >> $OUTPUT_FILE
|
||||||
|
echo "# Add these as secrets in your GitHub repository" >> $OUTPUT_FILE
|
||||||
|
echo "" >> $OUTPUT_FILE
|
||||||
|
|
||||||
|
# Check if Vercel CLI is installed
|
||||||
|
if ! command -v vercel &> /dev/null; then
|
||||||
|
echo "Error: Vercel CLI is not installed. Please install it with 'npm i -g vercel'" >> $OUTPUT_FILE
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
# Check if user is logged in
|
||||||
|
if ! vercel whoami &> /dev/null; then
|
||||||
|
echo "Error: You're not logged in to Vercel. Please run 'vercel login' first" >> $OUTPUT_FILE
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Get Vercel token from the config file
|
||||||
|
echo "Getting Vercel token..."
|
||||||
|
CONFIG_DIR="$HOME/.config/vercel"
|
||||||
|
if [ -d "$CONFIG_DIR" ]; then
|
||||||
|
# Try to find the token in the new config location
|
||||||
|
TOKEN_FILE=$(find "$CONFIG_DIR" -name "auth.json" | head -1)
|
||||||
|
if [ -n "$TOKEN_FILE" ]; then
|
||||||
|
VERCEL_TOKEN=$(grep -o "\"token\":\"[^\"]*\"" "$TOKEN_FILE" | cut -d'"' -f4)
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# If token not found in new location, try legacy location
|
||||||
|
if [ -z "$VERCEL_TOKEN" ]; then
|
||||||
|
LEGACY_CONFIG="$HOME/.vercel/auth.json"
|
||||||
|
if [ -f "$LEGACY_CONFIG" ]; then
|
||||||
|
VERCEL_TOKEN=$(grep -o "\"token\":\"[^\"]*\"" "$LEGACY_CONFIG" | cut -d'"' -f4)
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# If still not found, try another approach with the newer CLI
|
||||||
|
if [ -z "$VERCEL_TOKEN" ]; then
|
||||||
|
echo "Could not automatically find Vercel token."
|
||||||
|
echo "Please create a token manually at https://vercel.com/account/tokens" >> $OUTPUT_FILE
|
||||||
|
echo "VERCEL_TOKEN=<create_manually_at_vercel.com/account/tokens>" >> $OUTPUT_FILE
|
||||||
|
else
|
||||||
|
echo "VERCEL_TOKEN=$VERCEL_TOKEN" >> $OUTPUT_FILE
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Get project info using the 'inspect' command instead of 'ls --json'
|
||||||
|
echo "Getting project information..."
|
||||||
|
PROJECT_NAME=$(basename $(pwd))
|
||||||
|
PROJECT_INFO=$(vercel project ls 2>/dev/null)
|
||||||
|
|
||||||
|
echo "Looking for project: $PROJECT_NAME"
|
||||||
|
|
||||||
|
# Get current project details
|
||||||
|
PROJECT_DETAILS=$(vercel project ls | grep "$PROJECT_NAME")
|
||||||
|
if [ -z "$PROJECT_DETAILS" ]; then
|
||||||
|
echo "Warning: Couldn't find a project named '$PROJECT_NAME'." >> $OUTPUT_FILE
|
||||||
|
echo "VERCEL_PROJECT_ID=<get_from_vercel_dashboard>" >> $OUTPUT_FILE
|
||||||
|
echo "VERCEL_ORG_ID=<get_from_vercel_dashboard>" >> $OUTPUT_FILE
|
||||||
|
else
|
||||||
|
# Extract project ID using vercel inspect
|
||||||
|
echo "Found project. Getting details..."
|
||||||
|
INSPECT_OUTPUT=$(vercel project inspect "$PROJECT_NAME" 2>/dev/null)
|
||||||
|
|
||||||
|
# Extract Project ID
|
||||||
|
PROJECT_ID=$(echo "$INSPECT_OUTPUT" | grep -o "ID: [a-zA-Z0-9_-]*" | cut -d' ' -f2)
|
||||||
|
if [ -n "$PROJECT_ID" ]; then
|
||||||
|
echo "VERCEL_PROJECT_ID=$PROJECT_ID" >> $OUTPUT_FILE
|
||||||
|
else
|
||||||
|
echo "VERCEL_PROJECT_ID=<get_from_vercel_dashboard>" >> $OUTPUT_FILE
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Extract Org ID
|
||||||
|
ORG_ID=$(echo "$INSPECT_OUTPUT" | grep -o "ORGANIZATION ID: [a-zA-Z0-9_-]*" | cut -d' ' -f3)
|
||||||
|
if [ -n "$ORG_ID" ]; then
|
||||||
|
echo "VERCEL_ORG_ID=$ORG_ID" >> $OUTPUT_FILE
|
||||||
|
else
|
||||||
|
echo "VERCEL_ORG_ID=<get_from_vercel_dashboard>" >> $OUTPUT_FILE
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Get scope (team name or username)
|
||||||
|
SCOPE=$(vercel whoami)
|
||||||
|
echo "VERCEL_SCOPE=$SCOPE" >> $OUTPUT_FILE
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo "✅ Vercel properties have been saved to $OUTPUT_FILE"
|
||||||
|
echo "Add these as secrets in your GitHub repository Settings → Secrets and variables → Actions"
|
||||||
|
echo "If any values are missing, you can find them in your Vercel dashboard under Project Settings"
|
||||||
Loading…
Add table
Add a link
Reference in a new issue