├── .commitlintrc.json ├── .dockerignore ├── .eslintrc.js ├── .github ├── ISSUE_TEMPLATE │ ├── bug.md │ └── feature.md ├── project-ideas.md ├── pull_request_template.md └── workflows │ ├── cd.yml │ ├── cd_prod.yml │ └── lint_commit.yml ├── .gitignore ├── .husky ├── commit-msg └── pre-commit ├── .lintstagedrc ├── .prettierignore ├── .prettierrc ├── .yarnrc ├── Dockerfile ├── Dockerfile.prod ├── LICENSE ├── README.md ├── apps └── web │ ├── .env.example │ ├── .eslintrc.js │ ├── README.md │ ├── app │ ├── (marketing) │ │ ├── (policy) │ │ │ └── privacy-policy │ │ │ │ └── page.tsx │ │ ├── layout.tsx │ │ └── tnc │ │ │ └── page.tsx │ ├── admin │ │ ├── layout.tsx │ │ └── page.tsx │ ├── api │ │ ├── AddTracks │ │ │ └── route.ts │ │ ├── auth │ │ │ └── [...nextauth] │ │ │ │ └── route.ts │ │ └── revalidate │ │ │ └── route.ts │ ├── assets │ │ ├── github.svg │ │ └── google.svg │ ├── auth │ │ └── page.tsx │ ├── canva-track │ │ └── [...trackIds] │ │ │ └── page.tsx │ ├── favicon.ico │ ├── globals.css │ ├── layout.tsx │ ├── page.module.css │ ├── page.tsx │ ├── pdf │ │ └── [...pdfId] │ │ │ └── page.tsx │ ├── profile │ │ ├── layout.tsx │ │ └── page.tsx │ └── tracks │ │ └── [...trackIds] │ │ └── page.tsx │ ├── components │ ├── Appbar.tsx │ ├── AppbarClient.tsx │ ├── Blog.tsx │ ├── BlogAppbar.tsx │ ├── Categories.tsx │ ├── CodeBlock.tsx │ ├── ContentSearch.tsx │ ├── CustomPagination.tsx │ ├── EditProblem.tsx │ ├── ErrorBoundary.tsx │ ├── Hero.tsx │ ├── LessonView.tsx │ ├── Loader.tsx │ ├── ModeToggle.tsx │ ├── MultipleOptionChip.tsx │ ├── NotionRenderer.tsx │ ├── PageToggle.tsx │ ├── Print.tsx │ ├── ProfileChildren.tsx │ ├── ProfileSidebar.tsx │ ├── Providers.tsx │ ├── RedirectToLastSolved.tsx │ ├── RedirectToLoginCard.tsx │ ├── ScrollToTopWrapper.tsx │ ├── SearchDialog.tsx │ ├── Signin.tsx │ ├── TrackCard-2.tsx │ ├── TrackList.tsx │ ├── TrackPreview.tsx │ ├── TrackTools.tsx │ ├── Tracks.tsx │ ├── UserAccountDropDown.tsx │ ├── UserDetailForm.tsx │ ├── UserImage.tsx │ ├── admin │ │ ├── AddProblemCard.tsx │ │ ├── AddTrackCard.tsx │ │ ├── AdminAddMCQ.tsx │ │ ├── AdminMCQ.tsx │ │ ├── AdminSearch.tsx │ │ ├── CompleteAddTracks.tsx │ │ ├── CompleteTrackCard.tsx │ │ ├── EditCategories.tsx │ │ ├── EditTrackCard.tsx │ │ ├── LinkCard.tsx │ │ ├── LinkProblems.tsx │ │ ├── ProblemCard.tsx │ │ ├── ProblemEditor.tsx │ │ └── TracksEditor.tsx │ ├── card.tsx │ ├── mcq │ │ ├── EditMCQ.tsx │ │ ├── MCQCard.tsx │ │ ├── MCQPanel.tsx │ │ ├── MCQQuestion.tsx │ │ ├── MCQRenderer.tsx │ │ └── SubmissionMCQ.tsx │ ├── privacy-policy │ │ └── privacy-policy.ts │ ├── profile │ │ └── ProfileOptions.tsx │ ├── tnc │ │ └── tnc-content.ts │ ├── use-follow-pointer.ts │ └── utils.tsx │ ├── hooks │ └── useMountStatus.ts │ ├── lib │ ├── auth.ts │ ├── cache │ │ ├── cache.ts │ │ ├── in-memory-cache.ts │ │ └── redis-cache.ts │ ├── search.ts │ └── utils.ts │ ├── next-env.d.ts │ ├── next.config.js │ ├── package.json │ ├── postcss.config.js │ ├── public │ ├── Google Play.svg │ ├── Mockup.png │ ├── circles.svg │ ├── github.svg │ ├── google.svg │ ├── logo.png │ ├── next.svg │ ├── playstore.png │ ├── turborepo.svg │ └── vercel.svg │ ├── screens │ ├── Admin.tsx │ ├── Landing.tsx │ ├── footer-cta.tsx │ └── footer.tsx │ ├── tailwind.config.js │ └── tsconfig.json ├── docker-compose.yml ├── package.json ├── packages ├── db │ ├── .env.example │ ├── .gitignore │ ├── Cache.ts │ ├── docker-compose.yml │ ├── package.json │ ├── prisma │ │ ├── migrations │ │ │ ├── 20240402204828_init │ │ │ │ └── migration.sql │ │ │ ├── 20240403204246_added_mcq │ │ │ │ └── migration.sql │ │ │ ├── 20240404031649_nextauth │ │ │ │ └── migration.sql │ │ │ ├── 20240407230643_adds │ │ │ │ └── migration.sql │ │ │ ├── 20240408080322_added_categories │ │ │ │ └── migration.sql │ │ │ ├── 20240411143941_added_admin │ │ │ │ └── migration.sql │ │ │ ├── 20240412144918_ │ │ │ │ └── migration.sql │ │ │ ├── 20240412224746_code_exec │ │ │ │ └── migration.sql │ │ │ ├── 20240416173507_added_search │ │ │ │ └── migration.sql │ │ │ ├── 20240427131506_add_index │ │ │ │ └── migration.sql │ │ │ ├── 20240430194543_added_mcq_submission │ │ │ │ └── migration.sql │ │ │ ├── 20240803144221_added_cohort │ │ │ │ └── migration.sql │ │ │ ├── 20240809135031_removed_code │ │ │ │ └── migration.sql │ │ │ ├── 20241101231656_add_canva │ │ │ │ └── migration.sql │ │ │ └── migration_lock.toml │ │ ├── schema.prisma │ │ ├── seed.ts │ │ └── seedsData.ts │ ├── setupDB.sh │ └── src │ │ └── index.ts ├── eslint-config │ ├── README.md │ ├── library.js │ ├── next.js │ ├── package.json │ └── react-internal.js ├── store │ ├── package.json │ ├── src │ │ ├── atoms │ │ │ ├── filter.ts │ │ │ ├── index.ts │ │ │ ├── profileSidebar.ts │ │ │ ├── quiz.ts │ │ │ └── view.ts │ │ └── index.ts │ └── tsconfig.json ├── typescript-config │ ├── base.json │ ├── nextjs.json │ ├── package.json │ └── react-library.json └── ui │ ├── .eslintrc.js │ ├── components.json │ ├── package.json │ ├── src │ ├── index.ts │ ├── lib │ │ └── utils.ts │ └── shad │ │ └── ui │ │ ├── badge.tsx │ │ ├── button.tsx │ │ ├── card.tsx │ │ ├── checkbox.tsx │ │ ├── dailog.tsx │ │ ├── dropdown-menu.tsx │ │ ├── input.tsx │ │ ├── label.tsx │ │ ├── pagination.tsx │ │ ├── resizable.tsx │ │ ├── scroll-area.tsx │ │ ├── select.tsx │ │ ├── separator.tsx │ │ ├── sheet.tsx │ │ ├── skeleton.tsx │ │ ├── spotlight.tsx │ │ ├── switch.tsx │ │ ├── table.tsx │ │ ├── tabs.tsx │ │ ├── textarea.tsx │ │ ├── toast.tsx │ │ ├── toaster.tsx │ │ ├── tooltip.tsx │ │ └── use-toast.tsx │ ├── tailwind.config.js │ ├── tsconfig.json │ ├── tsconfig.lint.json │ └── turbo.json ├── tsconfig.json ├── turbo.json └── yarn.lock /.commitlintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": ["@commitlint/config-conventional"], 3 | "rules": { 4 | "type-enum": [2, "always", ["ci", "chore", "docs", "feat", "fix", "perf", "refactor", "revert", "style", "assets"]] 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /.dockerignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | build 3 | ./apps/web/.env 4 | ./packages/db/.env -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | // This configuration only applies to the package manager root. 2 | /** @type {import("eslint").Linter.Config} */ 3 | 4 | module.exports = { 5 | ignorePatterns: ["apps/**", "packages/**"], 6 | extends: ["@repo/eslint-config/library.js"], 7 | parser: "@typescript-eslint/parser", 8 | parserOptions: { 9 | project: true, 10 | }, 11 | rules: { 12 | "no-unused-vars": "off", 13 | "no-redeclare": "off", 14 | } 15 | }; 16 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug 3 | about: Create a report to help us improve 4 | title: "bug: " 5 | labels: "bug,needs-triage" 6 | assignees: '' 7 | --- 8 | 9 | **Describe the bug** 10 | A clear and concise description of what the bug is. 11 | 12 | **To Reproduce** 13 | Steps to reproduce the behavior: 14 | 1. Do something 15 | 2. See error 16 | 17 | **Expected behavior** 18 | A clear and concise description of what you expected to happen. 19 | 20 | **Screenshots or GIFs** 21 | If applicable, add screenshots to help explain your problem. 22 | 23 | **Info (please complete the following information):** 24 | - Browser [e.g. chrome, safari] 25 | - Version [e.g. 22] 26 | 27 | **Additional context** 28 | Add any other context about the problem here. 29 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: 'feature: ' 5 | labels: enhancement 6 | assignees: '' 7 | --- 8 | 9 | **Is your feature request related to a problem? Please describe.** 10 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 11 | 12 | **Describe the solution you'd like** 13 | A clear and concise description of what you want to happen. 14 | 15 | **Describe alternatives you've considered** 16 | A clear and concise description of any alternative solutions or features you've considered. 17 | 18 | **Additional context** 19 | Add any other context or screenshots about the feature request here. 20 | -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | ### PR Fixes: 2 | - 1 3 | - 2 4 | 5 | Resolves #[Issue Number if there] 6 | 7 | ### Checklist before requesting a review 8 | - [ ] I have performed a self-review of my code 9 | - [ ] I assure there is no similar/duplicate pull request regarding same issue 10 | -------------------------------------------------------------------------------- /.github/workflows/cd.yml: -------------------------------------------------------------------------------- 1 | name: Continuous Deployment 2 | on: 3 | push: 4 | branches: [ main ] 5 | jobs: 6 | build: 7 | runs-on: ubuntu-latest 8 | steps: 9 | - uses: actions/checkout@v2 10 | with: 11 | fetch-depth: 0 12 | 13 | - name: Docker login 14 | uses: docker/login-action@v2 15 | with: 16 | username: ${{ secrets.DOCKERHUB_USERNAME }} 17 | password: ${{ secrets.DOCKERHUB_TOKEN }} 18 | 19 | - name: Set up Docker Buildx 20 | uses: docker/setup-buildx-action@v2 21 | 22 | - name: Build and push 23 | uses: docker/build-push-action@v4 24 | with: 25 | context: . 26 | file: ./Dockerfile.prod 27 | push: true 28 | tags: 100xdevs/dailycode-staging:${{ github.sha }} 29 | build-args: | 30 | DATABASE_URL=${{ secrets.STAGING_DATABASE }} 31 | 32 | - name: Clone staging-ops repo, update, and push 33 | env: 34 | PAT: ${{ secrets.PAT }} 35 | run: | 36 | git clone https://github.com/code100x/staging-ops.git 37 | cd staging-ops 38 | sed -i 's|image: 100xdevs/dailycode-staging:.*|image: 100xdevs/dailycode-staging:${{ github.sha }}|' staging/dailycode/deployment.yml 39 | git config user.name "GitHub Actions Bot" 40 | git config user.email "actions@github.com" 41 | git add staging/dailycode/deployment.yml 42 | git commit -m "Update dailycode image to ${{ github.sha }}" 43 | git push https://${PAT}@github.com/code100x/staging-ops.git main -------------------------------------------------------------------------------- /.github/workflows/cd_prod.yml: -------------------------------------------------------------------------------- 1 | name: Continuous Deployment (Prod) 2 | on: 3 | push: 4 | branches: [ production ] 5 | jobs: 6 | build: 7 | runs-on: ubuntu-latest 8 | steps: 9 | - uses: actions/checkout@v2 10 | with: 11 | fetch-depth: 0 12 | 13 | - name: Docker login 14 | uses: docker/login-action@v2 15 | with: 16 | username: ${{ secrets.DOCKERHUB_USERNAME }} 17 | password: ${{ secrets.DOCKERHUB_TOKEN }} 18 | 19 | - name: Set up Docker Buildx 20 | uses: docker/setup-buildx-action@v2 21 | 22 | - name: Build and push 23 | uses: docker/build-push-action@v4 24 | with: 25 | context: . 26 | file: ./Dockerfile.prod 27 | push: true 28 | tags: 100xdevs/dailycode:${{ github.sha }} 29 | build-args: | 30 | DATABASE_URL=${{ secrets.PROD_DATABASE }} 31 | 32 | - name: Clone staging-ops repo, update, and push 33 | env: 34 | PAT: ${{ secrets.PAT }} 35 | run: | 36 | git clone https://github.com/code100x/staging-ops.git 37 | cd staging-ops 38 | sed -i 's|image: 100xdevs/dailycode:.*|image: 100xdevs/dailycode:${{ github.sha }}|' prod/dailycode/deployment.yml 39 | git config user.name "GitHub Actions Bot" 40 | git config user.email "actions@github.com" 41 | git add prod/dailycode/deployment.yml 42 | git commit -m "Update dailycode image to ${{ github.sha }}" 43 | git push https://${PAT}@github.com/code100x/staging-ops.git main -------------------------------------------------------------------------------- /.github/workflows/lint_commit.yml: -------------------------------------------------------------------------------- 1 | name: CommitLint, Linting and formatting 2 | on: 3 | pull_request: 4 | branches: 5 | - '**' 6 | 7 | jobs: 8 | 9 | Continuous-Integration: 10 | 11 | name: Performs linting, formatting on the application 12 | runs-on: ubuntu-latest 13 | steps: 14 | - name: Checkout Repository 15 | uses: actions/checkout@v3 16 | with: 17 | fetch-depth: 0 18 | 19 | - name: Cache Yarn dependencies 20 | uses: actions/cache@v2 21 | with: 22 | path: ~/.cache/yarn 23 | key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} 24 | restore-keys: | 25 | ${{ runner.os }}-yarn- 26 | 27 | - name: Install Yarn and Dependencies 28 | run: yarn install --frozen-lockfile 29 | 30 | - name: Print versions 31 | run: | 32 | git --version 33 | yarn --version 34 | 35 | - name: Run linting check 36 | run: yarn run lint 37 | 38 | - name: Check formatting 39 | run: yarn run format -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # Dependencies 4 | node_modules 5 | .pnp 6 | .pnp.js 7 | 8 | # Local env files 9 | .env 10 | .env.local 11 | .env.development.local 12 | .env.test.local 13 | .env.production.local 14 | 15 | # Testing 16 | coverage 17 | 18 | # Turbo 19 | .turbo 20 | 21 | # Vercel 22 | .vercel 23 | 24 | # Build Outputs 25 | .next/ 26 | out/ 27 | build 28 | dist 29 | 30 | 31 | # Debug 32 | npm-debug.log* 33 | yarn-debug.log* 34 | yarn-error.log* 35 | 36 | # Misc 37 | .DS_Store 38 | *.pem 39 | 40 | .idea/ 41 | -------------------------------------------------------------------------------- /.husky/commit-msg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code100x/daily-code/109c52610d0d4fe9dd8e5f85d4d58c0fbf68092d/.husky/commit-msg -------------------------------------------------------------------------------- /.husky/pre-commit: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | . "$(dirname "$0")/_/husky.sh" 3 | 4 | # Define the unwanted lock files 5 | unwanted_files=("package-lock.json" "pnpm-lock.yaml" "bun.lockb") 6 | 7 | # Check for unwanted lock files in the staged changes 8 | for file in "${unwanted_files[@]}"; do 9 | if git diff --cached --name-only | grep -qE "^$file$"; then 10 | echo "Error: Commits containing '$file' are not allowed. Please use Yarn and remove this file from your commit." 11 | exit 1 12 | fi 13 | done 14 | 15 | # Allow only yarn.lock, not mandatory but should be the only lock file if present 16 | if git diff --cached --name-only | grep -qE "^(package-lock\.json|pnpm-lock\.yaml|bun\.lockb)$"; then 17 | echo "Error: Only 'yarn.lock' is allowed as a lock file. Please remove any other lock files from your commit." 18 | exit 1 19 | fi 20 | -------------------------------------------------------------------------------- /.lintstagedrc: -------------------------------------------------------------------------------- 1 | { 2 | "**/*.{ts,tsx,json}": ["prettier --write"] 3 | } -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | /.vscode 2 | /node_modules 3 | ./dist 4 | 5 | *.yml 6 | *.yaml 7 | 8 | *.env 9 | .env 10 | .env.* -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "singleQuote": false, 3 | "printWidth": 120, 4 | "bracketSpacing": true, 5 | "tabWidth": 2, 6 | "trailingComma": "es5", 7 | "semi": true, 8 | "plugins": ["prettier-plugin-tailwindcss"] 9 | } 10 | -------------------------------------------------------------------------------- /.yarnrc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/code100x/daily-code/109c52610d0d4fe9dd8e5f85d4d58c0fbf68092d/.yarnrc -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:20-alpine 2 | 3 | WORKDIR /usr/src/app 4 | 5 | COPY . . 6 | 7 | RUN yarn install 8 | 9 | EXPOSE 3000 10 | 11 | CMD ["yarn", "run", "dev:docker"] 12 | -------------------------------------------------------------------------------- /Dockerfile.prod: -------------------------------------------------------------------------------- 1 | FROM node:20-alpine AS base 2 | 3 | FROM base AS deps 4 | RUN set -ex; \ 5 | apk update; \ 6 | apk add --no-cache \ 7 | libc6-compat \ 8 | openssl 9 | 10 | WORKDIR /usr/src/app 11 | 12 | COPY package.json yarn.lock* ./ 13 | COPY apps/web/package.json ./apps/web/ 14 | COPY packages/ ./packages/ 15 | 16 | RUN yarn install --ignore-scripts 17 | 18 | FROM base AS builder 19 | WORKDIR /usr/src/app 20 | 21 | COPY --from=deps /usr/src/app/node_modules ./node_modules 22 | COPY . . 23 | 24 | RUN yarn global add turbo@^2.1.1 25 | RUN DATABASE_URL=$DATABASE_URL npx prisma@5.12.0 generate --schema packages/db/prisma/schema.prisma 26 | 27 | RUN cd apps/web && yarn add sharp 28 | RUN yarn turbo run build --filter=web... 29 | 30 | FROM base AS runner 31 | WORKDIR /usr/src/app 32 | 33 | RUN addgroup --system --gid 1001 nodejs 34 | RUN adduser --system --uid 1001 nextjs 35 | 36 | RUN mkdir .next && chown nextjs:nodejs .next 37 | 38 | USER nextjs 39 | 40 | COPY --from=builder --chown=nextjs:nodejs /usr/src/app/apps/web/.next/standalone ./ 41 | COPY --from=builder --chown=nextjs:nodejs /usr/src/app/apps/web/.next/static ./apps/web/.next/static 42 | COPY --from=builder --chown=nextjs:nodejs /usr/src/app/apps/web/public ./apps/web/public 43 | 44 | EXPOSE 3000 45 | ENV NODE_ENV production 46 | ENV PORT 3000 47 | ENV HOSTNAME "0.0.0.0" 48 | 49 | CMD ["node", "apps/web/server.js"] -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2025 code100x 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Quick Setup Locally 2 | 3 | ## Option 1: Using Docker 4 | 5 | ```bash 6 | docker compose watch 7 | ``` 8 | 9 | ## Option 2: Manual Setup 10 | 11 | ### 1. Install Dependencies 12 | ```bash 13 | cd daily-code 14 | yarn install 15 | ``` 16 | 17 | ### 2. Setup Database 18 | 19 | #### For Mac and Linux users 20 | ```bash 21 | cd packages/db 22 | chmod +x ./setupDB.sh 23 | ./setupDB.sh 24 | ``` 25 | 26 | #### For Windows users 27 | ```bash 28 | cd packages/db 29 | copy .env.example .env 30 | docker-compose up 31 | 32 | # Configure the database connection 33 | # Add your connection string to DATABASE_URL 34 | 35 | yarn prisma migrate dev 36 | yarn prisma db seed 37 | ``` 38 | 39 | ### 3. Run Locally 40 | ```bash 41 | cd ../.. 42 | yarn run dev 43 | ``` 44 | -------------------------------------------------------------------------------- /apps/web/.env.example: -------------------------------------------------------------------------------- 1 | GITHUB_ID="" 2 | GITHUB_SECRET="" 3 | GOOGLE_CLIENT_ID="" 4 | GOOGLE_CLIENT_SECRET="" 5 | NEXTAUTH_URL="http://localhost:3000" 6 | NEXTAUTH_SECRET="NEXTAUTH_SECRET" 7 | 8 | GOOGLEAI_API_KEY= 9 | QDRANT_API_KEY= 10 | QDRANT_URL= 11 | VECTOR_DIMENSION=768 # Upto 768 dimensions are supported 12 | 13 | CACHE_EXPIRE=1800 # expiration time of the cache memory -------------------------------------------------------------------------------- /apps/web/.eslintrc.js: -------------------------------------------------------------------------------- 1 | /** @type {import("eslint").Linter.Config} */ 2 | module.exports = { 3 | root: true, 4 | extends: ["@repo/eslint-config/next.js"], 5 | parser: "@typescript-eslint/parser", 6 | parserOptions: { 7 | project: true, 8 | }, 9 | }; 10 | -------------------------------------------------------------------------------- /apps/web/README.md: -------------------------------------------------------------------------------- 1 | ## Getting Started 2 | 3 | First, run the development server: 4 | 5 | yarn dev 6 | 7 | ``` 8 | 9 | Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. 10 | 11 | You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file. 12 | 13 | To create [API routes](https://nextjs.org/docs/app/building-your-application/routing/router-handlers) add an `api/` directory to the `app/` directory with a `route.ts` file. For individual endpoints, create a subfolder in the `api` directory, like `api/hello/route.ts` would map to [http://localhost:3000/api/hello](http://localhost:3000/api/hello). 14 | 15 | ## Learn More 16 | 17 | To learn more about Next.js, take a look at the following resources: 18 | 19 | - [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API. 20 | - [Learn Next.js](https://nextjs.org/learn/foundations/about-nextjs) - an interactive Next.js tutorial. 21 | 22 | You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome! 23 | 24 | ## Deploy on Vercel 25 | 26 | The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_source=github.com&utm_medium=referral&utm_campaign=turborepo-readme) from the creators of Next.js. 27 | 28 | Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details. 29 | ``` 30 | -------------------------------------------------------------------------------- /apps/web/app/(marketing)/(policy)/privacy-policy/page.tsx: -------------------------------------------------------------------------------- 1 | import { privacyPolicyContent } from "../../../../components/privacy-policy/privacy-policy"; 2 | 3 | const PrivacyPolicyPage = () => { 4 | return ( 5 |
6 |

Privacy Policy

7 | {privacyPolicyContent.map((item) => { 8 | return ( 9 |
10 |

{item.description}

11 |
12 | ); 13 | })} 14 |
15 | ); 16 | }; 17 | 18 | export default PrivacyPolicyPage; 19 | -------------------------------------------------------------------------------- /apps/web/app/(marketing)/layout.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import Footer from "../../screens/footer"; 3 | import { AppbarClient } from "../../components/AppbarClient"; 4 | 5 | const MarketingLayout = ({ children }: { children: React.ReactNode }) => { 6 | return ( 7 |
8 | 9 | {children} 10 |
12 | ); 13 | }; 14 | 15 | export default MarketingLayout; 16 | -------------------------------------------------------------------------------- /apps/web/app/(marketing)/tnc/page.tsx: -------------------------------------------------------------------------------- 1 | import { tncContent } from "../../../components/tnc/tnc-content"; 2 | 3 | const TermsAndConditionsPage = () => { 4 | return ( 5 |
6 |

Terms & Conditions

7 | {tncContent.map((item) => { 8 | return ( 9 |
10 |

{item.description}

11 | {item.points?.map((point) => { 12 | return ( 13 |

14 | {point.id} 15 | {". "} 16 | {point.description} 17 |

18 | ); 19 | })} 20 |
21 | ); 22 | })} 23 |
24 | ); 25 | }; 26 | 27 | export default TermsAndConditionsPage; 28 | -------------------------------------------------------------------------------- /apps/web/app/admin/layout.tsx: -------------------------------------------------------------------------------- 1 | import { getServerSession } from "next-auth"; 2 | import { authOptions } from "../../lib/auth"; 3 | import Link from "next/link"; 4 | import { LockClosedIcon } from "@radix-ui/react-icons"; 5 | import { ReactNode } from "react"; 6 | 7 | export default async function AdminLayout({ children }: { children: ReactNode }) { 8 | const session = await getServerSession(authOptions); 9 | 10 | if (!session?.user?.admin) { 11 | return ( 12 |
13 |
14 |
15 | 16 |
17 |

Access Denied

18 |

19 | You do not have permission to access this page. 20 |

21 |
22 |
23 |
24 | 28 | Return to the homepage 29 | 30 |
31 |
32 |
33 | ); 34 | } else { 35 | return <>{children}; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /apps/web/app/admin/page.tsx: -------------------------------------------------------------------------------- 1 | import { AppbarClient } from "../../components/AppbarClient"; 2 | import { Admin } from "../../screens/Admin"; 3 | 4 | export default async function AdminPage() { 5 | return ( 6 | <> 7 | 8 | 9 | 10 | ); 11 | } 12 | -------------------------------------------------------------------------------- /apps/web/app/api/AddTracks/route.ts: -------------------------------------------------------------------------------- 1 | import { getServerSession } from "next-auth"; 2 | import { NextRequest, NextResponse } from "next/server"; 3 | import { NotionAPI } from "notion-client"; 4 | import { authOptions } from "../../../lib/auth"; 5 | 6 | export async function POST(req: NextRequest) { 7 | const session = await getServerSession(authOptions); 8 | 9 | if (!session?.user?.admin) { 10 | return NextResponse.json({ message: "Unauthorized" }, { status: 401 }); 11 | } 12 | const body = await req.json(); 13 | const notionId = body.notionId; 14 | const notion = new NotionAPI(); 15 | try { 16 | const recordMap = await notion.getPage(notionId); 17 | const data = Object.keys(recordMap.block).filter((key) => { 18 | const block = recordMap.block[key]; 19 | return block?.role !== "none" 20 | }).map((key) => { 21 | const block = recordMap.block[key]; 22 | return { 23 | notionDocId: block?.value.id, 24 | title: block?.value?.properties?.title[0][0], 25 | }; 26 | }); 27 | data.shift(); 28 | data.pop(); 29 | return NextResponse.json(data); 30 | } catch (e) { 31 | return NextResponse.json(e); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /apps/web/app/api/auth/[...nextauth]/route.ts: -------------------------------------------------------------------------------- 1 | import NextAuth from "next-auth"; 2 | import { authOptions } from "../../../../lib/auth"; 3 | 4 | const handler = NextAuth(authOptions); 5 | 6 | export { handler as GET, handler as POST }; 7 | -------------------------------------------------------------------------------- /apps/web/app/api/revalidate/route.ts: -------------------------------------------------------------------------------- 1 | import { revalidatePath } from "next/cache"; 2 | import { NextRequest, NextResponse } from "next/server"; 3 | 4 | export async function GET(req: NextRequest) { 5 | const fromQuery = req.nextUrl.searchParams.get("secret"); 6 | const path = req.nextUrl.searchParams.get("path"); 7 | 8 | if (fromQuery != process.env.MY_SECRET_TOKEN) { 9 | return NextResponse.json({ message: "Invalid token" }, { status: 401 }); 10 | } 11 | try { 12 | if (path) { 13 | revalidatePath(path); 14 | return NextResponse.json({ revalidated: true, now: Date.now() }); 15 | } 16 | } catch (e) { 17 | return NextResponse.json({ message: "Error revalidating" }, { status: 500 }); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /apps/web/app/assets/github.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /apps/web/app/assets/google.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /apps/web/app/auth/page.tsx: -------------------------------------------------------------------------------- 1 | import { Suspense } from "react"; 2 | import Signin from "../../components/Signin"; 3 | 4 | const SigninPage = async () => { 5 | return ; 6 | }; 7 | 8 | export default SigninPage; 9 | -------------------------------------------------------------------------------- /apps/web/app/canva-track/[...trackIds]/page.tsx: -------------------------------------------------------------------------------- 1 | "use client"; 2 | 3 | import React from "react"; 4 | import { useSearchParams } from "next/navigation"; 5 | import { motion } from "framer-motion"; 6 | import Link from "next/link"; 7 | import Image from "next/image"; 8 | 9 | const Header = ({ title }: { title: string }) => ( 10 | 16 |
17 | 23 |
26 | 27 | Logo 34 | 35 |

{title}

36 |
37 |
38 |
39 |
40 | ); 41 | 42 | export default function CanvaTrack() { 43 | const searchParams = useSearchParams(); 44 | const canvaLink = searchParams.get("canvaLink"); 45 | const title = searchParams.get("title"); 46 | 47 | const embedUrl = canvaLink?.includes("?embed") ? canvaLink : `${canvaLink}?embed`; 48 | 49 | console.log({ canvaLink, embedUrl }); 50 | 51 | if (!embedUrl) { 52 | return
No Canva presentation link provided
; 53 | } 54 | 55 | return ( 56 |
57 |
58 |
59 |
60 |