diff --git a/.all-contributorsrc b/.all-contributorsrc index 16a9459..967dec4 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -1,6 +1,6 @@ { - "projectName": "next-enterprise", - "projectOwner": "Blazity", + "projectName": "yarlis-enterprise", + "projectOwner": "Yarlis", "repoType": "github", "repoHost": "https://github.com", "files": [ @@ -11,31 +11,13 @@ "commitConvention": "angular", "contributors": [ { - "login": "bmstefanski", - "name": "Bart Stefanski", - "avatar_url": "https://avatars.githubusercontent.com/u/28964599?v=4", - "profile": "https://bstefanski.com/", - "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", + "login": "siri1410", + "name": "Sireesh Yarlagadda", + "avatar_url": "", + "profile": "https://github.com/siri1410", "contributions": [ "infra" ] - }, - { - "login": "neg4n", - "name": "Igor Klepacki", - "avatar_url": "https://avatars.githubusercontent.com/u/57688858?v=4", - "profile": "https://neg4n.dev/", - "contributions": [ - "doc" - ] } ], "contributorsPerLine": 7, diff --git a/.github/assets/icon-128x128.png b/.github/assets/icon-128x128.png new file mode 100644 index 0000000..4c56e03 Binary files /dev/null and b/.github/assets/icon-128x128.png differ diff --git a/.github/assets/icon-96x96.png b/.github/assets/icon-96x96.png new file mode 100644 index 0000000..ac10d73 Binary files /dev/null and b/.github/assets/icon-96x96.png differ diff --git a/.github/assets/project-logo-vertical.png b/.github/assets/project-logo-vertical.png index be1c896..32980f6 100644 Binary files a/.github/assets/project-logo-vertical.png and b/.github/assets/project-logo-vertical.png differ diff --git a/.github/assets/project-logo.png b/.github/assets/project-logo.png index 28da0ad..72e8b90 100644 Binary files a/.github/assets/project-logo.png and b/.github/assets/project-logo.png differ diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 2415690..595fe57 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -32,6 +32,16 @@ jobs: run: pnpm run lint - name: Format check 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 run: pnpm run test - name: Smoke & Acceptance tests diff --git a/.gitignore b/.gitignore index 724bb7a..fe8a2df 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,9 @@ node_modules # testing coverage +#Add nefi history +.nefi-history + # next.js .next/ out/ @@ -33,4 +36,6 @@ storybook-static/ /playwright-report/ /playwright/.cache/ -/.npm-only-allow \ No newline at end of file +/.npm-only-allow +# clerk configuration (can include secrets) +/.clerk/ diff --git a/.nefi-history b/.nefi-history index 47f22e2..f965aeb 100644 --- a/.nefi-history +++ b/.nefi-history @@ -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, "op": "branch-create", diff --git a/README.md b/README.md index e8afdff..4d7f737 100644 --- a/README.md +++ b/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! 🌍 -> [!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 @@ -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 -Leave a ⭐ for [nefi on GitHub](https://github.com/blazity/nefi) and check out the [nefi.ai docs](https://nefi.ai/)! ## Table of Contents @@ -271,58 +268,10 @@ Contributions are always welcome! To contribute, please follow these steps: ## 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. - -
- - Blazity Discord Banner - -
## 📜 License This project is licensed under the MIT License. For more information, see the [LICENSE](./LICENSE) file. -## Contributors - - - - - - - - - - - - - - - - -
Bart Stefanski
Bart Stefanski

💻
Jakub Jabłoński
Jakub Jabłoński

🚇
Igor Klepacki
Igor Klepacki

📖
- - Add your contributions - -
- - - - - - - - -[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 diff --git a/env.mjs b/env.mjs index cfb185c..c62a5e4 100644 --- a/env.mjs +++ b/env.mjs @@ -7,15 +7,34 @@ export const env = createEnv({ .enum(["true", "false"]) .optional() .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 .enum(["true", "false"]) .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: { 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, }, -}) \ No newline at end of file + // Skip validation in development for easier local development + skipValidation: !!process.env.SKIP_ENV_VALIDATION, +}); \ No newline at end of file diff --git a/scripts/get-vercel-tokens.sh b/scripts/get-vercel-tokens.sh new file mode 100755 index 0000000..b677f7a --- /dev/null +++ b/scripts/get-vercel-tokens.sh @@ -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=" >> $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=" >> $OUTPUT_FILE + echo "VERCEL_ORG_ID=" >> $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=" >> $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=" >> $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"