Showing preview only (252K chars total). Download the full file or copy to clipboard to get everything.
Repository: noodle-run/noodle
Branch: main
Commit: 4e26fb7c990c
Files: 121
Total size: 225.9 KB
Directory structure:
gitextract_hjjugdiq/
├── .changeset/
│ └── config.json
├── .editorconfig
├── .github/
│ ├── FUNDING.yaml
│ ├── ISSUE_TEMPLATE/
│ │ ├── bug_report.md
│ │ ├── config.yaml
│ │ └── feature_request.md
│ ├── PULL_REQUEST_TEMPLATE/
│ │ └── pull_request_template.md
│ └── workflows/
│ ├── main-ci.yml
│ ├── pr-ci.yml
│ └── pr-cleanup.yml
├── .gitignore
├── .husky/
│ ├── commit-msg
│ ├── pre-commit
│ └── prepare-commit-msg
├── .markdownlint.json
├── .prettierignore
├── .vscode/
│ ├── extensions.json
│ └── settings.json
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── LICENSE
├── README.md
├── SECURITY.md
├── bun.lockb
├── cspell.config.yaml
├── drizzle/
│ ├── 0000_funny_johnny_blaze.sql
│ ├── 0001_minor_warlock.sql
│ ├── 0002_complex_sally_floyd.sql
│ └── meta/
│ ├── 0000_snapshot.json
│ ├── 0001_snapshot.json
│ ├── 0002_snapshot.json
│ └── _journal.json
├── drizzle.config.ts
├── eslint.config.js
├── eslint.d.ts
├── next.config.js
├── package.json
├── postcss.config.js
├── prettier.config.js
├── public/
│ ├── .well-known/
│ │ └── security.txt
│ └── browserconfig.xml
├── reset.d.ts
├── src/
│ ├── app/
│ │ ├── (dashboard)/
│ │ │ ├── (auth)/
│ │ │ │ ├── sign-in/
│ │ │ │ │ └── [[...sign-in]]/
│ │ │ │ │ └── page.tsx
│ │ │ │ └── sign-up/
│ │ │ │ └── [[...sign-in]]/
│ │ │ │ └── page.tsx
│ │ │ ├── app/
│ │ │ │ ├── _components/
│ │ │ │ │ ├── active-button.tsx
│ │ │ │ │ ├── create-module-popover.tsx
│ │ │ │ │ ├── module-card.tsx
│ │ │ │ │ ├── recent-modules.tsx
│ │ │ │ │ ├── side-menu.tsx
│ │ │ │ │ └── welcome-message.tsx
│ │ │ │ ├── layout.tsx
│ │ │ │ ├── lib/
│ │ │ │ │ └── color-choices.ts
│ │ │ │ ├── module/
│ │ │ │ │ └── [id]/
│ │ │ │ │ └── page.tsx
│ │ │ │ └── page.tsx
│ │ │ └── layout.tsx
│ │ ├── (site)/
│ │ │ ├── (legal)/
│ │ │ │ ├── layout.tsx
│ │ │ │ ├── privacy/
│ │ │ │ │ └── page.tsx
│ │ │ │ └── tos/
│ │ │ │ └── page.tsx
│ │ │ ├── _components/
│ │ │ │ ├── custom-mdx.tsx
│ │ │ │ ├── footer.tsx
│ │ │ │ └── navbar.tsx
│ │ │ ├── blog/
│ │ │ │ ├── [slug]/
│ │ │ │ │ └── page.tsx
│ │ │ │ └── page.tsx
│ │ │ ├── early-access/
│ │ │ │ ├── _forms/
│ │ │ │ │ └── join.tsx
│ │ │ │ ├── layout.tsx
│ │ │ │ └── page.tsx
│ │ │ ├── layout.tsx
│ │ │ └── page.tsx
│ │ ├── api/
│ │ │ └── trpc/
│ │ │ └── [trpc]/
│ │ │ └── route.ts
│ │ ├── globals.css
│ │ ├── layout.tsx
│ │ ├── manifest.ts
│ │ ├── not-found.tsx
│ │ └── robots.ts
│ ├── constants.tsx
│ ├── content/
│ │ ├── blog/
│ │ │ └── noodle-resurgence.md
│ │ └── legal/
│ │ ├── privacy.md
│ │ └── tos.md
│ ├── db/
│ │ ├── index.ts
│ │ └── schema/
│ │ ├── early-access.ts
│ │ ├── index.ts
│ │ └── modules.ts
│ ├── emails/
│ │ ├── layouts/
│ │ │ └── Base.tsx
│ │ ├── tailwind.ts
│ │ ├── templates/
│ │ │ └── early-access-joined.tsx
│ │ └── utils.ts
│ ├── env.ts
│ ├── lib/
│ │ ├── mdx.ts
│ │ ├── redis.ts
│ │ ├── resend.ts
│ │ └── trpc/
│ │ ├── react.tsx
│ │ ├── server.ts
│ │ └── types.ts
│ ├── mdx-components.tsx
│ ├── middleware.ts
│ ├── primitives/
│ │ ├── button.tsx
│ │ ├── checkbox.tsx
│ │ ├── dropdown-menu.tsx
│ │ ├── form.tsx
│ │ ├── icon.tsx
│ │ ├── input.tsx
│ │ ├── label.tsx
│ │ ├── navigation-menu.tsx
│ │ ├── popover.tsx
│ │ ├── resizable-panel.tsx
│ │ ├── scroll-area.tsx
│ │ ├── select.tsx
│ │ ├── separator.tsx
│ │ ├── skeleton.tsx
│ │ ├── sonner.tsx
│ │ ├── tabs.tsx
│ │ └── textarea.tsx
│ ├── server/
│ │ ├── index.ts
│ │ ├── routers/
│ │ │ ├── early-access.ts
│ │ │ └── modules.ts
│ │ └── trpc.ts
│ └── utils/
│ ├── base-url.ts
│ ├── cn.ts
│ └── construct-metadata.ts
├── tailwind.config.ts
└── tsconfig.json
================================================
FILE CONTENTS
================================================
================================================
FILE: .changeset/config.json
================================================
{
"$schema": "https://unpkg.com/@changesets/config@3.0.0/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"access": "restricted",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
================================================
FILE: .editorconfig
================================================
# EditorConfig is awesome: https://EditorConfig.org
# top-most EditorConfig file
root = true
[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = false
================================================
FILE: .github/FUNDING.yaml
================================================
# These are supported funding model platforms
github: [ixahmedxi]
================================================
FILE: .github/ISSUE_TEMPLATE/bug_report.md
================================================
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''
---
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Additional context**
Add any other context about the problem here.
================================================
FILE: .github/ISSUE_TEMPLATE/config.yaml
================================================
blank_issues_enabled: false
================================================
FILE: .github/ISSUE_TEMPLATE/feature_request.md
================================================
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.
================================================
FILE: .github/PULL_REQUEST_TEMPLATE/pull_request_template.md
================================================
Fixes #
## Proposed Changes
-
-
-
================================================
FILE: .github/workflows/main-ci.yml
================================================
name: Main CI
on:
push:
branches:
- main
# TODO: remove this once next branch is merged into main
- next
jobs:
main-ci:
runs-on: ubuntu-latest
environment: CI
env:
# Database
DATABASE_URL: ${{ secrets.DATABASE_URL }}
# Clerk
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY: ${{ vars.NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY }}
CLERK_SECRET_KEY: ${{ secrets.CLERK_SECRET_KEY }}
NEXT_PUBLIC_CLERK_SIGN_IN_URL: '/sign-in'
NEXT_PUBLIC_CLERK_SIGN_UP_URL: '/sign-up'
NEXT_PUBLIC_CLERK_SIGN_IN_FORCE_REDIRECT_URL: '/app'
NEXT_PUBLIC_CLERK_SIGN_UP_FORCE_REDIRECT_URL: '/app'
# Upstash
UPSTASH_REDIS_REST_URL: ${{ secrets.UPSTASH_REDIS_REST_URL }}
UPSTASH_REDIS_REST_TOKEN: ${{ secrets.UPSTASH_REDIS_REST_TOKEN }}
# Resend
RESEND_API_KEY: ${{ secrets.RESEND_API_KEY }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Setup Bun
uses: oven-sh/setup-bun@v1
- name: Install Dependencies
run: bun install
- name: Run DB Migrations
run: bun db:migrate
- name: Check Format
run: bun format:check
- name: Lint
run: bun lint
- name: Typecheck
run: bun typecheck
- name: Build
run: bun run build
================================================
FILE: .github/workflows/pr-ci.yml
================================================
name: PR CI
on: [pull_request]
jobs:
main-ci:
runs-on: ubuntu-latest
environment: CI
env:
# Neon
NEON_DATABASE_USERNAME: ${{ secrets.NEON_DATABASE_USERNAME }}
NEON_API_KEY: ${{ secrets.NEON_API_KEY }}
NEON_PROJECT_ID: ${{ secrets.NEON_PROJECT_ID }}
# Clerk
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY: ${{ vars.NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY }}
CLERK_SECRET_KEY: ${{ secrets.CLERK_SECRET_KEY }}
NEXT_PUBLIC_CLERK_SIGN_IN_URL: '/sign-in'
NEXT_PUBLIC_CLERK_SIGN_UP_URL: '/sign-up'
NEXT_PUBLIC_CLERK_SIGN_IN_FORCE_REDIRECT_URL: '/app'
NEXT_PUBLIC_CLERK_SIGN_UP_FORCE_REDIRECT_URL: '/app'
# Upstash
UPSTASH_REDIS_REST_URL: ${{ secrets.UPSTASH_REDIS_REST_URL }}
UPSTASH_REDIS_REST_TOKEN: ${{ secrets.UPSTASH_REDIS_REST_TOKEN }}
# Resend
RESEND_API_KEY: ${{ secrets.RESEND_API_KEY }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Get branch name
id: branch_name
uses: tj-actions/branch-names@v8
- name: Create Neon Branch
id: create-branch
uses: neondatabase/create-branch-action@v4
with:
project_id: ${{ env.NEON_PROJECT_ID }}
branch_name: pr-${{ github.event.number }}-${{ steps.branch_name.outputs.current_branch }}
username: ${{ env.NEON_DATABASE_USERNAME }}
api_key: ${{ env.NEON_API_KEY }}
- name: Set DATABASE_URL
shell: bash
run: |
echo "DATABASE_URL=${{ steps.create-branch.outputs.db_url }}?sslmode=require" >> $GITHUB_ENV
- name: Setup Bun
uses: oven-sh/setup-bun@v1
- name: Install Dependencies
run: bun install
- name: Run DB Migrations
run: bun db:migrate
- name: Check Format
run: bun format:check
- name: Lint
run: bun lint
- name: Typecheck
run: bun typecheck
- name: Build
run: bun run build
================================================
FILE: .github/workflows/pr-cleanup.yml
================================================
name: Clean up after after a PR is closed or merged
run-name: Clean up PR database
on:
pull_request:
types: [closed]
jobs:
delete-db-branch:
runs-on: ubuntu-latest
environment: CI
env:
NEON_API_KEY: ${{ secrets.NEON_API_KEY }}
NEON_PROJECT_ID: ${{ secrets.NEON_PROJECT_ID }}
steps:
- name: Get branch name
id: branch_name
uses: tj-actions/branch-names@v8
- name: Delete Neon Branch
uses: neondatabase/delete-branch-action@v3
with:
project_id: ${{ secrets.NEON_PROJECT_ID }}
branch: pr-${{ github.event.number }}-${{ steps.branch_name.outputs.current_branch }}
api_key: ${{ secrets.NEON_API_KEY }}
================================================
FILE: .gitignore
================================================
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*
# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
# Runtime data
pids
*.pid
*.seed
*.pid.lock
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
*.lcov
# nyc test coverage
.nyc_output
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# Bower dependency directory (https://bower.io/)
bower_components
# node-waf configuration
.lock-wscript
# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release
# Dependency directories
node_modules/
jspm_packages/
# Snowpack dependency directory (https://snowpack.dev/)
web_modules/
# TypeScript cache
*.tsbuildinfo
# Optional npm cache directory
.npm
# Optional eslint cache
.eslintcache
# Optional stylelint cache
.stylelintcache
# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/
# Optional REPL history
.node_repl_history
# Output of 'npm pack'
*.tgz
# Yarn Integrity file
.yarn-integrity
# dotenv environment variable files
.env
.env.development.local
.env.test.local
.env.production.local
.env.local
# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache
# Next.js build output
.next
next-env.d.ts
out
# Nuxt.js build / generate output
.nuxt
dist
# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public
# vuepress build output
.vuepress/dist
# vuepress v2.x temp and cache directory
.temp
.cache
# Docusaurus cache and generated files
.docusaurus
# Serverless directories
.serverless/
# FuseBox cache
.fusebox/
# DynamoDB Local files
.dynamodb/
# TernJS port file
.tern-port
# Stores VSCode versions used for testing VSCode extensions
.vscode-test
# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*
# DS Store files
.DS_Store
# task file
.todo
================================================
FILE: .husky/commit-msg
================================================
bun commitlint --edit ${1}
================================================
FILE: .husky/pre-commit
================================================
bun lint-staged
================================================
FILE: .husky/prepare-commit-msg
================================================
# only run this if no git commit message has been provided
[ -z "$2" ] && exec < /dev/tty && bun git-cz --hook || true
================================================
FILE: .markdownlint.json
================================================
{
"extends": "markdownlint/style/prettier",
"first-line-h1": false,
"no-inline-html": false,
"no-space-in-emphasis": false,
"no-duplicate-heading": false,
"code-block-style": false
}
================================================
FILE: .prettierignore
================================================
.prettierignore
node_modules
.next
next-env.d.ts
.husky
bun.lockb
*.toml
drizzle
================================================
FILE: .vscode/extensions.json
================================================
{
"recommendations": [
"esbenp.prettier-vscode",
"dbaeumer.vscode-eslint",
"mikestead.dotenv",
"streetsidesoftware.code-spell-checker",
"aaron-bond.better-comments",
"EditorConfig.EditorConfig",
"dsznajder.es7-react-js-snippets",
"tamasfe.even-better-toml",
"DavidAnson.vscode-markdownlint",
"unifiedjs.vscode-mdx",
"christian-kohler.path-intellisense",
"YoavBls.pretty-ts-errors",
"bradlc.vscode-tailwindcss"
]
}
================================================
FILE: .vscode/settings.json
================================================
{
// Editor
"editor.tabSize": 2,
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
// ESLint
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
},
"eslint.rules.customizations": [
{
"rule": "*",
"severity": "warn"
}
],
"eslint.useFlatConfig": true,
// Tailwind
"files.associations": {
"*.css": "tailwindcss"
},
"tailwindCSS.experimental.classRegex": [
["cva\\(([^)]*)\\)", "[\"'`]([^\"'`]*).*?[\"'`]"],
["cx\\(([^)]*)\\)", "(?:'|\"|`)([^']*)(?:'|\"|`)"]
],
// TypeScript
"typescript.tsdk": "node_modules/typescript/lib"
}
================================================
FILE: CODE_OF_CONDUCT.md
================================================
# Contributor Covenant Code of Conduct
## Our Pledge
We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, caste, color, religion, or sexual
identity and orientation.
We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.
## Our Standards
Examples of behavior that contributes to a positive environment for our
community include:
- Demonstrating empathy and kindness toward other people
- Being respectful of differing opinions, viewpoints, and experiences
- Giving and gracefully accepting constructive feedback
- Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
- Focusing on what is best not just for us as individuals, but for the overall
community
Examples of unacceptable behavior include:
- The use of sexualized language or imagery, and sexual attention or advances of
any kind
- Trolling, insulting or derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or email address,
without their explicit permission
- Other conduct which could reasonably be considered inappropriate in a
professional setting
## Enforcement Responsibilities
Community leaders are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.
Community leaders have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, and will communicate reasons for moderation
decisions when appropriate.
## Scope
This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the community in public spaces.
Examples of representing our community include using an official email address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
[ahmed@noodle.run](mailto:ahmed@noodle.run).
All complaints will be reviewed and investigated promptly and fairly.
All community leaders are obligated to respect the privacy and security of the
reporter of any incident.
## Enforcement Guidelines
Community leaders will follow these Community Impact Guidelines in determining
the consequences for any action they deem in violation of this Code of Conduct:
### 1. Correction
**Community Impact**: Use of inappropriate language or other behavior deemed
unprofessional or unwelcome in the community.
**Consequence**: A private, written warning from community leaders, providing
clarity around the nature of the violation and an explanation of why the
behavior was inappropriate. A public apology may be requested.
### 2. Warning
**Community Impact**: A violation through a single incident or series of
actions.
**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or permanent
ban.
### 3. Temporary Ban
**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.
**Consequence**: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No public or
private interaction with the people involved, including unsolicited interaction
with those enforcing the Code of Conduct, is allowed during this period.
Violating these terms may lead to a permanent ban.
### 4. Permanent Ban
**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.
**Consequence**: A permanent ban from any sort of public interaction within the
community.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.1, available at
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
Community Impact Guidelines were inspired by
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].
For answers to common questions about this code of conduct, see the FAQ at
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
[https://www.contributor-covenant.org/translations][translations].
[homepage]: https://www.contributor-covenant.org
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
[Mozilla CoC]: https://github.com/mozilla/diversity
[FAQ]: https://www.contributor-covenant.org/faq
[translations]: https://www.contributor-covenant.org/translations
================================================
FILE: CONTRIBUTING.md
================================================
# Noodle's contributing guidelines
Thank you for your interest in contributing to our project! Any contribution is highly appreciated and will be reflected on our project ✨
First things first, make sure you read our [Code of Conduct](./CODE_OF_CONDUCT.md) to keep our community approachable and respectable.
In this guide, you will get an overview of the project structure and setup, as well as the workflow from opening an issue, creating a PR, reviewing, and merging the PR.
## Table of contents
- [Noodle's contributing guidelines](#noodles-contributing-guidelines)
- [Table of contents](#table-of-contents)
- [New contributor guide](#new-contributor-guide)
- [Getting your foot in](#getting-your-foot-in)
- [Some simple rules](#some-simple-rules)
- [The tech stack](#the-tech-stack)
- [Getting stuff running](#getting-stuff-running)
- [Cloning the repo](#cloning-the-repo)
- [Bun](#bun)
- [Installing dependencies](#installing-dependencies)
- [Environment Variables](#environment-variables)
- [Running stuff](#running-stuff)
- [Closing notes](#closing-notes)
## New contributor guide
Here are some resources to help you get started with open source contributions:
- [Finding ways to contribute to open source on GitHub](https://docs.github.com/en/get-started/exploring-projects-on-github/finding-ways-to-contribute-to-open-source-on-github)
- [Set up Git](https://docs.github.com/en/get-started/quickstart/set-up-git)
- [GitHub flow](https://docs.github.com/en/get-started/quickstart/github-flow)
- [Collaborating with pull requests](https://docs.github.com/en/github/collaborating-with-pull-requests)
## Getting your foot in
Our preferred way of providing the opportunity for people to contribute to Noodle is through a process that starts with creating a new issue, the summary of the workflow that you can expect and should adhere to is the following:
- You see an area of improvement in the code base, this could be a fix, feature, refactoring...etc
- Create an [issue](https://github.com/noodle-run/noodle/issues) on our Github repository.
- Wait until a team member discusses the issue with you, and if both parties are in agreement, you can start working on the issue.
- Once work has started, you can create a draft pull request and remember to link your pull request with the issue.
- Once the work is complete, change the status of the pull request to ready for review.
- We will review the pull request and if all is good, congratulations! 🥳 you are now a Noodle contributor!
- If not, we will explain the changes that need to be made for the pull request to be merged or why it can't be merged.
If you would like to be more involved in the development of Noodle, we would like to invite you to our [Discord Server](https://discord.gg/SERySfj8Eg) where we can have a chat together and get you involved in the project!
### Some simple rules
- Don't work on an issue that is already being worked on by someone else.
- Don't work on something without getting a team member's approval, this is to not waste your time by making you work on something that won't be merged.
- Don't demand for your pull request to be approved and merged.
- Be nice to everyone involved, we are aiming to create a positive community around collaborating and contributing towards Noodle's development.
## The tech stack
The Runtime:
- [Bun](https://bun.sh/)
The Tech Stack:
- [Next.js App Router](https://nextjs.org/)
- [TailwindCSS](https://tailwindcss.com/)
- [tRPC](https://trpc.io)
- [Drizzle ORM](https://orm.drizzle.team/)
- [ShadCN UI](https://ui.shadcn.com)
- [NeonDB](https://neon.tech)
- [Clerk Auth](https://clerk.dev/)
- [Upstash](https://upstash.com)
- [Resend](https://resend.com)
Development stuff:
- [ESLint](https://eslint.org/)
- [Prettier](https://prettier.io)
There are a lot of other technologies being used in this project, however these are the most important and influential bits of it.
## Getting stuff running
### Cloning the repo
To clone the repo, you firstly need to [fork](https://github.com/noodle-run/noodle/fork) it, and then clone your copy of noodle locally.
```bash
git clone https://github.com/<your-gh-username>/noodle.git
```
### Bun
Bun is used as the package manager of Noodle, with Bun, you don't need to have NodeJS installed at all on your system to be able to run Noodle. The only tool you need to install dependencies & run Noodle is Bun!
To install bun, head over to [their website](https://bun.sh/) which will tell you how to get it installed on your system.
To check that you have Bun installed, simply run the following command:
```bash
bun --version
```
If this commands outputs a version number, you're all good to go.
### Installing dependencies
With bun installed on your machine, the next step would be to install the dependencies that Noodle relies upon to work, to do this, run the following command:
```bash
bun install
```
### Environment Variables
Now that Bun & dependencies has been installed, it's time to configure your environment variables so that the project works as expected:
1. Duplicate the `.env.example` file as just `.env`
2. Populate the values with your own, you will need to sign up to some services in the process.
You can checkout which variables are needed and which are optional in the `src/env.ts` file.
### Running stuff
```bash
# Run the project's dev server
bun dev
# Build the project
bun run build
# Run the built project in production mode
bun start
# Run the typecheck script
bun typecheck
# Lint using ESLint
bun lint
# Format using Prettier
bun format
```
## Closing notes
Again, thank you so much for your interest in contributing to Noodle, we really appreciate it, and if there is anything we can do to help your journey, make sure to join our [Discord Server](https://discord.gg/SERySfj8Eg).
================================================
FILE: LICENSE
================================================
GNU AFFERO GENERAL PUBLIC LICENSE
Version 3, 19 November 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU Affero General Public License is a free, copyleft license for
software and other kinds of works, specifically designed to ensure
cooperation with the community in the case of network server software.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
our General Public Licenses are intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
Developers that use our General Public Licenses protect your rights
with two steps: (1) assert copyright on the software, and (2) offer
you this License which gives you legal permission to copy, distribute
and/or modify the software.
A secondary benefit of defending all users' freedom is that
improvements made in alternate versions of the program, if they
receive widespread use, become available for other developers to
incorporate. Many developers of free software are heartened and
encouraged by the resulting cooperation. However, in the case of
software used on network servers, this result may fail to come about.
The GNU General Public License permits making a modified version and
letting the public access it on a server without ever releasing its
source code to the public.
The GNU Affero General Public License is designed specifically to
ensure that, in such cases, the modified source code becomes available
to the community. It requires the operator of a network server to
provide the source code of the modified version running there to the
users of that server. Therefore, public use of a modified version, on
a publicly accessible server, gives the public access to the source
code of the modified version.
An older license, called the Affero General Public License and
published by Affero, was designed to accomplish similar goals. This is
a different license, not a version of the Affero GPL, but Affero has
released a new version of the Affero GPL which permits relicensing under
this license.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU Affero General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Remote Network Interaction; Use with the GNU General Public License.
Notwithstanding any other provision of this License, if you modify the
Program, your modified version must prominently offer all users
interacting with it remotely through a computer network (if your version
supports such interaction) an opportunity to receive the Corresponding
Source of your version by providing access to the Corresponding Source
from a network server at no charge, through some standard or customary
means of facilitating copying of software. This Corresponding Source
shall include the Corresponding Source for any work covered by version 3
of the GNU General Public License that is incorporated pursuant to the
following paragraph.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the work with which it is combined will remain governed by version
3 of the GNU General Public License.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU Affero General Public License from time to time. Such new versions
will be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU Affero General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU Affero General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU Affero General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
Noodle - A productivity web application for students including many tools they need to be productive.
Copyright (C) 2024 NOODLE RUN LTD.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If your software can interact with users remotely through a computer
network, you should also make sure that it provides a way for users to
get its source. For example, if your program is a web application, its
interface could display a "Source" link that leads users to an archive
of the code. There are many ways you could offer source, and different
solutions will be better for different programs; see section 13 for the
specific requirements.
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU AGPL, see
<https://www.gnu.org/licenses/>.
================================================
FILE: README.md
================================================
<div align="center">
<img src="https://github.com/noodle-run/noodle/blob/main/public/logo.svg?raw=true" alt="Noodle logo" width="75">
<h1>Noodle <br> Rethinking Student Productivity</h1>
<br>
</div>
> **Warning**
> This is a work-in-progress and not the finished product.
>
> Noodle is still in active development towards a minimal viable product (MVP).
>
> Follow me on twitter [@ixahmedxii](https://twitter.com/ixahmedxii) for updates.

<p align="center" style="color:dodgerblue;"><strong>⚠️ This is a UI design mockup of what the platform will look like, it is not the current state of the project.</strong></p>
## Purpose
Noodle as an idea came from the struggles that I faced during my university years. I was using multiple apps to try and stay on track with my studies, and I thought to myself, why is there no singular app that can do everything a student needs to stay on track with their studies? Like a GitHub but for students.
## Planned MVP Features
- ✍️ Note Taking
- 📚 Flashcards
The flashcards will be generated from the notes that you take, and you will be able to quiz yourself on them.
## Future Features
- 📅 Calendar
- 📝 Task management
- 📊 Grade tracking
Feel free to suggest more features by opening an issue, or join our [Discord server](https://discord.gg/ewKmQd8kYm) to discuss it with the community.
## Star History
[](https://star-history.com/#noodle-run/noodle#gh-light-mode-only)
[](https://star-history.com/#noodle-run/noodle#gh-dark-mode-only)
## Contributing
If you would like to contribute to Noodle, please read the [CONTRIBUTING.md](./CONTRIBUTING.md) file to get started.
## License
Noodle is open source and available under the [AGPL-3.0-or-later](./LICENSE) license.
================================================
FILE: SECURITY.md
================================================
# Noodle Security
## Reporting a Vulnerability
To report a security issue, please [open a security advisory](https://github.com/noodle-run/noodle/security/advisories/new) on GitHub with a detailed description of the issue, the steps you took to create the issue, affected versions, and, if known, mitigations for the issue.
Please remember to include everything required for us to reproduce the issue, including but not limited to a publicly accessible git repository and/or StackBlitz repository.
================================================
FILE: cspell.config.yaml
================================================
$schema: https://raw.githubusercontent.com/streetsidesoftware/cspell/main/cspell.schema.json
version: '0.2'
ignorePaths:
- node_modules
- bun.lockb
- .tsbuildinfo
- .gitignore
- .next
- drizzle
- '**/*.svg'
- .vscode/extensions.json
- public
- tsconfig.tsbuildinfo
- branch_out
words:
- activecampaign
- aeiou
- Arcjet
- asana
- autopilotmail
- autoresponder
- bcdfghj
- bigcommerce
- callees
- classname
- clsx
- commitlint
- compat
- constantcontact
- customerservice
- esbenp
- facebookmail
- freshdesk
- frontmatter
- healthcheck
- helpdesk
- helpscout
- hookform
- hubspot
- ianvs
- ixahmedxi
- ixahmedxii
- jiti
- lockb
- lucide
- mailchimp
- mailgun
- marketo
- mitigations
- neondatabase
- nextjs
- noreplys
- packagejson
- paralleldrive
- pinterest
- pipedrive
- Posthog
- postmarkapp
- ratelimit
- redditmail
- Registrator
- sendgrid
- sendinblue
- serviceworker
- Shadcn
- Signin
- Signup
- Sonner
- sslmode
- superjson
- tailwindcss
- tanstack
- tawk
- timeago
- Todos
- trpc
- tsbuildinfo
- tseslint
- typecheck
- Uploadthing
- Upstash
- usehooks
================================================
FILE: drizzle/0000_funny_johnny_blaze.sql
================================================
CREATE TABLE IF NOT EXISTS "early_access" (
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
"name" text NOT NULL,
"email" text NOT NULL,
"reason" text NOT NULL,
"approved" boolean DEFAULT false,
"created_at" timestamp (3) DEFAULT now(),
"invitation_sent_at" timestamp (3),
CONSTRAINT "early_access_email_unique" UNIQUE("email")
);
================================================
FILE: drizzle/0001_minor_warlock.sql
================================================
CREATE TABLE IF NOT EXISTS "modules" (
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
"user_id" text NOT NULL,
"name" text NOT NULL,
"description" text NOT NULL,
"code" text NOT NULL,
"icon" text DEFAULT 'default' NOT NULL,
"color" text DEFAULT 'default' NOT NULL,
"archived" boolean DEFAULT false NOT NULL,
"credits" integer DEFAULT 0 NOT NULL,
"created_at" timestamp DEFAULT now() NOT NULL,
"modified_at" timestamp DEFAULT now() NOT NULL,
"last_visited" timestamp DEFAULT now() NOT NULL,
CONSTRAINT "modules_id_unique" UNIQUE("id")
);
================================================
FILE: drizzle/0002_complex_sally_floyd.sql
================================================
ALTER TABLE "modules" ALTER COLUMN "description" DROP NOT NULL;
================================================
FILE: drizzle/meta/0000_snapshot.json
================================================
{
"version": "7",
"dialect": "postgresql",
"tables": {
"public.early_access": {
"name": "early_access",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "uuid",
"primaryKey": true,
"notNull": true,
"default": "gen_random_uuid()"
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true
},
"email": {
"name": "email",
"type": "text",
"primaryKey": false,
"notNull": true
},
"reason": {
"name": "reason",
"type": "text",
"primaryKey": false,
"notNull": true
},
"approved": {
"name": "approved",
"type": "boolean",
"primaryKey": false,
"notNull": false,
"default": false
},
"created_at": {
"name": "created_at",
"type": "timestamp (3)",
"primaryKey": false,
"notNull": false,
"default": "now()"
},
"invitation_sent_at": {
"name": "invitation_sent_at",
"type": "timestamp (3)",
"primaryKey": false,
"notNull": false
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {
"early_access_email_unique": {
"name": "early_access_email_unique",
"columns": [
"email"
],
"nullsNotDistinct": false
}
}
}
},
"enums": {},
"schemas": {},
"_meta": {
"schemas": {},
"tables": {},
"columns": {}
},
"id": "b304d26a-1927-40c9-9067-57935d6d9ab3",
"prevId": "00000000-0000-0000-0000-000000000000"
}
================================================
FILE: drizzle/meta/0001_snapshot.json
================================================
{
"id": "e2f7138b-3bc5-4e5c-8e9f-df04364cddcb",
"prevId": "b304d26a-1927-40c9-9067-57935d6d9ab3",
"version": "7",
"dialect": "postgresql",
"tables": {
"public.early_access": {
"name": "early_access",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "uuid",
"primaryKey": true,
"notNull": true,
"default": "gen_random_uuid()"
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true
},
"email": {
"name": "email",
"type": "text",
"primaryKey": false,
"notNull": true
},
"reason": {
"name": "reason",
"type": "text",
"primaryKey": false,
"notNull": true
},
"approved": {
"name": "approved",
"type": "boolean",
"primaryKey": false,
"notNull": false,
"default": false
},
"created_at": {
"name": "created_at",
"type": "timestamp (3)",
"primaryKey": false,
"notNull": false,
"default": "now()"
},
"invitation_sent_at": {
"name": "invitation_sent_at",
"type": "timestamp (3)",
"primaryKey": false,
"notNull": false
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {
"early_access_email_unique": {
"name": "early_access_email_unique",
"nullsNotDistinct": false,
"columns": [
"email"
]
}
}
},
"public.modules": {
"name": "modules",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "uuid",
"primaryKey": true,
"notNull": true,
"default": "gen_random_uuid()"
},
"user_id": {
"name": "user_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true
},
"description": {
"name": "description",
"type": "text",
"primaryKey": false,
"notNull": true
},
"code": {
"name": "code",
"type": "text",
"primaryKey": false,
"notNull": true
},
"icon": {
"name": "icon",
"type": "text",
"primaryKey": false,
"notNull": true,
"default": "'default'"
},
"color": {
"name": "color",
"type": "text",
"primaryKey": false,
"notNull": true,
"default": "'default'"
},
"archived": {
"name": "archived",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"credits": {
"name": "credits",
"type": "integer",
"primaryKey": false,
"notNull": true,
"default": 0
},
"created_at": {
"name": "created_at",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"modified_at": {
"name": "modified_at",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"last_visited": {
"name": "last_visited",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {
"modules_id_unique": {
"name": "modules_id_unique",
"nullsNotDistinct": false,
"columns": [
"id"
]
}
}
}
},
"enums": {},
"schemas": {},
"sequences": {},
"_meta": {
"columns": {},
"schemas": {},
"tables": {}
}
}
================================================
FILE: drizzle/meta/0002_snapshot.json
================================================
{
"id": "6f3e4fea-8b33-40d5-a9cd-1c4bbb28d564",
"prevId": "e2f7138b-3bc5-4e5c-8e9f-df04364cddcb",
"version": "7",
"dialect": "postgresql",
"tables": {
"public.early_access": {
"name": "early_access",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "uuid",
"primaryKey": true,
"notNull": true,
"default": "gen_random_uuid()"
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true
},
"email": {
"name": "email",
"type": "text",
"primaryKey": false,
"notNull": true
},
"reason": {
"name": "reason",
"type": "text",
"primaryKey": false,
"notNull": true
},
"approved": {
"name": "approved",
"type": "boolean",
"primaryKey": false,
"notNull": false,
"default": false
},
"created_at": {
"name": "created_at",
"type": "timestamp (3)",
"primaryKey": false,
"notNull": false,
"default": "now()"
},
"invitation_sent_at": {
"name": "invitation_sent_at",
"type": "timestamp (3)",
"primaryKey": false,
"notNull": false
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {
"early_access_email_unique": {
"name": "early_access_email_unique",
"nullsNotDistinct": false,
"columns": [
"email"
]
}
}
},
"public.modules": {
"name": "modules",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "uuid",
"primaryKey": true,
"notNull": true,
"default": "gen_random_uuid()"
},
"user_id": {
"name": "user_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true
},
"description": {
"name": "description",
"type": "text",
"primaryKey": false,
"notNull": false
},
"code": {
"name": "code",
"type": "text",
"primaryKey": false,
"notNull": true
},
"icon": {
"name": "icon",
"type": "text",
"primaryKey": false,
"notNull": true,
"default": "'default'"
},
"color": {
"name": "color",
"type": "text",
"primaryKey": false,
"notNull": true,
"default": "'default'"
},
"archived": {
"name": "archived",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": false
},
"credits": {
"name": "credits",
"type": "integer",
"primaryKey": false,
"notNull": true,
"default": 0
},
"created_at": {
"name": "created_at",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"modified_at": {
"name": "modified_at",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"last_visited": {
"name": "last_visited",
"type": "timestamp",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {
"modules_id_unique": {
"name": "modules_id_unique",
"nullsNotDistinct": false,
"columns": [
"id"
]
}
}
}
},
"enums": {},
"schemas": {},
"sequences": {},
"_meta": {
"columns": {},
"schemas": {},
"tables": {}
}
}
================================================
FILE: drizzle/meta/_journal.json
================================================
{
"version": "6",
"dialect": "postgresql",
"entries": [
{
"idx": 0,
"version": "6",
"when": 1716742272276,
"tag": "0000_funny_johnny_blaze",
"breakpoints": true
},
{
"idx": 1,
"version": "7",
"when": 1722099574439,
"tag": "0001_minor_warlock",
"breakpoints": true
},
{
"idx": 2,
"version": "7",
"when": 1724179669909,
"tag": "0002_complex_sally_floyd",
"breakpoints": true
}
]
}
================================================
FILE: drizzle.config.ts
================================================
import type { Config } from 'drizzle-kit';
import { env } from '@/env';
export default {
dialect: 'postgresql',
schema: './src/db/schema/index.ts',
out: './drizzle',
strict: true,
verbose: true,
dbCredentials: {
url: env.DATABASE_URL,
},
} satisfies Config;
================================================
FILE: eslint.config.js
================================================
import path from 'path';
import { fileURLToPath } from 'url';
import comments from '@eslint-community/eslint-plugin-eslint-comments/configs';
import { fixupConfigRules } from '@eslint/compat';
import { FlatCompat } from '@eslint/eslintrc';
import js from '@eslint/js';
import eslintConfigPrettier from 'eslint-config-prettier';
import jsdoc from 'eslint-plugin-jsdoc';
import * as regexpPlugin from 'eslint-plugin-regexp';
import pluginSecurity from 'eslint-plugin-security';
import tseslint from 'typescript-eslint';
import globals from 'globals';
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
resolvePluginsRelativeTo: __dirname,
});
export default tseslint.config(
{
ignores: ['.next'],
},
// Base configurations
js.configs.recommended,
...tseslint.configs.strictTypeChecked,
...tseslint.configs.stylisticTypeChecked,
// Next.js / React
...fixupConfigRules(compat.extends('plugin:@next/next/recommended')),
...fixupConfigRules(compat.extends('plugin:react/recommended')),
...fixupConfigRules(compat.extends('plugin:react-hooks/recommended')),
...fixupConfigRules(compat.extends('plugin:jsx-a11y/strict')),
// Tailwind CSS
...fixupConfigRules(compat.extends('plugin:tailwindcss/recommended')),
// Other plugins
comments.recommended,
regexpPlugin.configs['flat/recommended'],
pluginSecurity.configs.recommended,
eslintConfigPrettier,
// JSDoc plugin only for TypeScript files
{
files: ['**/*.{ts,tsx}'],
extends: [jsdoc.configs['flat/recommended-typescript-error']],
},
// Settings and rule overrides
{
linterOptions: {
reportUnusedDisableDirectives: true,
},
languageOptions: {
parserOptions: {
projectService: true,
tsconfigRootDir: __dirname,
},
globals: {
...globals.node,
...globals.browser,
...globals.es2024,
},
},
settings: {
react: {
version: 'detect',
},
tailwindcss: {
callees: ['classnames', 'clsx', 'ctl', 'cn', 'cva'],
},
},
rules: {
'@typescript-eslint/no-unused-vars': [
'error',
{ argsIgnorePattern: '^_', varsIgnorePattern: '^_' },
],
'@typescript-eslint/consistent-type-imports': [
'warn',
{ prefer: 'type-imports', fixStyle: 'separate-type-imports' },
],
'@typescript-eslint/no-misused-promises': [
'error',
{ checksVoidReturn: { attributes: false } },
],
'@typescript-eslint/non-nullable-type-assertion-style': 'off',
'@typescript-eslint/dot-notation': 'off',
'@typescript-eslint/no-unnecessary-condition': [
'error',
{
allowConstantLoopConditions: true,
},
],
'react/react-in-jsx-scope': 'off',
'react/prop-types': 'off',
// security
'security/detect-non-literal-fs-filename': 'off',
// we're not building a library here
'jsdoc/require-jsdoc': 'off',
},
},
);
================================================
FILE: eslint.d.ts
================================================
/**
* Since ESLint and many plugins are written in JavaScript, we need to provide
* or change some types to make them work with TypeScript.
*/
// From: https://github.com/t3-oss/create-t3-turbo/blob/main/tooling/eslint/types.d.ts
declare module '@eslint/js' {
import type { Linter } from 'eslint';
export const configs: {
readonly recommended: { readonly rules: Readonly<Linter.RulesRecord> };
readonly all: { readonly rules: Readonly<Linter.RulesRecord> };
};
}
declare module '@eslint-community/eslint-plugin-eslint-comments/configs' {
import type { Linter } from 'eslint';
export const recommended: {
rules: Linter.RulesRecord;
};
}
declare module '@eslint/eslintrc' {
import type { Linter } from 'eslint';
export class FlatCompat {
constructor({
baseDirectory,
resolvePluginsRelativeTo,
}: {
baseDirectory: string;
resolvePluginsRelativeTo: string;
});
extends(extendsValue: string): Linter.Config & {
[Symbol.iterator]: () => IterableIterator<Linter.Config>;
};
}
}
declare module '@eslint/compat' {
import type { Linter } from 'eslint';
import type { ConfigWithExtends } from 'typescript-eslint';
export const fixupConfigRules: (
config: string | Linter.Config,
) => ConfigWithExtends[];
}
declare module 'eslint-plugin-regexp' {
import type { Linter } from 'eslint';
import type { ConfigWithExtends } from 'typescript-eslint';
export const configs: {
'flat/recommended': {
[Symbol.iterator]: () => IterableIterator<ConfigWithExtends>;
rules: Linter.RulesRecord;
};
'flat/all': {
[Symbol.iterator]: () => IterableIterator<ConfigWithExtends>;
rules: Linter.RulesRecord;
};
};
}
declare module 'eslint-plugin-security' {
import type { Linter } from 'eslint';
import type { ConfigWithExtends } from 'typescript-eslint';
export const configs: {
recommended: {
[Symbol.iterator]: () => IterableIterator<ConfigWithExtends>;
rules: Linter.RulesRecord;
};
};
}
================================================
FILE: next.config.js
================================================
import { fileURLToPath } from 'node:url';
import { createJiti } from 'jiti';
const jiti = createJiti(fileURLToPath(import.meta.url));
await jiti.import('./src/env');
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
transpilePackages: ['next-mdx-remote', 'lucide-react'],
// We run ESLint and TypeScript separately in the CI pipeline
eslint: {
ignoreDuringBuilds: true,
},
typescript: {
ignoreBuildErrors: true,
},
logging: {
fetches: {
fullUrl: true,
},
},
};
export default nextConfig;
================================================
FILE: package.json
================================================
{
"name": "noodle",
"version": "0.1.0",
"private": true,
"description": "Rethinking Student Productivity",
"license": "AGPL-3.0-or-later",
"author": "NOODLE RUN LTD.",
"type": "module",
"scripts": {
"build": "next build",
"clean": "bun run rm -rf .next node_modules *.tsbuildinfo next-env.d.ts",
"commit": "git-cz",
"db:check": "drizzle-kit check",
"db:generate": "drizzle-kit generate",
"db:migrate": "drizzle-kit migrate",
"db:migrate:drop": "drizzle-kit migrate:drop",
"db:pull": "drizzle-kit introspect",
"db:push": "drizzle-kit push",
"db:studio": "drizzle-kit studio",
"db:up": "drizzle-kit up",
"dev": "next dev --turbo",
"email:dev": "SKIP_ENV_VALIDATION=true email dev --port 3001 --dir src/emails/templates",
"format": "pnpm format:write",
"format:check": "prettier \"**/*\" --ignore-unknown --list-different",
"format:write": "prettier \"**/*\" --ignore-unknown --list-different --write",
"lint": "bun lint:js && bun lint:md && bun lint:spell",
"lint:js": "eslint . --max-warnings 0",
"lint:md": "markdownlint \"**/*.md\" \".github/**/*.md\" --ignore node_modules",
"lint:spell": "cspell \"**/*\" --no-summary --no-progress",
"prepare": "husky",
"start": "next start",
"typecheck": "tsc"
},
"commitlint": {
"extends": [
"@commitlint/config-conventional"
]
},
"lint-staged": {
"*": [
"cspell --no-must-find-files",
"prettier --list-different"
],
"**/*.{ts,tsx,js,jsx,cjs,mjs}": [
"eslint"
],
"**/*.{md,mdx}": [
"markdownlint"
]
},
"config": {
"commitizen": {
"path": "@commitlint/cz-commitlint"
}
},
"dependencies": {
"@clerk/nextjs": "^5.7.3",
"@clerk/themes": "^2.1.36",
"@hookform/resolvers": "^3.9.0",
"@neondatabase/serverless": "^0.10.1",
"@paralleldrive/cuid2": "^2.2.2",
"@radix-ui/colors": "^3.0.0",
"@radix-ui/react-checkbox": "^1.1.2",
"@radix-ui/react-dropdown-menu": "^2.1.2",
"@radix-ui/react-label": "^2.1.0",
"@radix-ui/react-navigation-menu": "^1.2.1",
"@radix-ui/react-popover": "^1.1.2",
"@radix-ui/react-scroll-area": "^1.2.0",
"@radix-ui/react-select": "^2.1.2",
"@radix-ui/react-separator": "^1.1.0",
"@radix-ui/react-slot": "^1.1.0",
"@radix-ui/react-tabs": "^1.1.1",
"@react-email/components": "^0.0.25",
"@t3-oss/env-nextjs": "^0.11.1",
"@tanstack/react-query": "^5.59.15",
"@trpc/client": "next",
"@trpc/react-query": "next",
"@trpc/server": "next",
"@upstash/redis": "^1.34.3",
"@vercel/analytics": "^1.3.1",
"@vercel/speed-insights": "^1.0.12",
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.1",
"color": "^4.2.3",
"drizzle-orm": "^0.35.1",
"drizzle-zod": "^0.5.1",
"framer-motion": "^11.11.9",
"geist": "^1.3.1",
"jiti": "^2.3.3",
"lucide-react": "^0.453.0",
"next": "14.2.15",
"next-mdx-remote": "^5.0.0",
"next-themes": "^0.3.0",
"react": "^18.3.1",
"react-animate-height": "^3.2.3",
"react-dom": "^18.3.1",
"react-email": "^3.0.1",
"react-hook-form": "^7.53.0",
"resend": "^4.0.0",
"server-only": "^0.0.1",
"slugify": "^1.6.6",
"sonner": "^1.5.0",
"superjson": "^2.2.1",
"tailwind-merge": "^2.5.4",
"timeago.js": "^4.0.2",
"use-resize-observer": "^9.1.0",
"usehooks-ts": "^3.1.0",
"zod": "^3.23.8"
},
"devDependencies": {
"@changesets/cli": "^2.27.9",
"@commitlint/cli": "^19.5.0",
"@commitlint/config-conventional": "^19.5.0",
"@commitlint/cz-commitlint": "^19.5.0",
"@eslint-community/eslint-plugin-eslint-comments": "^4.4.0",
"@eslint/compat": "^1.2.0",
"@eslint/eslintrc": "^3.1.0",
"@eslint/js": "^9.12.0",
"@happy-dom/global-registrator": "^15.7.4",
"@ianvs/prettier-plugin-sort-imports": "^4.3.1",
"@next/eslint-plugin-next": "^14.2.15",
"@tailwindcss/aspect-ratio": "^0.4.2",
"@tailwindcss/container-queries": "^0.1.1",
"@tailwindcss/typography": "^0.5.15",
"@total-typescript/ts-reset": "^0.6.1",
"@types/bun": "^1.1.11",
"@types/color": "^3.0.6",
"@types/eslint": "^9.6.1",
"@types/eslint-config-prettier": "^6.11.3",
"@types/node": "^22.7.6",
"@types/react": "^18.3.11",
"@types/react-dom": "^18.3.1",
"commitizen": "^4.3.1",
"cspell": "^8.15.3",
"drizzle-kit": "^0.26.2",
"eslint": "^9.12.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-jsdoc": "^50.4.1",
"eslint-plugin-jsx-a11y": "^6.10.0",
"eslint-plugin-react": "^7.37.1",
"eslint-plugin-react-hooks": "^5.0.0",
"eslint-plugin-regexp": "^2.6.0",
"eslint-plugin-security": "^3.0.1",
"eslint-plugin-tailwindcss": "^3.17.5",
"globals": "^15.11.0",
"husky": "^9.1.6",
"lint-staged": "^15.2.10",
"markdownlint": "^0.35.0",
"markdownlint-cli": "^0.42.0",
"postcss": "^8.4.47",
"prettier": "^3.3.3",
"prettier-plugin-curly": "^0.3.1",
"prettier-plugin-packagejson": "^2.5.3",
"tailwindcss": "^3.4.14",
"tailwindcss-animate": "^1.0.7",
"typescript": "^5.6.3",
"typescript-eslint": "^8.9.0"
},
"trustedDependencies": [
"@clerk/shared",
"@swc/core",
"es5-ext",
"esbuild"
]
}
================================================
FILE: postcss.config.js
================================================
/** @type {import('postcss-load-config').Config} */
const config = {
plugins: {
tailwindcss: {},
},
};
export default config;
================================================
FILE: prettier.config.js
================================================
/** @type {import('@ianvs/prettier-plugin-sort-imports').PrettierConfig} */
const config = {
semi: true,
singleQuote: true,
trailingComma: 'all',
printWidth: 80,
plugins: [
'@ianvs/prettier-plugin-sort-imports',
'prettier-plugin-packagejson',
'prettier-plugin-curly',
],
importOrder: [
'',
'^react$',
'^next(-[^/]+)?(/.*)?$',
'',
'<TYPES>',
'<TYPES>^[.]',
'',
'<BUILTIN_MODULES>',
'',
'<THIRD_PARTY_MODULES>',
'',
'^@/(.*)$',
'',
'^[./]',
'',
'^(?!.*[.]css$)[./].*$',
'.css$',
],
importOrderTypeScriptVersion: '5.4.5',
};
export default config;
================================================
FILE: public/.well-known/security.txt
================================================
Contact: https://github.com/noodle-run/noodle/security/advisories/new
Expires: 2025-12-31T23:00:00.000Z
Acknowledgments: https://github.com/noodle-run/noodle/security
Preferred-Languages: en
Canonical: https://noodle.run/.well-known/security.txt
Policy: https://github.com/noodle-run/noodle/blob/main/SECURITY.md
================================================
FILE: public/browserconfig.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<browserconfig>
<msapplication>
<tile>
<square150x150logo src="/mstile-150x150.png"/>
<TileColor>#111111</TileColor>
</tile>
</msapplication>
</browserconfig>
================================================
FILE: reset.d.ts
================================================
import '@total-typescript/ts-reset';
================================================
FILE: src/app/(dashboard)/(auth)/sign-in/[[...sign-in]]/page.tsx
================================================
import { SignIn } from '@clerk/nextjs';
/**
* The Signin page component.
* @returns The signin page.
*/
export default function Page() {
return (
<main className="container mx-auto flex min-h-screen items-center justify-center">
<SignIn />
</main>
);
}
================================================
FILE: src/app/(dashboard)/(auth)/sign-up/[[...sign-in]]/page.tsx
================================================
import { SignUp } from '@clerk/nextjs';
/**
* The Signup page component.
* @returns The signup page.
*/
export default function Page() {
return (
<main className="container mx-auto flex min-h-screen items-center justify-center">
<SignUp />
</main>
);
}
================================================
FILE: src/app/(dashboard)/app/_components/active-button.tsx
================================================
'use client';
import { cn } from '@/utils/cn';
import { Button } from '@/primitives/button';
import Link from 'next/link';
import { usePathname } from 'next/navigation';
import type { ReactNode } from 'react';
interface Props {
href: string;
label: string;
icon: ReactNode;
}
export function ActiveButton({ href, label, icon }: Props) {
const pathname = usePathname();
return (
<Button
variant="ghost"
className={cn(
'justify-start gap-3 font-normal',
pathname === href && 'text-foreground',
)}
asChild
>
<Link href={href}>
{icon}
<span className="w-full truncate">{label}</span>
</Link>
</Button>
);
}
================================================
FILE: src/app/(dashboard)/app/_components/create-module-popover.tsx
================================================
'use client';
import { Button } from '@/primitives/button';
import { Input } from '@/primitives/input';
import { Popover, PopoverContent, PopoverTrigger } from '@/primitives/popover';
import { ResizablePanel } from '@/primitives/resizable-panel';
import { Separator } from '@/primitives/separator';
import { ChevronRightIcon, PlusIcon } from 'lucide-react';
import { zodResolver } from '@hookform/resolvers/zod';
import { useForm } from 'react-hook-form';
import { useState } from 'react';
import { z } from 'zod';
import {
Form,
FormControl,
FormField,
FormItem,
FormLabel,
FormMessage,
} from '@/primitives/form';
import { Label } from '@/primitives/label';
import type { IconNames } from '@/primitives/icon';
import { Icon, iconNames } from '@/primitives/icon';
import { grayDark } from '@radix-ui/colors';
import { colorChoices } from '../lib/color-choices';
import { ScrollArea } from '@/primitives/scroll-area';
import { api } from '@/lib/trpc/react';
import { useRouter } from 'next/navigation';
import { toast } from 'sonner';
import { Textarea } from '@/primitives/textarea';
import { useDebounceValue } from 'usehooks-ts';
interface StepHeadingProps {
title: string;
description: string;
}
const StepHeading = ({ title, description }: StepHeadingProps) => {
return (
<div className="flex flex-col gap-1.5">
<div className="font-medium text-foreground">{title}</div>
<div className="max-w-[40ch] text-sm text-gray-foreground-muted">
{description}
</div>
<Separator className="my-3" />
</div>
);
};
interface IconPickerProps {
iconOnClickHandler: (icon: IconNames) => void;
}
export function IconPicker({ iconOnClickHandler }: IconPickerProps) {
const [iconSearchTerm, setIconSearchTerm] = useDebounceValue('', 200);
return (
<>
<Input
type="text"
placeholder="Search icons..."
onChange={(e) => {
setIconSearchTerm(e.target.value);
}}
/>
<ScrollArea className="mt-2 h-[300px]">
<div className="mt-2 grid grid-cols-6 gap-2">
{iconNames
.filter((icon) =>
iconSearchTerm === ''
? true
: icon.toLowerCase().includes(iconSearchTerm.toLowerCase()),
)
.map((icon) => (
<button
type="button"
key={icon}
className="grid place-items-center rounded-lg p-2 text-foreground transition-colors hover:bg-gray-element"
onClick={() => {
iconOnClickHandler(icon);
}}
>
<Icon name={icon} size={20} strokeWidth={1.5} />
</button>
))}
</div>
</ScrollArea>
</>
);
}
const formSchema = z.object({
moduleName: z.string().min(2),
description: z.string().optional(),
code: z.string().min(2),
credits: z.string(),
icon: z.string().min(1),
color: z.string().min(1),
});
export function CreateModulePopover() {
const [popoverOpen, setPopoverOpen] = useState(false);
const [step, setStep] = useState<1 | 2 | 3>(1);
const router = useRouter();
const mutation = api.modules.create.useMutation({
onError(error) {
toast.error(error.message);
},
onSuccess() {
router.refresh();
},
});
const form = useForm<z.infer<typeof formSchema>>({
resolver: zodResolver(formSchema),
defaultValues: {
moduleName: '',
code: '',
credits: '0',
icon: 'default',
color: 'default',
},
});
async function onSubmit(values: z.infer<typeof formSchema>) {
await mutation.mutateAsync({
...values,
credits: parseInt(values.credits),
name: values.moduleName,
});
form.reset({
moduleName: '',
code: '',
credits: '0',
icon: 'default',
color: 'default',
});
}
return (
<Popover
open={popoverOpen}
onOpenChange={() => {
setPopoverOpen((prev) => !prev);
setStep(1);
}}
>
<PopoverTrigger asChild>
<Button variant="ghost" size="icon" className="size-8">
<PlusIcon size={15} strokeWidth={1.5} />
</Button>
</PopoverTrigger>
<PopoverContent align="start" side="right" className="w-[328px]">
<ResizablePanel>
<Form {...form}>
<form onSubmit={form.handleSubmit(onSubmit)} className="p-4">
{step === 1 && (
<div>
<StepHeading
title="Create a new module"
description="A module is like a hub for a subject's study material such as notes, flashcards...etc"
/>
<div className="space-y-2">
<FormField
control={form.control}
name="moduleName"
render={({ field }) => (
<FormItem>
<FormLabel className="text-xs text-foreground">
Module Name
</FormLabel>
<FormControl>
<Input
type="text"
placeholder="Artificial Intelligence"
{...field}
/>
</FormControl>
<FormMessage />
</FormItem>
)}
/>
<FormField
control={form.control}
name="description"
render={({ field }) => (
<FormItem>
<FormLabel className="text-xs text-foreground">
Description (optional)
</FormLabel>
<FormControl>
<Textarea
className="resize-none"
placeholder="Type here..."
{...field}
/>
</FormControl>
<FormMessage />
</FormItem>
)}
/>
<div className="flex items-start justify-between gap-3">
<FormField
control={form.control}
name="code"
render={({ field }) => (
<FormItem>
<FormLabel className="text-xs text-foreground">
Code
</FormLabel>
<FormControl>
<Input
type="text"
placeholder="AI001"
{...field}
/>
</FormControl>
<FormMessage />
</FormItem>
)}
/>
<FormField
control={form.control}
name="credits"
render={({ field }) => (
<FormItem>
<FormLabel className="text-xs text-foreground">
Credits
</FormLabel>
<FormControl>
<Input
type="number"
placeholder="15"
{...field}
/>
</FormControl>
<FormMessage />
</FormItem>
)}
/>
</div>
<div className="flex items-start justify-between gap-3">
<div className="mt-1 flex flex-1 flex-col gap-2">
<Label className="text-xs text-foreground">Icon</Label>
<Button
type="button"
variant="outline"
className="flex-1 justify-between bg-gray-subtle px-3 py-2 hover:bg-gray-element"
style={{
color:
form.watch('color') === 'default'
? grayDark.gray10
: colorChoices.find(
(color) =>
color.name === form.watch('color'),
)?.value,
}}
onClick={() => {
setStep(2);
}}
>
<Icon
name={
form.watch('icon') !== 'default'
? (form.watch('icon') as IconNames)
: 'Folder'
}
size={18}
strokeWidth={1.5}
/>
<ChevronRightIcon
className="text-gray-solid"
size={18}
strokeWidth={1.5}
/>
</Button>
</div>
<div className="mt-1 flex flex-1 flex-col space-y-2">
<Label className="text-xs text-foreground">Color</Label>
<Button
type="button"
variant="outline"
className="flex-1 justify-between bg-gray-subtle px-3 py-2 hover:bg-gray-element"
onClick={() => {
setStep(3);
}}
>
<div
className="size-[18px] rounded-md"
style={{
backgroundColor:
form.watch('color') === 'default'
? grayDark.gray10
: colorChoices.find(
(color) =>
color.name === form.watch('color'),
)?.value,
}}
/>
<ChevronRightIcon
className="text-gray-solid"
size={18}
strokeWidth={1.5}
/>
</Button>
</div>
</div>
<Button
type="submit"
disabled={form.formState.isSubmitting}
className="!mt-4 w-full"
size="sm"
>
{form.formState.isSubmitting
? 'Creating...'
: 'Create module'}
</Button>
</div>
</div>
)}
{step === 2 && (
<div>
<StepHeading
title="Select an icon"
description="You can select an icon for your module to make it easier to identify."
/>
<IconPicker
iconOnClickHandler={(icon) => {
form.setValue('icon', icon);
setStep(1);
}}
/>
</div>
)}
{step === 3 && (
<div>
<StepHeading
title="Select a color"
description="You can select a color for your module to be able to identify it easily."
/>
<div className="mt-2 flex flex-wrap justify-between gap-4">
{colorChoices.map((color) => (
<button
type="button"
key={color.name}
className="size-8 rounded-lg transition-all hover:scale-110"
style={{ backgroundColor: color.value }}
onClick={() => {
form.setValue('color', color.name);
setStep(1);
}}
/>
))}
</div>
</div>
)}
</form>
</Form>
</ResizablePanel>
</PopoverContent>
</Popover>
);
}
================================================
FILE: src/app/(dashboard)/app/_components/module-card.tsx
================================================
import Color from 'color';
import { Icon, type IconNames } from '@/primitives/icon';
import { Skeleton } from '@/primitives/skeleton';
import Link from 'next/link';
import colors, { zinc } from 'tailwindcss/colors';
interface ModuleCardProps {
color: string;
id: string;
name: string;
icon: IconNames;
credits: number;
}
export function ModuleCard({
id,
color,
name,
icon,
credits,
}: ModuleCardProps) {
const moduleColor =
color === 'default' ? zinc : colors[color as keyof typeof colors];
return (
<li className="shrink-0 basis-full lg:basis-[250px]">
<Link
href={`/app/module/${id}`}
className="flex flex-col gap-2 rounded-xl p-6"
style={{
background: `linear-gradient(135deg, ${Color(moduleColor['500'])
.alpha(0.08)
.toString()} 0%, ${Color(moduleColor['700'])
.alpha(0.05)
.toString()} 100%)`,
border: `1px solid ${Color(moduleColor['500'])
.alpha(0.1)
.toString()}`,
}}
>
<Icon name={icon} strokeWidth={2} size={20} />
<h3 className="mt-2 text-lg font-medium">{name}</h3>
<p className="text-xs text-gray-foreground-muted">{credits} Credits</p>
</Link>
</li>
);
}
ModuleCard.Skeleton = function ModuleCardSkeleton({
animate = true,
opacity = 100,
}: {
animate?: boolean;
opacity?: number;
}) {
return (
<li
className="shrink-0 basis-full lg:basis-[250px]"
style={{ opacity: `${opacity.toString()}%` }}
>
<div className="flex flex-col gap-2 rounded-xl border bg-gray-subtle p-6">
<Skeleton noPulse={!animate} className="size-5" />
<Skeleton noPulse={!animate} className="mt-2 h-6 w-full" />
<Skeleton noPulse={!animate} className="mt-1 h-4 w-[50px]" />
</div>
</li>
);
};
================================================
FILE: src/app/(dashboard)/app/_components/recent-modules.tsx
================================================
'use client';
import { ScrollArea, ScrollBar } from '@/primitives/scroll-area';
import { ModuleCard } from './module-card';
import { Button } from '@/primitives/button';
import AnimateHeight from 'react-animate-height';
import { useState } from 'react';
import type { RouterOutputs } from '@/lib/trpc/types';
import { cn } from '@/utils/cn';
import type { IconNames } from '@/primitives/icon';
interface RecentModulesProps {
modules: RouterOutputs['modules']['getUserModules'];
}
export function RecentModules({ modules }: RecentModulesProps) {
const [isExpanded, setIsExpanded] = useState(true);
return (
<div className="mt-6 overflow-hidden rounded-xl border px-4 py-3">
<div className="flex justify-between">
<h2 className="text-lg font-semibold">Recent Modules</h2>
<Button
variant="outline"
size="sm"
className="text-xs"
aria-expanded={isExpanded}
aria-controls="recent-modules-list"
onClick={() => {
setIsExpanded((prev) => !prev);
}}
>
{isExpanded ? 'Hide' : 'Show'}
</Button>
</div>
<AnimateHeight id="recent-modules-list" height={isExpanded ? 'auto' : 0}>
<ScrollArea>
<ul
className={cn(
'relative mt-4 flex gap-4',
modules.length === 0 && 'overflow-hidden',
)}
>
{modules.length === 0 && (
<>
<div className="absolute inset-0 z-10 flex flex-col items-center justify-center">
<p className="max-w-[40ch] text-center text-sm text-gray-foreground-muted">
When you decide to become a good student and create modules,
your recent ones will show up here.
</p>
</div>
{new Array(8).fill(0).map((_, i) => (
<ModuleCard.Skeleton key={i} opacity={50} animate={false} />
))}
</>
)}
{modules.length > 0 &&
modules.map((module) => (
<ModuleCard
key={module.id}
{...module}
icon={
module.icon === 'default'
? 'Folder'
: (module.icon as IconNames)
}
/>
))}
</ul>
<ScrollBar orientation="horizontal" />
</ScrollArea>
</AnimateHeight>
</div>
);
}
================================================
FILE: src/app/(dashboard)/app/_components/side-menu.tsx
================================================
import { api } from '@/lib/trpc/server';
import {
CircleHelpIcon,
DiamondIcon,
HomeIcon,
MessageSquareMore,
PenLineIcon,
} from 'lucide-react';
import Image from 'next/image';
import { ActiveButton } from './active-button';
import { CreateModulePopover } from './create-module-popover';
import type { IconNames } from '@/primitives/icon';
import { Icon } from '@/primitives/icon';
import { Button } from '@/primitives/button';
import { constants } from '@/constants';
const iconSize = 15;
const sideMenuStaticLinks = [
{
icon: <HomeIcon size={iconSize} />,
label: 'Home',
href: '/app',
},
{
icon: <PenLineIcon size={iconSize} />,
label: 'Notebooks',
href: '/app/notes',
},
{
icon: <DiamondIcon size={iconSize} />,
label: 'Flashcards',
href: '/app/flashcards',
},
];
export async function SideMenu() {
const modules = await api.modules.getUserModules();
return (
<aside className="flex w-[200px] flex-col justify-between gap-8">
<div>
<div className="flex items-center gap-3 pl-3 pt-4">
<Image src="/logo.svg" width={35} height={35} alt="Noodle Logo" />
<span>Noodle</span>
</div>
<ul className="mt-8 flex flex-col">
{sideMenuStaticLinks.map(({ icon, label, href }) => (
<li key={label} className="flex flex-1 flex-col">
<ActiveButton icon={icon} label={label} href={href} />
</li>
))}
</ul>
<div className="mt-6 space-y-2">
<div className="flex items-center justify-between pl-4">
<h3 className="text-xs text-gray">Modules</h3>
<CreateModulePopover />
</div>
<ul className="flex flex-col">
{modules
.sort((a, b) => {
return (
new Date(a.createdAt).getTime() -
new Date(b.createdAt).getTime()
);
})
.map((module) => (
<li key={module.id} className="flex flex-1 flex-col">
<ActiveButton
href={`/app/module/${module.id}`}
icon={
<Icon
name={
module.icon === 'default'
? 'Folder'
: (module.icon as IconNames)
}
size={15}
strokeWidth={1.5}
/>
}
label={module.name}
/>
</li>
))}
</ul>
</div>
</div>
<div className="mb-6 flex flex-col">
<Button
variant="ghost"
className="justify-start gap-3 font-normal"
asChild
>
<a
href={constants.feedback}
target="_blank"
rel="noopener noreferrer"
>
<MessageSquareMore size={15} strokeWidth={1.5} /> Feedback
</a>
</Button>
<Button
variant="ghost"
className="justify-start gap-3 font-normal"
asChild
>
<a href={constants.support} target="_blank" rel="noopener noreferrer">
<CircleHelpIcon size={15} strokeWidth={1.5} /> Help & Support
</a>
</Button>
</div>
</aside>
);
}
================================================
FILE: src/app/(dashboard)/app/_components/welcome-message.tsx
================================================
'use client';
import { Skeleton } from '@/primitives/skeleton';
import { useUser } from '@clerk/nextjs';
export function WelcomeMessage() {
const { isLoaded, user } = useUser();
if (!isLoaded || !user) {
return (
<div className="space-y-3">
<Skeleton className="h-10 w-2/5" />
<div className="flex flex-col gap-2">
<Skeleton className="h-5 w-1/2" />
<Skeleton className="h-5 w-1/2" />
</div>
</div>
);
}
const currentHour = new Date().getHours();
let timeGreeting;
if (currentHour < 12) {
timeGreeting = 'Good morning';
} else if (currentHour < 18) {
timeGreeting = 'Good afternoon';
} else {
timeGreeting = 'Good evening';
}
const greeting = user.firstName
? `${timeGreeting}, ${user.firstName}!`
: `${timeGreeting}!`;
return (
<div className="space-y-3">
<h1 className="text-4xl font-semibold">{greeting}</h1>
<p className="max-w-prose text-balance text-sm leading-6 text-foreground-muted">
“The final wisdom of life requires not the annulment of incongruity but
the achievement of serenity within and above it.” - Reinhold Niebuhr
</p>
</div>
);
}
================================================
FILE: src/app/(dashboard)/app/layout.tsx
================================================
import { PanelLeftCloseIcon } from 'lucide-react';
import type { PropsWithChildren } from 'react';
import { Button } from '@/primitives/button';
import { UserButton } from '@clerk/nextjs';
import { SideMenu } from './_components/side-menu';
export default function AppLayout({ children }: PropsWithChildren) {
return (
<main className="flex min-h-dvh gap-4 p-4">
<SideMenu />
<div className="flex flex-1 flex-col rounded-xl border px-6 pb-6 pt-4">
<nav className="mb-6 flex items-center justify-between">
<Button variant="ghost" size="icon" className="-ml-2">
<PanelLeftCloseIcon strokeWidth={1.5} size={18} />
</Button>
<UserButton />
</nav>
{children}
</div>
</main>
);
}
================================================
FILE: src/app/(dashboard)/app/lib/color-choices.ts
================================================
import {
amber,
blue,
bronze,
brown,
crimson,
cyan,
gold,
grass,
gray,
green,
indigo,
iris,
jade,
lime,
mauve,
mint,
olive,
orange,
pink,
plum,
purple,
red,
ruby,
sage,
sky,
slate,
teal,
tomato,
violet,
yellow,
} from '@radix-ui/colors';
export const colorChoices = [
{
name: 'default',
value: gray.gray9,
},
{
name: 'mauve',
value: mauve.mauve9,
},
{
name: 'slate',
value: slate.slate9,
},
{
name: 'sage',
value: sage.sage9,
},
{
name: 'olive',
value: olive.olive9,
},
{
name: 'tomato',
value: tomato.tomato9,
},
{
name: 'red',
value: red.red9,
},
{
name: 'ruby',
value: ruby.ruby9,
},
{
name: 'crimson',
value: crimson.crimson9,
},
{
name: 'pink',
value: pink.pink9,
},
{
name: 'plum',
value: plum.plum9,
},
{
name: 'purple',
value: purple.purple9,
},
{
name: 'violet',
value: violet.violet9,
},
{
name: 'iris',
value: iris.iris9,
},
{
name: 'indigo',
value: indigo.indigo9,
},
{
name: 'blue',
value: blue.blue9,
},
{
name: 'cyan',
value: cyan.cyan9,
},
{
name: 'teal',
value: teal.teal9,
},
{
name: 'jade',
value: jade.jade9,
},
{
name: 'green',
value: green.green9,
},
{
name: 'grass',
value: grass.grass9,
},
{
name: 'bronze',
value: bronze.bronze9,
},
{
name: 'gold',
value: gold.gold9,
},
{
name: 'brown',
value: brown.brown9,
},
{
name: 'orange',
value: orange.orange9,
},
{
name: 'amber',
value: amber.amber9,
},
{
name: 'yellow',
value: yellow.yellow9,
},
{
name: 'lime',
value: lime.lime9,
},
{
name: 'mint',
value: mint.mint9,
},
{
name: 'sky',
value: sky.sky9,
},
];
================================================
FILE: src/app/(dashboard)/app/module/[id]/page.tsx
================================================
import { api } from '@/lib/trpc/server';
import type { RouterOutputs } from '@/lib/trpc/types';
import type { IconNames } from '@/primitives/icon';
import { Icon } from '@/primitives/icon';
import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/primitives/tabs';
import { Textarea } from '@/primitives/textarea';
import {
ClockIcon,
DiamondIcon,
PenLineIcon,
RadicalIcon,
WeightIcon,
} from 'lucide-react';
import { redirect } from 'next/navigation';
import { format } from 'timeago.js';
interface Props {
params: {
id: string;
};
}
type UserModule = RouterOutputs['modules']['getById'];
export default async function ModulePage({ params }: Props) {
let userModule: UserModule;
try {
userModule = await api.modules.getById({ id: params.id });
} catch {
redirect('/not-found');
}
return (
<div className="flex flex-1 gap-6">
<div className="flex-1">
<div className="flex items-start gap-4">
<div className="mt-1">
<Icon
name={
userModule.icon === 'default'
? 'Folder'
: (userModule.icon as IconNames)
}
size={28}
strokeWidth={1.5}
/>
</div>
<div className="flex flex-1 flex-col gap-3">
<h1 className="text-3xl font-medium">{userModule.name}</h1>
<div className="flex items-start gap-6">
<p className="flex items-center gap-2 text-sm text-foreground-muted">
<RadicalIcon size={15} /> {userModule.code}
</p>
<p className="flex items-center gap-2 text-sm text-foreground-muted">
<WeightIcon size={15} /> {userModule.credits} credits
</p>
<p className="flex items-center gap-2 text-sm text-foreground-muted">
<ClockIcon size={15} /> Created {format(userModule.createdAt)}
</p>
<p className="flex items-center gap-2 text-sm text-foreground-muted">
<PenLineIcon size={15} /> 0 Notebooks
</p>
<p className="flex items-center gap-2 text-sm text-foreground-muted">
<DiamondIcon size={15} /> 0 Flashcards
</p>
</div>
</div>
</div>
<Tabs defaultValue="notes" className="mt-4 w-full">
<TabsList className="w-full">
<TabsTrigger value="notes" className="flex items-center gap-2">
<PenLineIcon size={15} />
Notebooks
</TabsTrigger>
<TabsTrigger value="flashcards" className="flex items-center gap-2">
<DiamondIcon size={15} />
Flashcards
</TabsTrigger>
</TabsList>
<TabsContent value="notes">
<div>Notes</div>
</TabsContent>
<TabsContent value="flashcards">
<div>Flashcards</div>
</TabsContent>
</Tabs>
</div>
<div className="min-w-[280px] rounded-lg border p-4">
<div className="flex flex-col gap-3">
<h2 className="font-medium">Description</h2>
<Textarea
value={userModule.description ?? ''}
readOnly
className="resize-none"
/>
</div>
</div>
</div>
);
}
================================================
FILE: src/app/(dashboard)/app/page.tsx
================================================
import { api } from '@/lib/trpc/server';
import { RecentModules } from './_components/recent-modules';
import { WelcomeMessage } from './_components/welcome-message';
export default async function DashboardHome() {
const modules = await api.modules.getUserModules();
return (
<div className="flex flex-1 gap-6">
<div className="flex-1">
<WelcomeMessage />
<RecentModules modules={modules.slice(0, 4)} />
</div>
<div className="min-w-[280px] rounded-lg border p-4">Right side</div>
</div>
);
}
================================================
FILE: src/app/(dashboard)/layout.tsx
================================================
import { TRPCReactProvider } from '@/lib/trpc/react';
import { ClerkProvider } from '@clerk/nextjs';
import { dark } from '@clerk/themes';
import type { PropsWithChildren } from 'react';
/**
* The layout of the dashboard routes, this supplies the clerk & trpc providers mainly.
* @param props The props of the layout.
* @param props.children The children of the layout, which are all the routes under this route group.
* @returns A react component.
*/
export default function DashboardLayout({ children }: PropsWithChildren) {
return (
<ClerkProvider
appearance={{
baseTheme: dark,
variables: { colorPrimary: '#F9617B' },
elements: {
userButtonPopoverMain: 'bg-gray-subtle',
navbar: 'bg-gradient-to-r from-gray-subtle to-gray-subtle',
pageScrollBox: 'bg-gray-subtle',
},
}}
>
<TRPCReactProvider>{children}</TRPCReactProvider>
</ClerkProvider>
);
}
================================================
FILE: src/app/(site)/(legal)/layout.tsx
================================================
import type { PropsWithChildren } from 'react';
export default function LegalLayout({ children }: PropsWithChildren) {
return <main className="mx-auto max-w-prose py-8 md:py-12">{children}</main>;
}
================================================
FILE: src/app/(site)/(legal)/privacy/page.tsx
================================================
import { getLegalDocs } from '@/lib/mdx';
import { notFound } from 'next/navigation';
import { CustomMDX, MDXComponents } from '../../_components/custom-mdx';
export default async function PrivacyPage() {
const docs = await getLegalDocs();
const post = docs.find((d) => d.slug === 'privacy');
if (!post) {
notFound();
}
return (
<>
<MDXComponents.h1>{post.metadata.title}</MDXComponents.h1>
<p className="my-3 text-sm md:my-4 md:text-base">
{post.metadata.effectiveDate}
</p>
<CustomMDX source={post.content} />
</>
);
}
================================================
FILE: src/app/(site)/(legal)/tos/page.tsx
================================================
import { getLegalDocs } from '@/lib/mdx';
import { notFound } from 'next/navigation';
import { CustomMDX, MDXComponents } from '../../_components/custom-mdx';
export default async function TermsPage() {
const docs = await getLegalDocs();
const post = docs.find((d) => d.slug === 'tos');
if (!post) {
notFound();
}
return (
<>
<MDXComponents.h1>{post.metadata.title}</MDXComponents.h1>
<p className="my-3 text-sm md:my-4 md:text-base">
Effective date: {post.metadata.effectiveDate}
</p>
<CustomMDX source={post.content} />
</>
);
}
================================================
FILE: src/app/(site)/_components/custom-mdx.tsx
================================================
import { cn } from '@/utils/cn';
import slugify from 'slugify';
import { buttonVariants } from '@/primitives/button';
import type { MDXRemoteProps } from 'next-mdx-remote/rsc';
import { MDXRemote } from 'next-mdx-remote/rsc';
import type { PropsWithChildren } from 'react';
import { createElement } from 'react';
function createHeading(level: 1 | 2 | 3 | 4 | 5 | 6, className: string) {
const Element = ({ children }: PropsWithChildren) => {
const slug =
typeof children === 'string'
? slugify(children, { lower: true, strict: true })
: '';
return createElement(
`h${String(level)}`,
{ id: slug },
createElement(
'a',
{
href: `#${slug}`,
key: `link-${slug}`,
className: cn('font-medium', className),
},
children,
),
);
};
Element.displayName = `h${String(level)}`;
return Element;
}
export const MDXComponents = {
h1: createHeading(1, 'text-2xl md:text-3xl'),
h2: createHeading(
2,
'text-xl md:text-2xl mb-3 md:mb-4 mt-3 md:mt-4 inline-block',
),
h3: createHeading(
3,
'text-lg md:text-xl mb-2 md:mb-3 mt-2 md:mt-3 inline-block font-normal',
),
ul: ({ children, className, ...props }) => (
<ul
{...props}
className={cn(
className,
'mb-3 list-disc pl-6 text-sm md:mb-4 md:text-base',
)}
>
{children}
</ul>
),
li: ({ children, className, ...props }) => (
<li
{...props}
className={cn(
className,
'mb-1.5 text-sm leading-relaxed text-foreground-muted md:mb-2 md:text-base',
)}
>
{children}
</li>
),
strong: ({ children, className, ...props }) => (
<strong {...props} className={cn(className, 'font-medium text-foreground')}>
{children}
</strong>
),
a: ({ children, className, ...props }) => (
<a
{...props}
className={cn(
buttonVariants({ variant: 'link' }),
className,
'p-0 pb-0.5 font-bold before:w-full',
)}
target="_blank"
rel="noopener noreferrer"
>
{children}
</a>
),
p: ({ children, className, ...props }) => (
<p
{...props}
className={cn(
className,
'mb-3 text-sm !leading-6 text-foreground-muted md:mb-4 md:text-base md:!leading-7',
)}
>
{children}
</p>
),
} satisfies MDXRemoteProps['components'];
export function CustomMDX(props: MDXRemoteProps) {
return (
<MDXRemote
{...props}
components={{ ...MDXComponents, ...(props.components ?? {}) }}
/>
);
}
================================================
FILE: src/app/(site)/_components/footer.tsx
================================================
import { constants } from '@/constants';
import Image from 'next/image';
import Link from 'next/link';
const footerLinkSections = [
{
section: 'GENERAL',
links: [
{
title: 'Blog',
url: '/blog',
},
{
title: 'Contribute',
url: constants.github_repo,
},
],
},
{
section: 'SOCIAL',
links: [
{
title: 'Twitter',
url: constants.twitter,
},
{
title: 'Discord',
url: constants.discord,
},
],
},
{
section: 'LEGAL',
links: [
{
title: 'Terms of Service',
url: '/tos',
},
{
title: 'Privacy Policy',
url: '/privacy',
},
],
},
];
export const Footer = () => {
return (
<footer className="border-t border-gray-element py-12 lg:py-16">
<div className="container flex flex-col justify-between md:flex-row">
<div className="order-2 space-y-4 md:order-1">
<Link href="/" className="flex items-center gap-3">
<Image src="/logo.svg" width={24} height={24} alt="Noodle Logo" />
<span>Noodle</span>
</Link>
<p className="text-sm text-foreground-muted">
© {new Date().getFullYear()} NOODLE RUN LTD. All Rights
Reserved.
</p>
</div>
<div className="order-1 mb-10 grid grid-cols-3 gap-0 md:order-2 md:mb-0 md:gap-12">
{footerLinkSections.map(({ section, links }) => (
<div className="text-sm" key={section}>
<h3 className="pb-4 text-foreground-muted">{section}</h3>
<ul className="flex flex-col gap-2">
{links.map(({ title, url }) => (
<li key={title}>
{url.startsWith('/') ? (
<Link href={url}>{title}</Link>
) : (
<a href={url} target="_blank" rel="noreferrer noopener">
{title}
</a>
)}
</li>
))}
</ul>
</div>
))}
</div>
</div>
</footer>
);
};
================================================
FILE: src/app/(site)/_components/navbar.tsx
================================================
'use client';
import { forwardRef, useState } from 'react';
import Image from 'next/image';
import Link from 'next/link';
import { ChevronRightIcon, MenuIcon } from 'lucide-react';
import { constants, features } from '@/constants';
import { cn } from '@/utils/cn';
import { Button } from '@/primitives/button';
import {
NavigationMenu,
NavigationMenuContent,
NavigationMenuItem,
NavigationMenuLink,
NavigationMenuList,
NavigationMenuTrigger,
navigationMenuTriggerStyle,
} from '@/primitives/navigation-menu';
const ListItem = forwardRef<
React.ElementRef<'div'>,
React.ComponentPropsWithoutRef<'div'> & { icon: React.ReactNode }
>(({ className, title, children, icon, ...props }, ref) => {
return (
<li>
<NavigationMenuLink asChild>
<div
ref={ref}
className={cn(
'z-50 flex select-none items-start gap-3 rounded-md border border-transparent px-4 py-3 leading-none no-underline outline-none transition-colors hover:border-gray-element-border hover:bg-gray-element hover:text-gray-foreground focus:border-gray-element-border focus:bg-gray-element focus:text-gray-foreground',
className,
)}
{...props}
>
<div className="size-[18px]">{icon}</div>
<div className="space-y-2">
<div className="text-sm font-medium leading-none text-foreground">
{title}
</div>
<p className="line-clamp-2 text-xs leading-normal">{children}</p>
</div>
</div>
</NavigationMenuLink>
</li>
);
});
ListItem.displayName = 'ListItem';
export const Navbar = () => {
const [menuOpen, setMenuOpen] = useState(false);
return (
<nav className={cn('z-50 w-full pb-0 pt-4 md:py-4')}>
<div className="container flex items-center justify-between transition-all">
<Link href="/" className="flex items-center gap-3">
<Image src="/logo.svg" width={35} height={35} alt="Noodle Logo" />
<span>Noodle</span>
</Link>
<NavigationMenu className="hidden md:block">
<NavigationMenuList>
<NavigationMenuItem>
<NavigationMenuTrigger>Features</NavigationMenuTrigger>
<NavigationMenuContent>
<div className="absolute right-36 top-1/2 z-30 size-20 -translate-y-1/2 rounded-full bg-pink opacity-50 blur-3xl" />
<ul className="grid gap-3 p-3 md:w-[450px] lg:w-[550px] lg:grid-cols-[1fr_0.85fr]">
<div className="flex flex-col gap-3">
{features(18).map((feature) => (
<ListItem
key={feature.title}
title={feature.title}
icon={feature.icon}
>
{feature.description}
</ListItem>
))}
</div>
<li>
<NavigationMenuLink asChild>
<div className="flex size-full select-none flex-col justify-end rounded-md border border-gray-element-border bg-gray-element/50 px-6 py-3 pt-6 no-underline outline-none backdrop-blur-lg transition-colors hover:bg-gray-element/75 focus:shadow-md">
<Image
src="/logo.svg"
width={35}
height={35}
alt="Noodle Logo"
/>
<div className="mb-2 mt-4 text-lg font-medium text-foreground">
{constants.shortName}
</div>
<p className="text-sm leading-snug text-foreground-muted">
Helping students stay productive and on top of their
work.
</p>
<a
href={constants.github_repo}
target="_blank"
rel="noreferrer noopener"
className="mt-6 flex items-center gap-2 py-2 text-sm transition-colors hover:text-gray-foreground"
>
Contribute <ChevronRightIcon size={13} />
</a>
</div>
</NavigationMenuLink>
</li>
</ul>
</NavigationMenuContent>
</NavigationMenuItem>
<NavigationMenuItem>
<Link href="/blog" legacyBehavior passHref>
<NavigationMenuLink className={navigationMenuTriggerStyle()}>
Blog
</NavigationMenuLink>
</Link>
</NavigationMenuItem>
<NavigationMenuItem>
<NavigationMenuLink
href={constants.github_repo}
target="_blank"
rel="noreferrer noopener"
className={navigationMenuTriggerStyle()}
>
Contribute
</NavigationMenuLink>
</NavigationMenuItem>
<NavigationMenuItem>
<NavigationMenuLink
href={constants.discord}
target="_blank"
rel="noreferrer noopener"
className={navigationMenuTriggerStyle()}
>
Discord
</NavigationMenuLink>
</NavigationMenuItem>
</NavigationMenuList>
</NavigationMenu>
<div className="hidden items-center gap-4 md:flex">
<Button size="sm" asChild>
<Link href="/sign-in">
Dashboard <ChevronRightIcon size={16} />
</Link>
</Button>
</div>
<div className="block md:hidden">
<button
type="button"
onClick={() => {
setMenuOpen((prev) => !prev);
}}
>
<MenuIcon size={24} />
</button>
</div>
</div>
<div
className={cn(
'block h-0 overflow-hidden md:hidden',
menuOpen && 'h-full pt-6',
)}
>
<div className="container">
<ul className="flex flex-col gap-3">
<li>
<Link href="/early-access">Early access</Link>
</li>
<li>
<Link href="/blog">Blog</Link>
</li>
<li>
<a
href={constants.github_repo}
target="_blank"
rel="noreferrer noopener"
>
Contribute
</a>
</li>
<li>
<a
href={constants.discord}
target="_blank"
rel="noreferrer noopener"
>
Discord
</a>
</li>
</ul>
</div>
</div>
</nav>
);
};
================================================
FILE: src/app/(site)/blog/[slug]/page.tsx
================================================
import { getBlogPosts } from '@/lib/mdx';
import { notFound } from 'next/navigation';
import { CustomMDX, MDXComponents } from '../../_components/custom-mdx';
import type { Metadata } from 'next';
import { constructMetadata } from '@/utils/construct-metadata';
import { constants } from '@/constants';
import { getBaseUrl } from '@/utils/base-url';
export const dynamic = 'force-static';
interface Props {
params: {
slug: string;
};
}
export async function generateMetadata({
params,
}: Props): Promise<Metadata | undefined> {
const posts = await getBlogPosts();
const post = posts.find((p) => p.slug === params.slug);
if (!post) {
return;
}
const {
title,
publishedAt: publishedTime,
summary: description,
image,
} = post.metadata;
return constructMetadata({
title: `${title} - ${constants.shortName}`,
description,
image: image ? `${getBaseUrl()}/${image}` : `${getBaseUrl()}/thumbnail.jpg`,
publishedTime,
type: 'article',
url: `${getBaseUrl()}/blog/${params.slug}`,
});
}
export default async function Home({ params }: Props) {
const posts = await getBlogPosts();
const post = posts.find((p) => p.slug === params.slug);
if (!post) {
notFound();
}
return (
<main className="mx-auto max-w-prose py-8 md:py-12">
<MDXComponents.h1>{post.metadata.title}</MDXComponents.h1>
<MDXComponents.p className="my-4 text-foreground-muted">
{post.metadata.publishedAt}
</MDXComponents.p>
<MDXComponents.p className="my-4 text-foreground-muted">
{post.metadata.summary}
</MDXComponents.p>
<CustomMDX source={post.content} />
</main>
);
}
================================================
FILE: src/app/(site)/blog/page.tsx
================================================
import { getBlogPosts } from '@/lib/mdx';
import { Button } from '@/primitives/button';
import { MoveRightIcon } from 'lucide-react';
import { notFound } from 'next/navigation';
export default async function BlogPage() {
const posts = await getBlogPosts();
// TODO: once we have more than one post, we can use this to show the latest post
const latestPost = posts[0];
if (!latestPost) {
notFound();
}
return (
<main className="py-12 md:py-16 lg:py-24">
<h1 className="mb-8 text-3xl font-medium md:text-4xl lg:mb-12">
Latest post
</h1>
<div key={latestPost.slug}>
<p className="mb-4 text-sm text-foreground-muted">
{latestPost.metadata.publishedAt}
</p>
<h3 className="mb-4 inline-block text-xl font-medium md:text-2xl">
{latestPost.metadata.title}
</h3>
<p className="max-w-prose text-balance text-sm leading-relaxed text-foreground-muted md:text-base">
{latestPost.metadata.summary}
</p>
<Button variant="default" size="sm" className="mt-6" asChild>
<a href={`/blog/${latestPost.slug}`}>
Read post <MoveRightIcon size={16} strokeWidth={3} />
</a>
</Button>
</div>
<h2 className="pt-12 text-2xl font-medium md:pt-16 md:text-3xl lg:pt-24">
More posts
</h2>
<p className="mt-6 text-balance text-left text-foreground-muted md:mt-12 md:text-center lg:mt-16">
🤪 Waiting on the Noodle team (Ahmed) to write more...
</p>
</main>
);
}
================================================
FILE: src/app/(site)/early-access/_forms/join.tsx
================================================
'use client';
import { api } from '@/lib/trpc/react';
import { cn } from '@/utils/cn';
import { Button, buttonVariants } from '@/primitives/button';
import { Checkbox } from '@/primitives/checkbox';
import { Input } from '@/primitives/input';
import { zodResolver } from '@hookform/resolvers/zod';
import {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
} from '@/primitives/select';
import Link from 'next/link';
import { useForm } from 'react-hook-form';
import { z } from 'zod';
import {
Form,
FormControl,
FormField,
FormItem,
FormLabel,
FormMessage,
} from '@/primitives/form';
import { toast } from 'sonner';
const formSchema = z.object({
name: z.string().min(2, { message: 'Name is too short' }),
email: z.string().email({ message: 'Invalid email address' }).min(5),
reason: z.enum(['student', 'project', 'both']).default('student'),
agreement: z.boolean().default(false),
});
export const JoinEarlyAccessForm = () => {
const { mutate: joinEarlyAccess, isPending } =
api.earlyAccess.joinEarlyAccess.useMutation({
onError: (error) => {
toast.error(error.message);
},
onSuccess: () => {
toast.success('Thank you for joining the early access list!');
},
});
const form = useForm<z.infer<typeof formSchema>>({
resolver: zodResolver(formSchema),
defaultValues: {
name: '',
email: '',
reason: 'student',
agreement: false,
},
});
function onSubmit(values: z.infer<typeof formSchema>) {
if (values.agreement) {
joinEarlyAccess(values);
}
}
return (
<Form {...form}>
<form
onSubmit={form.handleSubmit(onSubmit)}
className="mt-6 flex max-w-[500px] flex-col gap-6"
>
<div className="flex w-full flex-col gap-6 md:flex-row">
<div className="w-full space-y-2">
<FormField
control={form.control}
name="name"
render={({ field }) => (
<FormItem>
<FormLabel htmlFor="name">Name</FormLabel>
<FormControl>
<Input
{...field}
id="name"
type="text"
placeholder="John Doe"
/>
</FormControl>
<FormMessage />
</FormItem>
)}
/>
</div>
<div className="w-full space-y-2">
<FormField
control={form.control}
name="email"
render={({ field }) => (
<FormItem>
<FormLabel htmlFor="email">Email address</FormLabel>
<FormControl>
<Input
{...field}
id="email"
placeholder="johndoe@example.com"
/>
</FormControl>
<FormMessage />
</FormItem>
)}
/>
</div>
</div>
<div className="space-y-2">
<FormField
control={form.control}
name="reason"
render={({ field }) => (
<FormItem>
<FormLabel>Reason of interest</FormLabel>
<FormControl>
<Select
onValueChange={field.onChange}
defaultValue={field.value}
>
<SelectTrigger>
<SelectValue placeholder="Reason" />
</SelectTrigger>
<SelectContent>
<SelectItem value="student">I am a student</SelectItem>
<SelectItem value="project">
Interested in the project
</SelectItem>
<SelectItem value="both">Both</SelectItem>
</SelectContent>
</Select>
</FormControl>
<FormMessage />
</FormItem>
)}
/>
</div>
<FormField
control={form.control}
name="agreement"
render={({ field }) => (
<FormItem className="flex gap-3">
<FormControl>
<Checkbox
checked={field.value}
onCheckedChange={field.onChange}
className="mt-3"
/>
</FormControl>
<span className="text-balance text-sm leading-6 text-foreground-muted">
By signing up, you agree to our{' '}
<Link
href="/terms"
className={cn(
buttonVariants({ variant: 'link' }),
'p-0 before:w-full',
)}
>
terms of service
</Link>{' '}
and{' '}
<Link
href="/privacy"
className={cn(
buttonVariants({ variant: 'link' }),
'p-0 before:w-full',
)}
>
privacy policy
</Link>
, also to be contacted by email about product updates and early
access.
</span>
</FormItem>
)}
/>
<Button
type="submit"
className="mt-3"
disabled={
isPending ||
form.formState.isSubmitting ||
!form.formState.isValid ||
!form.getValues('agreement')
}
>
{isPending ? 'Joining...' : 'Join early access'}
</Button>
</form>
</Form>
);
};
================================================
FILE: src/app/(site)/early-access/layout.tsx
================================================
import { TRPCReactProvider } from '@/lib/trpc/react';
import type { PropsWithChildren } from 'react';
export default function EarlyAccessLayout({ children }: PropsWithChildren) {
return <TRPCReactProvider>{children}</TRPCReactProvider>;
}
================================================
FILE: src/app/(site)/early-access/page.tsx
================================================
import type { Metadata } from 'next';
import { JoinEarlyAccessForm } from './_forms/join';
import { constructMetadata } from '@/utils/construct-metadata';
export const metadata: Metadata = constructMetadata({
title: 'Early Access - Noodle',
description: 'Join us on our journey to improve student productivity.',
});
export default function EarlyAccessPage() {
return (
<main className="flex flex-col items-center justify-center gap-6 py-12 md:py-16 lg:py-24">
<h1 className="hidden max-w-[20ch] text-balance bg-gradient-to-b from-foreground to-gray-foreground-muted bg-clip-text text-center text-5xl font-extrabold leading-none text-transparent sm:block md:text-6xl lg:text-7xl">
Join us on our journey to improve student productivity
</h1>
<h1 className="block max-w-[20ch] text-balance bg-gradient-to-b from-foreground to-gray-foreground-muted bg-clip-text text-center text-5xl font-extrabold leading-none text-transparent sm:hidden md:text-6xl lg:text-7xl">
Join us on our journey
</h1>
<p className="max-w-prose text-balance text-center text-lg text-foreground-muted [&>strong]:font-medium [&>strong]:text-foreground">
Sign up to our <strong>early access list</strong> and be the{' '}
<strong>first to get</strong> updates and access to the platform{' '}
<strong>before the wider public</strong>.
</p>
<JoinEarlyAccessForm />
</main>
);
}
================================================
FILE: src/app/(site)/layout.tsx
================================================
import type { PropsWithChildren } from 'react';
import { Navbar } from './_components/navbar';
import { Footer } from './_components/footer';
/**
* The root layout component of the marketing group of pages.
* @param props The props of the layout.
* @param props.children The children of the layout which is every page in the
* marketing layout group.
* @returns A react component representing the layout.
*/
export default function RootLayout({ children }: PropsWithChildren) {
return (
<div className="flex min-h-dvh flex-col">
<div className="absolute left-0 top-0 z-[-1] h-56 w-full bg-gradient-to-b from-indigo-subtle to-background" />
<Navbar />
<div className="container flex-1">{children}</div>
<Footer />
</div>
);
}
================================================
FILE: src/app/(site)/page.tsx
================================================
import Link from 'next/link';
import { ChevronRightIcon, StarIcon } from 'lucide-react';
import { constants } from '@/constants';
import { Button } from '@/primitives/button';
import Image from 'next/image';
/**
* The marketing home page.
* @returns A react component representing the marketing home page.
*/
export default function Home() {
return (
<main className="flex flex-col items-center justify-center py-12 md:py-16 lg:py-24">
<div className="flex flex-col items-center gap-6">
<Button variant="outline" asChild className="rounded-full font-normal">
<a
href={constants.github_repo}
target="_blank"
rel="noreferrer noopener"
>
Star us on GitHub{' '}
<StarIcon className="fill-amber-500 stroke-amber-500" size={16} />
</a>
</Button>
<h1 className="max-w-[20ch] text-balance bg-gradient-to-b from-foreground to-gray-foreground-muted bg-clip-text text-center text-5xl font-extrabold leading-none text-transparent md:text-6xl lg:text-8xl">
{constants.tagline}
</h1>
<p className="max-w-[50ch] text-pretty text-center text-foreground-muted lg:text-lg [&>strong]:font-medium [&>strong]:text-foreground">
<strong>open-source</strong> student productivity platform made to{' '}
<strong>streamline</strong> the process students conduct their studies
and organize it.
</p>
<Button className="rounded-full" size="lg" asChild>
<Link href="/early-access">
Get early access <ChevronRightIcon size={20} strokeWidth={2.5} />
</Link>
</Button>
</div>
<Image
src="/_static/dark-dashboard-preview.jpg"
width={1920}
height={1080}
alt="Dashboard Preview"
className="mt-12 rounded-lg shadow-[0_50px_200px_75px] shadow-pink/10 md:mt-16 lg:mt-24"
/>
</main>
);
}
================================================
FILE: src/app/api/trpc/[trpc]/route.ts
================================================
import type { NextRequest } from 'next/server';
import { fetchRequestHandler } from '@trpc/server/adapters/fetch';
import { env } from '@/env';
import { appRouter } from '@/server';
import { createTRPCContext } from '@/server/trpc';
const createContext = (req: NextRequest) => {
return createTRPCContext({
headers: req.headers,
});
};
const handler = (req: NextRequest) =>
fetchRequestHandler({
endpoint: '/api/trpc',
req,
router: appRouter,
createContext: () => createContext(req),
onError: ({ path, error }) => {
if (env.NODE_ENV === 'development') {
console.error(
`❌ tRPC failed on ${path ?? '<no-path>'}: ${error.message}`,
);
}
},
});
export { handler as GET, handler as POST };
================================================
FILE: src/app/globals.css
================================================
:root {
--gray-1: 0 0% 99%;
--gray-2: 0 0% 98%;
--gray-3: 0 0% 94%;
--gray-4: 0 0% 91%;
--gray-5: 0 0% 88%;
--gray-6: 0 0% 85%;
--gray-7: 0 0% 81%;
--gray-8: 0 0% 73%;
--gray-9: 0 0% 55%;
--gray-10: 0 0% 51%;
--gray-11: 0 0% 39%;
--gray-12: 0 0% 13%;
--pink-1: 340 100% 99%;
--pink-2: 351 78% 98%;
--pink-3: 346 100% 96%;
--pink-4: 346 100% 93%;
--pink-5: 347 85% 90%;
--pink-6: 345 71% 85%;
--pink-7: 345 61% 80%;
--pink-8: 345 57% 73%;
--pink-9: 339 99% 66%;
--pink-10: 338 85% 61%;
--pink-11: 335 71% 46%;
--pink-12: 338 62% 24%;
--salmon-1: 0 50% 99%;
--salmon-2: 7 100% 98%;
--salmon-3: 5 100% 96%;
--salmon-4: 6 100% 92%;
--salmon-5: 5 100% 88%;
--salmon-6: 4 100% 86%;
--salmon-7: 4 79% 80%;
--salmon-8: 3 70% 73%;
--salmon-9: 1 91% 69%;
--salmon-10: 0 79% 65%;
--salmon-11: 359 57% 53%;
--salmon-12: 3 36% 25%;
--indigo-1: 240 33% 99%;
--indigo-2: 225 100% 98%;
--indigo-3: 222 89% 96%;
--indigo-4: 224 100% 94%;
--indigo-5: 224 100% 91%;
--indigo-6: 225 100% 88%;
--indigo-7: 226 87% 82%;
--indigo-8: 226 75% 75%;
--indigo-9: 226 70% 55%;
--indigo-10: 226 65% 52%;
--indigo-11: 226 56% 50%;
--indigo-12: 226 50% 24%;
--red-1: 0 100% 99%;
--red-2: 7, 100%, 98%;
--red-3: 10, 92%, 95%;
--red-4: 12, 100%, 91%;
--red-5: 11, 100%, 88%;
--red-6: 11, 95%, 84%;
--red-7: 10, 82%, 78%;
--red-8: 10, 75%, 70%;
--red-9: 10, 78%, 54%;
--red-10: 10, 73%, 51%;
--red-11: 10, 82%, 45%;
--red-12: 8, 50%, 24%;
}
:root.dark {
--gray-1: 0 0% 7%;
--gray-2: 0 0% 10%;
--gray-3: 0 0% 13%;
--gray-4: 0 0% 16%;
--gray-5: 0 0% 19%;
--gray-6: 0 0% 23%;
--gray-7: 0 0% 28%;
--gray-8: 0 0% 38%;
--gray-9: 0 0% 43%;
--gray-10: 0 0% 48%;
--gray-11: 0 0% 71%;
--gray-12: 0 0% 93%;
--pink-1: 347 24% 7%;
--pink-2: 346 25% 10%;
--pink-3: 340 51% 15%;
--pink-4: 337 72% 18%;
--pink-5: 337 66% 23%;
--pink-6: 339 55% 29%;
--pink-7: 340 49% 37%;
--pink-8: 339 49% 48%;
--pink-9: 339 99% 66%;
--pink-10: 338 85% 61%;
--pink-11: 341 100% 77%;
--pink-12: 345 100% 91%;
--salmon-1: 8 22% 7%;
--salmon-2: 5 27% 10%;
--salmon-3: 0 51% 15%;
--salmon-4: 358 65% 19%;
--salmon-5: 358 60% 24%;
--salmon-6: 359 51% 30%;
--salmon-7: 0 45% 38%;
--salmon-8: 1 44% 49%;
--salmon-9: 1 91% 69%;
--salmon-10: 0 78% 65%;
--salmon-11: 3 100% 77%;
--salmon-12: 4 100% 91%;
--indigo-1: 231 29% 9%;
--indigo-2: 230 31% 11%;
--indigo-3: 225 51% 19%;
--indigo-4: 225 54% 25%;
--indigo-5: 225 52% 30%;
--indigo-6: 226 47% 35%;
--indigo-7: 226 44% 41%;
--indigo-8: 226 45% 48%;
--indigo-9: 226 70% 55%;
--indigo-10: 228 73% 61%;
--indigo-11: 228 100% 81%;
--indigo-12: 224 100% 92%;
--red-1: 0, 17%, 8%;
--red-2: 10, 24%, 10%;
--red-3: 5, 48%, 15%;
--red-4: 4, 64%, 19%;
--red-5: 5, 62%, 23%;
--red-6: 7, 55%, 28%;
--red-7: 9, 49%, 35%;
--red-8: 10, 50%, 45%;
--red-9: 10, 78%, 54%;
--red-10: 11, 82%, 59%;
--red-11: 12, 100%, 75%;
--red-12: 10, 86%, 89%;
}
@tailwind base;
@tailwind components;
@tailwind utilities;
@layer base {
* {
@apply border-border;
}
body {
@apply bg-background text-foreground;
font-feature-settings:
'rlig' 1,
'calt' 1;
}
}
================================================
FILE: src/app/layout.tsx
================================================
import type { Metadata } from 'next';
import { GeistMono } from 'geist/font/mono';
import { GeistSans } from 'geist/font/sans';
import './globals.css';
import { ThemeProvider } from 'next-themes';
import type { PropsWithChildren } from 'react';
import { Analytics } from '@vercel/analytics/react';
import { SpeedInsights } from '@vercel/speed-insights/next';
import { constructMetadata } from '@/utils/construct-metadata';
import { Toaster } from '@/primitives/sonner';
export const metadata: Metadata = constructMetadata();
/**
* The root layout component of the application.
* @param props The props of the root layout.
* @param props.children The children of the root layout which is every page in
* the application.
* @returns A react component representing the root layout.
*/
export default function RootLayout({ children }: PropsWithChildren) {
return (
<html
lang="en"
suppressHydrationWarning
className={`${GeistSans.variable} ${GeistMono.variable}`}
>
<body>
<ThemeProvider attribute="class" disableTransitionOnChange>
{children}
<Toaster />
<Analytics />
<SpeedInsights />
</ThemeProvider>
</body>
</html>
);
}
================================================
FILE: src/app/manifest.ts
================================================
import type { MetadataRoute } from 'next';
import { constants } from '@/constants';
/**
* This function returns an object that represents the manifest.json file which
* next.js uses to create the manifest.json file.
* @returns The manifest.json file configuration.
*/
export default function manifest(): MetadataRoute.Manifest {
return {
name: constants.name,
short_name: constants.shortName,
description: constants.description,
start_url: '/',
display: 'standalone',
background_color: '#111111',
theme_color: '#F86C6A',
icons: [
{
src: '/android-chrome-192x192.png',
sizes: '192x192',
type: 'image/png',
purpose: 'maskable',
},
{
src: '/android-chrome-512x512.png',
sizes: '512x512',
type: 'image/png',
purpose: 'maskable',
},
],
};
}
================================================
FILE: src/app/not-found.tsx
================================================
import { Button } from '@/primitives/button';
import { Footer } from './(site)/_components/footer';
import { Navbar } from './(site)/_components/navbar';
import Link from 'next/link';
import { constants } from '@/constants';
export default function NotFoundPage() {
return (
<div className="flex min-h-dvh flex-col">
<div className="absolute left-0 top-0 z-[-1] h-56 w-full bg-gradient-to-b from-indigo-subtle to-background" />
<Navbar />
<div className="container flex flex-1">
<main className="mb-4 flex flex-1 flex-col items-center justify-center gap-6">
<div className="relative">
<h1 className="text-9xl font-bold text-gray-foreground">404</h1>
</div>
<h2 className="text-4xl font-medium text-gray-foreground">
Oops! Page not found
</h2>
<p className="max-w-prose text-balance text-center text-lg text-foreground-muted">
It looks like this page has gone on an adventure. Maybe it's
hanging out with all those missing socks from the laundry.
</p>
<div className="flex gap-4">
<Button asChild size="lg">
<Link href="/">Return home</Link>
</Button>
<Button asChild size="lg" variant="outline">
<a
href={constants.support}
target="_blank"
rel="noopener noreferrer"
>
Contact support
</a>
</Button>
</div>
</main>
</div>
<Footer />
</div>
);
}
================================================
FILE: src/app/robots.ts
================================================
import type { MetadataRoute } from 'next';
import { getBaseUrl } from '@/utils/base-url';
/**
* This function returns an object that represents the robots.txt file which
* next.js uses to create the robots.txt file.
* @returns The robots.txt file configuration.
*/
export default function robots(): MetadataRoute.Robots {
return {
rules: {
userAgent: '*',
allow: '/',
},
sitemap: `${getBaseUrl()}/sitemap.xml`,
};
}
================================================
FILE: src/constants.tsx
================================================
import {
ClipboardCheckIcon,
DiamondIcon,
Edit3Icon,
ListChecksIcon,
} from 'lucide-react';
export const constants = {
name: 'Noodle - Rethinking Student Productivity',
shortName: 'Noodle',
tagline: 'Rethinking Student Productivity',
description:
'Noodle is a productivity platform including many tools students need to be productive and stay on top of their work such as note taking, task management, and more.',
twitter_handle: '@noodle_run',
github_repo: 'https://github.com/noodle-run/noodle',
domain: 'noodle.run',
discord: 'https://discord.gg/ewKmQd8kYm',
twitter: 'https://x.com/noodle_run',
feedback: 'mailto:feedback@noodle.run',
support: 'mailto:support@noodle.run',
};
export const features = (iconSize: number) => [
{
icon: <Edit3Icon size={iconSize} />,
title: 'Note Taking',
description: 'Write your study notes and let Noodle take care of the rest.',
},
{
icon: <DiamondIcon size={iconSize} />,
title: 'Flashcards',
description:
'Create flashcards with reminders or let AI auto-suggest them for you.',
},
{
icon: <ListChecksIcon size={iconSize} />,
title: 'Task Management',
description:
'Create module specific tasks to keep on track with what you need to do.',
},
{
icon: <ClipboardCheckIcon size={iconSize} />,
title: 'Grade Tracking',
description: 'Find out what you need to achieve to stay in progression.',
},
];
================================================
FILE: src/content/blog/noodle-resurgence.md
================================================
---
title: Noodle is back to life!
publishedAt: Jun 8th, 2024
summary: After a brief period of absence, Noodle is back again in the works. Learn more about what we have been up to, the story until now and what's next in the future of Noodle!
image: /_static/blog/noodle-resurrection.jpg
---
## The Noodle Story
Noodle is a project that has been in the works for a long time now. It has gone through many ups and downs, but it has always been a project that I have been passionate about. I have always believed in the idea behind Noodle and I have always wanted to see it come to life.
### Early Beginnings
Noodle as a concept was born during my university years. I had noticed myself using multiple apps just to try and stay on track with my studies. I was using [Fantastical](https://flexibits.com/fantastical) for my calendar, [Things 3](https://culturedcode.com/things/) for my todos, [Notion](https://notion.so) for note taking, sometimes as well handwritten on my iPad using [Notability](https://notability.com/), and many others like a grade calculator to know where I'm standing with my grades.
It was all just a bit much, there is no way I needed all of that to manage my studies, and why is there no singular app that can do everything a student needs to stay on track with their studies? Like a GitHub but for students.
### The First Attempt
Straight out of graduation, I knew I wanted to work on Noodle and try to make it happen. I teamed up with a friend of mine, [Sinclair](https://x.com/F1VEBORDIER) and we started working on it. I would handle the development of the app and he would handle the business side of things.
The initial launch of the idea of Noodle on GitHub gained massive amounts of traction. We had over 10,000 GitHub stars in no time, without ever being on Product Hunt, Hacker News, or any other platform. It was pure insanity, just from a few tweets.
### The First Failure
With this amount of traction, we had all the eyes on us. The pressure was on, we had to deliver. Unfortunately, working a full time job and trying to build a startup on the side is not an easy task, added with the hype and pressure, it was a recipe for disaster.
Eventually, I had to make a tough decision to put Noodle on hold, I was burning out quickly and I didn't want to ruin the project by releasing something that wasn't up to the standards that I had set for myself.
## The Resurrection
After a brief period of absence, lasting for 6 months, I am happy to announce that Noodle is back in the works. I have taken the time to reflect on what went wrong the first time around and I have learned so much from that experience.
### The Plan Going Forward
First of all, I would like to thank Sinclair for his work towards Noodle. He has decided to step down from the project and I will be the only person working on Noodle for the time being.
I have decided to take a different approach this time around, instead of obsessing over every detail and trying to make everything perfect, I will focus on getting a minimum viable product out there as quickly as possible, one that delivers an improvement to the student productivity life, but not one that has everything just yet.
The plan is to deliver an MVP with Note taking and Flashcards. Note taking is the core principle that revolves around every other feature in Noodle, and that will be the first thing I will be working on.
### The Future of Noodle
I am excited to see where this new journey with Noodle will take me. I have learned so much from the first attempt and I am confident that I will be able to deliver something that I can be proud of this time around.
I will be documenting the progress of Noodle on this blog, so make sure to check back regularly for updates on the project. I am excited to have you all along for the ride and I can't wait to see where this new journey with Noodle will take me.
### Thank You ❤️
I would like to take this opportunity to thank everyone who has supported me and Noodle throughout this journey. Your support means the world to me and I am so grateful for all of the encouragement and kind words that I have received, it has truly been the driving force behind my decision to bring Noodle back to life.
Thank you to everyone on the early access list, which we have over 4000 people signed up for currently, I can't wait to show you what I have been working on very soon!
Make sure you join our [Discord server](https://discord.gg/ewKmQd8kYm) if you want to get the latest updates on Noodle and be part of the community.
================================================
FILE: src/content/legal/privacy.md
================================================
---
title: Privacy Policy
effectiveDate: Jun 8th, 2024
---
## 1. Introduction
Noodle Run LTD ("Noodle") is committed to protecting your privacy. This Privacy Policy explains how we collect, use, and share information about you when you use our website at [https://noodle.run](https://noodle.run)
## 2. Information We Collect
- **Personal Information**: We collect information you provide directly to us, such as your name, email address, and any other information you choose to provide.
- **Usage Data**: We collect information about your interactions with our services, such as IP address, browser type, and access times.
## 3. How We Use Information
We use the information we collect to:
- Provide, maintain, and improve our services.
- Communicate with you about updates, offers, and promotions.
- Protect the rights and property of Noodle and our users.
## 4. Sharing of Information
We do not share your personal information with third parties except as necessary to comply with legal obligations, protect our rights, or with your consent.
## 5. Security
We implement reasonable security measures to protect your information from unauthorized access, use, or disclosure.
## 6. Your Rights
You have the right to access, update, or delete your personal information. To exercise these rights, please contact us at [privacy@noodle.run](mailto:privacy@noodle.run).
## 7. Changes to this Policy
We may update this Privacy Policy from time to time. We will notify you of any changes by posting the new policy on this website.
## 8. Contact Us
If you have any questions about this Privacy Policy, please contact us at [privacy@noodle.run](mailto:privacy@noodle.run).
================================================
FILE: src/content/legal/tos.md
================================================
---
title: Terms of Service
effectiveDate: Jun 8th, 2024
---
## 1. Introduction
Welcome to Noodle Run LTD ("Noodle"). By accessing our website at [https://noodle.run](https://noodle.run) and using our services, you agree to be bound by these Terms of Service ("Terms").
## 2. Use of Services
Noodle grants you a non-exclusive, non-transferable, limited right to access and use our services for personal, non-commercial purposes.
## 3. User Responsibilities
You agree to use our services in compliance with all applicable laws and not to engage in any harmful activities that may disrupt or harm the services.
## 4. Intellectual Property
All content, trademarks, and data on this website are owned by or licensed to Noodle and are protected by applicable intellectual property laws.
## 5. Termination
We may terminate or suspend access to our services immediately, without prior notice or liability, for any reason whatsoever, including without limitation if you breach the Terms.
## 6. Limitation of Liability
In no event shall Noodle, nor its directors, employees, partners, agents, suppliers, or affiliates, be liable for any indirect, incidental, special, consequential, or punitive damages arising out of your use of the services.
## 7. Changes to Terms
We reserve the right to modify these Terms at any time. We will notify you of any changes by posting the new Terms on this website.
## 8. Contact Us
If you have any questions about these Terms, please contact us at [contact@noodle.run](mailto:contact@noodle.run).
================================================
FILE: src/db/index.ts
================================================
import { neon } from '@neondatabase/serverless';
import { drizzle } from 'drizzle-orm/neon-http';
import { env } from '@/env';
import * as schema from './schema';
const sql = neon(env.DATABASE_URL);
export const db = drizzle(sql, {
schema,
logger: env.NODE_ENV === 'development',
});
================================================
FILE: src/db/schema/early-access.ts
================================================
import { boolean, pgTable, text, timestamp, uuid } from 'drizzle-orm/pg-core';
export const earlyAccessTable = pgTable('early_access', {
id: uuid('id').primaryKey().defaultRandom(),
name: text('name').notNull(),
email: text('email').notNull().unique(),
reason: text('reason', { enum: ['student', 'project', 'both'] }).notNull(),
approved: boolean('approved').default(false),
createdAt: timestamp('created_at', {
mode: 'date',
precision: 3,
}).defaultNow(),
invitationSentAt: timestamp('invitation_sent_at', {
mode: 'date',
precision: 3,
}),
});
================================================
FILE: src/db/schema/index.ts
================================================
export * from './early-access';
export * from './modules';
================================================
FILE: src/db/schema/modules.ts
================================================
import {
boolean,
integer,
pgTable,
text,
timestamp,
uuid,
} from 'drizzle-orm/pg-core';
import { createInsertSchema, createSelectSchema } from 'drizzle-zod';
import { z } from 'zod';
export const modulesTable = pgTable('modules', {
id: uuid('id').primaryKey().unique().defaultRandom().notNull(),
user_id: text('user_id').notNull(),
name: text('name').notNull(),
description: text('description'),
code: text('code').notNull(),
icon: text('icon').default('default').notNull(),
color: text('color').default('default').notNull(),
archived: boolean('archived').default(false).notNull(),
credits: integer('credits').default(0).notNull(),
createdAt: timestamp('created_at').notNull().defaultNow(),
modifiedAt: timestamp('modified_at').notNull().defaultNow(),
lastVisited: timestamp('last_visited').notNull().defaultNow(),
});
export const insertModuleSchema = createInsertSchema(modulesTable).extend({
id: z.string().min(1),
description: z.string().optional(),
icon: z.string().default('default'),
color: z.string().default('default'),
archived: z.boolean().default(false),
credits: z.number().default(0),
createdAt: z.date().default(new Date()),
modifiedAt: z.date().default(new Date()),
lastVisited: z.date().default(new Date()),
});
export type InsertModuleInput = z.infer<typeof insertModuleSchema>;
export const selectModuleSchema = createSelectSchema(modulesTable);
================================================
FILE: src/emails/layouts/Base.tsx
================================================
import {
Body,
Container,
Font,
Head,
Html,
Preview,
Tailwind,
} from '@react-email/components';
import { emailTailwindConfig } from '../tailwind';
import type { PropsWithChildren } from 'react';
import { emailBaseUrl } from '../utils';
import { cn } from '@/utils/cn';
type Props = PropsWithChildren<{
title: string;
previewText: string;
className?: string;
}>;
export const BaseEmailLayout = ({
children,
title,
previewText,
className,
}: Props) => {
return (
<Tailwind config={emailTailwindConfig}>
<Html lang="en" dir="ltr">
<Head>
<title>{title}</title>
<Font
fontFamily="Geist Mono"
fallbackFontFamily="monospace"
webFont={{
url: `${emailBaseUrl()}/_static/fonts/GeistMono-Variable.ttf`,
format: 'truetype',
}}
/>
<Font
fontFamily="Geist"
fallbackFontFamily="sans-serif"
webFont={{
url: `${emailBaseUrl()}/_static/fonts/Geist-Variable.ttf`,
format: 'truetype',
}}
/>
</Head>
<Preview>{previewText}</Preview>
<Body>
<Container className={cn('px-3', className)}>{children}</Container>
</Body>
</Html>
</Tailwind>
);
};
================================================
FILE: src/emails/tailwind.ts
================================================
import type { TailwindConfig } from '@react-email/components';
import { gray, indigo, tomato } from '@radix-ui/colors';
/**
* This config is used for the emails, hence why it's almost the same as the normal tailwind config, just more verbose.
*/
export const emailTailwindConfig = {
theme: {
container: {
center: true,
padding: '2rem',
screens: {
'2xl': '1400px',
},
},
colors: {
black: '#000',
white: '#fff',
transparent: 'transparent',
current: 'currentColor',
background: gray.gray1,
foreground: gray.gray12,
'foreground-muted': gray.gray11,
border: gray.gray4,
gray: {
DEFAULT: gray.gray9,
'foreground-muted': gray.gray11,
foreground: gray.gray12,
app: gray.gray1,
subtle: gray.gray2,
'subtle-border': gray.gray6,
element: gray.gray3,
'element-hover': gray.gray4,
'element-active': gray.gray5,
'element-border': gray.gray7,
'element-border-hover': gray.gray8,
solid: gray.gray9,
'solid-hover': gray.gray10,
},
pink: {
DEFAULT: 'hsl(339 99% 66%)',
'foreground-muted': 'hsl(335 71% 46%)',
foreground: 'hsl(338 62% 24%)',
app: 'hsl(340 100% 99%)',
subtle: 'hsl(351 78% 98%)',
'subtle-border': 'hsl(345 71% 85%)',
element: 'hsl(346 100% 96%)',
'element-hover': 'hsl(346 100% 93%)',
'element-active': 'hsl(347 85% 90%)',
'element-border': 'hsl(345 61% 80%)',
'element-border-hover': 'hsl(345 57% 73%)',
solid: 'hsl(339 99% 66%)',
'solid-hover': 'hsl(338 85% 61%)',
},
salmon: {
DEFAULT: 'hsl(1 91% 69%)',
'foreground-muted': 'hsl(359 57% 53%)',
foreground: 'hsl(3 36% 25%)',
app: 'hsl(0 50% 99%)',
subtle: 'hsl(7 100% 98%)',
'subtle-border': 'hsl(4 100% 86%)',
element: 'hsl(5 100 96%)',
'element-hover': 'hsl(6 100% 92%)',
'element-active': 'hsl(5 100% 88%)',
'element-border': 'hsl(4 79% 80%)',
'element-border-hover': 'hsl(3 70% 73%)',
solid: 'hsl(1 91% 69%)',
'solid-hover': 'hsl(0 79% 65%)',
},
indigo: {
DEFAULT: indigo.indigo9,
'foreground-muted': indigo.indigo11,
foreground: indigo.indigo12,
app: indigo.indigo1,
subtle: indigo.indigo2,
'subtle-border': indigo.indigo6,
element: indigo.indigo3,
'element-hover': indigo.indigo4,
'element-active': indigo.indigo5,
'element-border': indigo.indigo7,
'element-border-hover': indigo.indigo8,
solid: indigo.indigo9,
'solid-hover': indigo.indigo10,
},
red: {
DEFAULT: tomato.tomato9,
'foreground-muted': tomato.tomato11,
foreground: tomato.tomato12,
app: tomato.tomato1,
subtle: tomato.tomato2,
'subtle-border': tomato.tomato6,
element: tomato.tomato3,
'element-hover': tomato.tomato4,
'element-active': tomato.tomato5,
'element-border': tomato.tomato7,
'element-border-hover': tomato.tomato8,
solid: tomato.tomato9,
'solid-hover': tomato.tomato10,
},
},
fontFamily: {
sans: ['Geist'],
mono: ['Geist Mono'],
},
fontSize: {
xs: ['12px', { lineHeight: '16px' }],
sm: ['14px', { lineHeight: '20px' }],
base: ['16px', { lineHeight: '24px' }],
lg: ['18px', { lineHeight: '28px' }],
xl: ['20px', { lineHeight: '28px' }],
'2xl': ['24px', { lineHeight: '32px' }],
'3xl': ['30px', { lineHeight: '36px' }],
'4xl': ['36px', { lineHeight: '36px' }],
'5xl': ['48px', { lineHeight: '1' }],
'6xl': ['60px', { lineHeight: '1' }],
'7xl': ['72px', { lineHeight: '1' }],
'8xl': ['96px', { lineHeight: '1' }],
'9xl': ['144px', { lineHeight: '1' }],
},
spacing: {
px: '1px',
0: '0',
0.5: '2px',
1: '4px',
1.5: '6px',
2: '8px',
2.5: '10px',
3: '12px',
3.5: '14px',
4: '16px',
5: '20px',
6: '24px',
7: '28px',
8: '32px',
9: '36px',
10: '40px',
11: '44px',
12: '48px',
14: '56px',
16: '64px',
20: '80px',
24: '96px',
28: '112px',
32: '128px',
36: '144px',
40: '160px',
44: '176px',
48: '192px',
52: '208px',
56: '224px',
60: '240px',
64: '256px',
72: '288px',
80: '320px',
96: '384px',
},
},
} satisfies TailwindConfig;
================================================
FILE: src/emails/templates/early-access-joined.tsx
================================================
import { Heading, Img, Link, Text } from '@react-email/components';
import { BaseEmailLayout } from '../layouts/Base';
import { emailBaseUrl } from '../utils';
import { constants } from '@/constants';
interface Props {
name: string;
email: string;
}
export default function EarlyAccessJoinedEmail({ name, email }: Props) {
return (
<BaseEmailLayout
title={`${name}, you have joined Noodle's early access list!`}
previewText={`Hey ${name}, this is to just let you know that you have joined Noodle's early access waiting list.`}
className="py-8"
>
<Img
src={`${emailBaseUrl()}/logo.svg`}
width={50}
height={50}
alt="Noodle logo"
/>
<Heading as="h1" className="my-0 pb-0 pt-6 font-medium">
You are on the list!
</Heading>
<Text className="my-0 pt-4">
Hey {name}, Ahmed here, founder and creator of Noodle.
</Text>
<Text>
I wanted to thank you for joining Noodle's early access list. I am
super excited to have you on board and can't wait for you to start
using Noodle.
</Text>
<Text>
I am currently working hard to get Noodle ready for you and will be in
touch soon to let you know when you can access and start using it. Just
make sure to sign in using the same email you joined the early access
list with, which is{' '}
<Link className="text-pink underline underline-offset-4">{email}</Link>.
</Text>
<Text>
You can join our{' '}
<Link
href={constants.discord}
className="text-pink underline underline-offset-4"
>
Discord server
</Link>{' '}
in the meantime to stay up to date and to share your thoughts and
feedback, helping shape Noodle into the best product it can be.
</Text>
</BaseEmailLayout>
);
}
EarlyAccessJoinedEmail.PreviewProps = {
firstName: 'John',
email: 'johndoe@example.com',
};
================================================
FILE: src/emails/utils.ts
================================================
import { constants } from '@/constants';
import { env } from '@/env';
/**
* This is used to get the base URL of the assets that the email templates can use.
* @returns The correct URL.
*/
export const emailBaseUrl = () => {
if (env.NODE_ENV === 'development') {
return 'http://localhost:3000';
}
if (env.VERCEL_URL) {
return `https://${env.VERCEL_URL}`;
}
return `https://${constants.domain}`;
};
================================================
FILE: src/env.ts
================================================
import { createEnv } from '@t3-oss/env-nextjs';
import { vercel } from '@t3-oss/env-nextjs/presets';
import { z } from 'zod';
export const env = createEnv({
extends: [vercel()],
shared: {
NODE_ENV: z
.enum(['development', 'production', 'test'])
.default('development'),
},
server: {
PORT: z.coerce.number().default(3000),
// Neon DB
DATABASE_URL: z.string().url(),
// Upstash
UPSTASH_REDIS_REST_URL: z.string(),
UPSTASH_REDIS_REST_TOKEN: z.string(),
// Resend
RESEND_API_KEY: z.string(),
// Clerk
CLERK_SECRET_KEY: z.string(),
},
client: {
// Clerk
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY: z.string(),
},
experimental__runtimeEnv: {
NODE_ENV: process.env.NODE_ENV,
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY:
process.env['NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY'],
},
skipValidation: !!process.env['SKIP_ENV_VALIDATION'],
emptyStringAsUndefined: true,
});
================================================
FILE: src/lib/mdx.ts
================================================
import fs from 'node:fs/promises';
import path from 'path';
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-parameters
function parseFrontmatter<T extends Record<string, unknown>>(
fileContent: string,
) {
const frontmatterRegex = /---\n([\s\S]*?)\n---/;
const match = frontmatterRegex.exec(fileContent);
if (!match) {
throw new Error('No frontmatter found');
}
const frontMatterBlock = match[1];
const content = fileContent.replace(frontmatterRegex, '').trim();
const frontMatterLines = frontMatterBlock?.trim().split('\n');
const metadata: Partial<T> = {};
frontMatterLines?.forEach((line) => {
const [key, ...valueArr] = line.split(': ');
let value = valueArr.join(': ').trim();
value = value.replace(/^['"](.*)['"]$/, '$1');
if (!key) {
throw new Error('Invalid frontmatter');
}
(metadata as Record<string, unknown>)[key.trim()] = value;
});
return { metadata: metadata as T, content };
}
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-parameters
async function getMDXData<T extends Record<string, unknown>>(dir: string) {
const files = await fs.readdir(dir);
const mdxFiles = files.filter(
(file) => path.extname(file) === '.mdx' || path.extname(file) === '.md',
);
const mapped = await Promise.all(
mdxFiles.map(async (file) => {
const rawContent = await fs.readFile(path.join(dir, file), 'utf-8');
const { metadata, content } = parseFrontmatter<T>(rawContent);
const slug = path.basename(file, path.extname(file));
return {
metadata,
slug,
content,
};
}),
);
return mapped;
}
interface BlogMetadata {
[key: string]: unknown;
title: string;
publishedAt: string;
summary: string;
image?: string;
}
interface LegalMetadata {
[key: string]: unknown;
title: string;
effectiveDate: string;
}
export function getBlogPosts() {
return getMDXData<BlogMetadata>(path.join(process.cwd(), 'src/content/blog'));
}
export function getLegalDocs() {
return getMDXData<LegalMetadata>(
path.join(process.cwd(), 'src/content/legal'),
);
}
================================================
FILE: src/lib/redis.ts
================================================
import { Redis } from '@upstash/redis';
import { env } from '@/env';
export const redis = new Redis({
url: env.UPSTASH_REDIS_REST_URL,
token: env.UPSTASH_REDIS_REST_TOKEN,
});
================================================
FILE: src/lib/resend.ts
================================================
import { env } from '@/env';
import { Resend } from 'resend';
export const resend = new Resend(env.RESEND_API_KEY);
================================================
FILE: src/lib/trpc/react.tsx
================================================
'use client';
import { useState } from 'react';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import { loggerLink, unstable_httpBatchStreamLink } from '@trpc/client';
import { createTRPCReact } from '@trpc/react-query';
import superjson from 'superjson';
import { getBaseUrl } from '@/utils/base-url';
import { type AppRouter } from '@/server';
const createQueryClient = () => new QueryClient();
let clientQueryClientSingleton: QueryClient | undefined = undefined;
const getQueryClient = () => {
if (typeof window === 'undefined') {
return createQueryClient();
}
return (clientQueryClientSingleton ??= createQueryClient());
};
export const api = createTRPCReact<AppRouter>();
/**
* The TRPC React Provider is a component that initializes trpc and react query.
* @param props Props for the TRPC React Provider.
* @param props.children The children of the TRPC React Provider, which would be
* the entire page/layout in most cases.
* @returns React Provider component that initializes trpc and react query
* integration for the client.
*/
export function TRPCReactProvider(props: { children: React.ReactNode }) {
const queryClient = getQueryClient();
const [trpcClient] = useState(() =>
api.createClient({
links: [
loggerLink({
enabled: (op) =>
process.env.NODE_ENV === 'development' ||
(op.direction === 'down' && op.result instanceof Error),
}),
unstable_httpBatchStreamLink({
transformer: superjson,
url: getBaseUrl() + '/api/trpc',
headers: () => {
const headers = new Headers();
headers.set('x-trpc-source', 'nextjs-react');
return headers;
},
}),
],
}),
);
return (
<QueryClientProvider client={queryClient}>
<api.Provider client={trpcClient} queryClient={queryClient}>
{props.children}
</api.Provider>
</QueryClientProvider>
);
}
================================================
FILE: src/lib/trpc/server.ts
================================================
import 'server-only';
import { cache } from 'react';
import { headers } from 'next/headers';
import { createCaller } from '@/server';
import { createTRPCContext } from '@/server/trpc';
const createContext = cache(() => {
const heads = new Headers(headers());
heads.set('x-trpc-source', 'rsc');
return createTRPCContext({
headers: heads,
});
});
export const api = createCaller(createContext);
================================================
FILE: src/lib/trpc/types.ts
================================================
import type { AppRouter } from '@/server';
import type { inferReactQueryProcedureOptions } from '@trpc/react-query';
import type { inferRouterInputs, inferRouterOutputs } from '@trpc/server';
export type ReactQueryOptions = inferReactQueryProcedureOptions<AppRouter>;
export type RouterInputs = inferRouterInputs<AppRouter>;
export type RouterOutputs = inferRouterOutputs<AppRouter>;
================================================
FILE: src/mdx-components.tsx
================================================
import type { MDXComponents } from 'mdx/types';
import { buttonVariants } from './primitives/button';
import { cn } from '@/utils/cn';
export function useMDXComponents(components: MDXComponents): MDXComponents {
return {
h1: ({ children, ...props }) => (
<h1 className="text-2xl font-medium md:text-3xl" {...props}>
{children}
</h1>
),
h2: ({ children, ...props }) => (
<h2
className="mb-3 mt-4 text-xl font-medium md:mt-6 md:text-2xl"
{...props}
>
{children}
</h2>
),
p: ({ children, ...props }) => (
<p className="mb-3 text-sm text-foreground-muted md:text-base" {...props}>
{children}
</p>
),
ul: ({ children, ...props }) => (
<ul className="list-disc pl-8" {...props}>
{children}
</ul>
),
li: ({ children, ...props }) => (
<li
className="mb-1.5 text-sm text-foreground-muted md:text-base"
{...props}
>
{children}
</li>
),
strong: ({ children, ...props }) => (
<strong className="text-foreground" {...props}>
{children}
</strong>
),
a: ({ children, ...props }) => (
<a
className={cn(
buttonVariants({ variant: 'link' }),
'p-0 font-bold before:w-full',
)}
{...props}
>
{children}
</a>
),
...components,
};
}
================================================
FILE: src/middleware.ts
================================================
import { clerkMiddleware, createRouteMatcher } from '@clerk/nextjs/server';
const isProtectedRoute = createRouteMatcher(['/app(.*)']);
export default clerkMiddleware((auth, req) => {
if (isProtectedRoute(req)) {
auth().protect();
}
});
export const config = {
matcher: [
'/((?!_next|[^?]*\\.(?:html?|css|js(?!on)|jpe?g|webp|png|gif|svg|ttf|woff2?|ico|csv|docx?|xlsx?|zip|webmanifest)).*)',
'/(api|trpc)(.*)',
],
};
================================================
FILE: src/primitives/button.tsx
================================================
import * as React from 'react';
import type { VariantProps } from 'class-variance-authority';
import { Slot } from '@radix-ui/react-slot';
import { cva } from 'class-variance-authority';
import { cn } from '@/utils/cn';
const buttonVariants = cva(
'inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-gray-subtle-border focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50',
{
variants: {
variant: {
default:
'bg-gradient-to-br from-salmon to-pink text-white hover:opacity-90 dark:text-black',
destructive: 'bg-red text-white hover:bg-red-solid-hover',
outline:
'border border-gray-subtle-border bg-gray-element text-foreground-muted hover:bg-gray-element-hover hover:text-foreground',
ghost:
'text-foreground-muted hover:bg-gray-element hover:text-foreground',
link: 'relative bg-gradient-to-br from-salmon to-pink bg-clip-text text-transparent before:absolute before:bottom-0 before:h-px before:w-[calc(100%-24px)] before:rounded-full before:bg-gradient-to-br before:from-salmon before:to-pink hover:opacity-90',
},
size: {
default: 'px-4 py-2',
sm: 'px-3 py-1.5',
lg: 'px-3 py-1.5 lg:px-4 lg:py-2 lg:text-base',
icon: 'size-10',
},
},
defaultVariants: {
variant: 'default',
size: 'default',
},
},
);
export interface ButtonProps
extends React.ButtonHTMLAttributes<HTMLButtonElement>,
VariantProps<typeof buttonVariants> {
asChild?: boolean;
}
const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
({ className, variant, size, asChild = false, ...props }, ref) => {
const Comp = asChild ? Slot : 'button';
return (
<Comp
className={cn(buttonVariants({ variant, size, className }))}
ref={ref}
{...props}
/>
);
},
);
Button.displayName = 'Button';
export { Button, buttonVariants };
================================================
FILE: src/primitives/checkbox.tsx
================================================
'use client';
import * as React from 'react';
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
import { CheckIcon } from 'lucide-react';
import { cn } from '@/utils/cn';
const Checkbox = React.forwardRef<
React.ElementRef<typeof CheckboxPrimitive.Root>,
React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>
>(({ className, ...props }, ref) => (
<CheckboxPrimitive.Root
ref={ref}
className={cn(
'peer flex size-[18px] shrink-0 items-center justify-center rounded-md border border-gray-subtle-border text-transparent shadow transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-pink-solid-hover disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:border-pink data-[state=checked]:bg-salmon data-[state=checked]:text-white dark:data-[state=checked]:text-black',
className,
)}
{...props}
>
<CheckboxPrimitive.Indicator
className={cn('flex items-center justify-center text-current')}
>
<CheckIcon className="size-4" strokeWidth={3} />
</CheckboxPrimitive.Indicator>
</CheckboxPrimitive.Root>
));
Checkbox.displayName = CheckboxPrimitive.Root.displayName;
export { Checkbox };
================================================
FILE: src/primitives/dropdown-menu.tsx
================================================
'use client';
import * as React from 'react';
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
import { CheckIcon, ChevronRightIcon, CircleIcon } from 'lucide-react';
import { cn } from '@/utils/cn';
const DropdownMenu = DropdownMenuPrimitive.Root;
const DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
const DropdownMenuGroup = DropdownMenuPrimitive.Group;
const DropdownMenuPortal = DropdownMenuPrimitive.Portal;
const DropdownMenuSub = DropdownMenuPrimitive.Sub;
const DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
const DropdownMenuSubTrigger = React.forwardRef<
React.ElementRef<typeof DropdownMenuPrimitive.SubTrigger>,
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> & {
inset?: boolean;
}
>(({ className, inset, children, ...props }, ref) => (
<DropdownMenuPrimitive.SubTrigger
ref={ref}
className={cn(
'flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-gray-element-active data-[state=open]:bg-gray-element-active',
inset && 'pl-8',
className,
)}
{...props}
>
{children}
<ChevronRightIcon className="ml-auto size-4" />
</DropdownMenuPrimitive.SubTrigger>
));
DropdownMenuSubTrigger.displayName =
DropdownMenuPrimitive.SubTrigger.displayName;
const DropdownMenuSubContent = React.forwardRef<
React.ElementRef<typeof DropdownMenuPrimitive.SubContent>,
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>
>(({ className, ...props }, ref) => (
<DropdownMenuPrimitive.SubContent
ref={ref}
className={cn(
'z-50 min-w-32 overflow-hidden rounded-md border bg-gray-element p-1 text-gray-foreground-muted shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2',
className,
)}
{...props}
/>
));
DropdownMenuSubContent.displayName =
DropdownMenuPrimitive.SubContent.displayName;
const DropdownMenuContent = React.forwardRef<
React.ElementRef<typeof DropdownMenuPrimitive.Content>,
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>
>(({ className, sideOffset = 4, ...props }, ref) => (
<DropdownMenuPrimitive.Portal>
<DropdownMenuPrimitive.Content
ref={ref}
sideOffset={sideOffset}
className={cn(
'z-50 min-w-32 overflow-hidden rounded-md border bg-gray-subtle p-1.5 text-gray-foreground-muted shadow-md',
'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2',
className,
)}
{...props}
/>
</DropdownMenuPrimitive.Portal>
));
DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
const DropdownMenuItem = React.forwardRef<
React.ElementRef<typeof DropdownMenuPrimitive.Item>,
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> & {
inset?: boolean;
}
>(({ className, inset, ...props }, ref) => (
<DropdownMenuPrimitive.Item
ref={ref}
className={cn(
'relative flex cursor-default select-none items-center rounded-md px-2 py-1.5 text-sm outline-none transition-colors focus:bg-gray-element-hover focus:text-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
inset && 'pl-8',
className,
)}
{...props}
/>
));
DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
const DropdownMenuCheckboxItem = React.forwardRef<
React.ElementRef<typeof DropdownMenuPrimitive.CheckboxItem>,
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>
>(({ className, children, checked = false, ...props }, ref) => (
<DropdownMenuPrimitive.CheckboxItem
ref={ref}
className={cn(
'relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-gray-element-active focus:text-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
className,
)}
checked={checked}
{...props}
>
<span className="absolute left-2 flex size-3.5 items-center justify-center">
<DropdownMenuPrimitive.ItemIndicator>
<CheckIcon className="size-4" />
</DropdownMenuPrimitive.ItemIndicator>
</span>
{children}
</DropdownMenuPrimitive.CheckboxItem>
));
DropdownMenuCheckboxItem.displayName =
DropdownMenuPrimitive.CheckboxItem.displayName;
const DropdownMenuRadioItem = React.forwardRef<
React.ElementRef<typeof DropdownMenuPrimitive.RadioItem>,
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem>
>(({ className, children, ...props }, ref) => (
<DropdownMenuPrimitive.RadioItem
ref={ref}
className={cn(
'relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-gray-element-active focus:text-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
className,
)}
{...props}
>
<span className="absolute left-2 flex size-3.5 items-center justify-center">
<DropdownMenuPrimitive.ItemIndicator>
<CircleIcon className="size-4 fill-current" />
</DropdownMenuPrimitive.ItemIndicator>
</span>
{children}
</DropdownMenuPrimitive.RadioItem>
));
DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
const DropdownMenuLabel = React.forwardRef<
React.ElementRef<typeof DropdownMenuPrimitive.Label>,
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> & {
inset?: boolean;
}
>(({ className, inset, ...props }, ref) => (
<DropdownMenuPrimitive.Label
ref={ref}
className={cn(
'px-2 py-1.5 text-sm font-semibold',
inset && 'pl-8',
className,
)}
{...props}
/>
));
DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
const DropdownMenuSeparator = React.forwardRef<
React.ElementRef<typeof DropdownMenuPrimitive.Separator>,
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>
>(({ className, ...props }, ref) => (
<DropdownMenuPrimitive
gitextract_hjjugdiq/ ├── .changeset/ │ └── config.json ├── .editorconfig ├── .github/ │ ├── FUNDING.yaml │ ├── ISSUE_TEMPLATE/ │ │ ├── bug_report.md │ │ ├── config.yaml │ │ └── feature_request.md │ ├── PULL_REQUEST_TEMPLATE/ │ │ └── pull_request_template.md │ └── workflows/ │ ├── main-ci.yml │ ├── pr-ci.yml │ └── pr-cleanup.yml ├── .gitignore ├── .husky/ │ ├── commit-msg │ ├── pre-commit │ └── prepare-commit-msg ├── .markdownlint.json ├── .prettierignore ├── .vscode/ │ ├── extensions.json │ └── settings.json ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── SECURITY.md ├── bun.lockb ├── cspell.config.yaml ├── drizzle/ │ ├── 0000_funny_johnny_blaze.sql │ ├── 0001_minor_warlock.sql │ ├── 0002_complex_sally_floyd.sql │ └── meta/ │ ├── 0000_snapshot.json │ ├── 0001_snapshot.json │ ├── 0002_snapshot.json │ └── _journal.json ├── drizzle.config.ts ├── eslint.config.js ├── eslint.d.ts ├── next.config.js ├── package.json ├── postcss.config.js ├── prettier.config.js ├── public/ │ ├── .well-known/ │ │ └── security.txt │ └── browserconfig.xml ├── reset.d.ts ├── src/ │ ├── app/ │ │ ├── (dashboard)/ │ │ │ ├── (auth)/ │ │ │ │ ├── sign-in/ │ │ │ │ │ └── [[...sign-in]]/ │ │ │ │ │ └── page.tsx │ │ │ │ └── sign-up/ │ │ │ │ └── [[...sign-in]]/ │ │ │ │ └── page.tsx │ │ │ ├── app/ │ │ │ │ ├── _components/ │ │ │ │ │ ├── active-button.tsx │ │ │ │ │ ├── create-module-popover.tsx │ │ │ │ │ ├── module-card.tsx │ │ │ │ │ ├── recent-modules.tsx │ │ │ │ │ ├── side-menu.tsx │ │ │ │ │ └── welcome-message.tsx │ │ │ │ ├── layout.tsx │ │ │ │ ├── lib/ │ │ │ │ │ └── color-choices.ts │ │ │ │ ├── module/ │ │ │ │ │ └── [id]/ │ │ │ │ │ └── page.tsx │ │ │ │ └── page.tsx │ │ │ └── layout.tsx │ │ ├── (site)/ │ │ │ ├── (legal)/ │ │ │ │ ├── layout.tsx │ │ │ │ ├── privacy/ │ │ │ │ │ └── page.tsx │ │ │ │ └── tos/ │ │ │ │ └── page.tsx │ │ │ ├── _components/ │ │ │ │ ├── custom-mdx.tsx │ │ │ │ ├── footer.tsx │ │ │ │ └── navbar.tsx │ │ │ ├── blog/ │ │ │ │ ├── [slug]/ │ │ │ │ │ └── page.tsx │ │ │ │ └── page.tsx │ │ │ ├── early-access/ │ │ │ │ ├── _forms/ │ │ │ │ │ └── join.tsx │ │ │ │ ├── layout.tsx │ │ │ │ └── page.tsx │ │ │ ├── layout.tsx │ │ │ └── page.tsx │ │ ├── api/ │ │ │ └── trpc/ │ │ │ └── [trpc]/ │ │ │ └── route.ts │ │ ├── globals.css │ │ ├── layout.tsx │ │ ├── manifest.ts │ │ ├── not-found.tsx │ │ └── robots.ts │ ├── constants.tsx │ ├── content/ │ │ ├── blog/ │ │ │ └── noodle-resurgence.md │ │ └── legal/ │ │ ├── privacy.md │ │ └── tos.md │ ├── db/ │ │ ├── index.ts │ │ └── schema/ │ │ ├── early-access.ts │ │ ├── index.ts │ │ └── modules.ts │ ├── emails/ │ │ ├── layouts/ │ │ │ └── Base.tsx │ │ ├── tailwind.ts │ │ ├── templates/ │ │ │ └── early-access-joined.tsx │ │ └── utils.ts │ ├── env.ts │ ├── lib/ │ │ ├── mdx.ts │ │ ├── redis.ts │ │ ├── resend.ts │ │ └── trpc/ │ │ ├── react.tsx │ │ ├── server.ts │ │ └── types.ts │ ├── mdx-components.tsx │ ├── middleware.ts │ ├── primitives/ │ │ ├── button.tsx │ │ ├── checkbox.tsx │ │ ├── dropdown-menu.tsx │ │ ├── form.tsx │ │ ├── icon.tsx │ │ ├── input.tsx │ │ ├── label.tsx │ │ ├── navigation-menu.tsx │ │ ├── popover.tsx │ │ ├── resizable-panel.tsx │ │ ├── scroll-area.tsx │ │ ├── select.tsx │ │ ├── separator.tsx │ │ ├── skeleton.tsx │ │ ├── sonner.tsx │ │ ├── tabs.tsx │ │ └── textarea.tsx │ ├── server/ │ │ ├── index.ts │ │ ├── routers/ │ │ │ ├── early-access.ts │ │ │ └── modules.ts │ │ └── trpc.ts │ └── utils/ │ ├── base-url.ts │ ├── cn.ts │ └── construct-metadata.ts ├── tailwind.config.ts └── tsconfig.json
SYMBOL INDEX (76 symbols across 52 files)
FILE: drizzle/0000_funny_johnny_blaze.sql
type "early_access" (line 1) | CREATE TABLE IF NOT EXISTS "early_access" (
FILE: drizzle/0001_minor_warlock.sql
type "modules" (line 1) | CREATE TABLE IF NOT EXISTS "modules" (
FILE: eslint.d.ts
class FlatCompat (line 27) | class FlatCompat {
FILE: src/app/(dashboard)/(auth)/sign-in/[[...sign-in]]/page.tsx
function Page (line 7) | function Page() {
FILE: src/app/(dashboard)/(auth)/sign-up/[[...sign-in]]/page.tsx
function Page (line 7) | function Page() {
FILE: src/app/(dashboard)/app/_components/active-button.tsx
type Props (line 9) | interface Props {
function ActiveButton (line 15) | function ActiveButton({ href, label, icon }: Props) {
FILE: src/app/(dashboard)/app/_components/create-module-popover.tsx
type StepHeadingProps (line 32) | interface StepHeadingProps {
type IconPickerProps (line 49) | interface IconPickerProps {
function IconPicker (line 53) | function IconPicker({ iconOnClickHandler }: IconPickerProps) {
function CreateModulePopover (line 100) | function CreateModulePopover() {
FILE: src/app/(dashboard)/app/_components/module-card.tsx
type ModuleCardProps (line 7) | interface ModuleCardProps {
function ModuleCard (line 15) | function ModuleCard({
FILE: src/app/(dashboard)/app/_components/recent-modules.tsx
type RecentModulesProps (line 12) | interface RecentModulesProps {
function RecentModules (line 16) | function RecentModules({ modules }: RecentModulesProps) {
FILE: src/app/(dashboard)/app/_components/side-menu.tsx
function SideMenu (line 37) | async function SideMenu() {
FILE: src/app/(dashboard)/app/_components/welcome-message.tsx
function WelcomeMessage (line 6) | function WelcomeMessage() {
FILE: src/app/(dashboard)/app/layout.tsx
function AppLayout (line 7) | function AppLayout({ children }: PropsWithChildren) {
FILE: src/app/(dashboard)/app/module/[id]/page.tsx
type Props (line 17) | interface Props {
type UserModule (line 23) | type UserModule = RouterOutputs['modules']['getById'];
function ModulePage (line 25) | async function ModulePage({ params }: Props) {
FILE: src/app/(dashboard)/app/page.tsx
function DashboardHome (line 5) | async function DashboardHome() {
FILE: src/app/(dashboard)/layout.tsx
function DashboardLayout (line 12) | function DashboardLayout({ children }: PropsWithChildren) {
FILE: src/app/(site)/(legal)/layout.tsx
function LegalLayout (line 3) | function LegalLayout({ children }: PropsWithChildren) {
FILE: src/app/(site)/(legal)/privacy/page.tsx
function PrivacyPage (line 5) | async function PrivacyPage() {
FILE: src/app/(site)/(legal)/tos/page.tsx
function TermsPage (line 5) | async function TermsPage() {
FILE: src/app/(site)/_components/custom-mdx.tsx
function createHeading (line 9) | function createHeading(level: 1 | 2 | 3 | 4 | 5 | 6, className: string) {
function CustomMDX (line 100) | function CustomMDX(props: MDXRemoteProps) {
FILE: src/app/(site)/blog/[slug]/page.tsx
type Props (line 11) | interface Props {
function generateMetadata (line 17) | async function generateMetadata({
function Home (line 44) | async function Home({ params }: Props) {
FILE: src/app/(site)/blog/page.tsx
function BlogPage (line 6) | async function BlogPage() {
FILE: src/app/(site)/early-access/_forms/join.tsx
function onSubmit (line 57) | function onSubmit(values: z.infer<typeof formSchema>) {
FILE: src/app/(site)/early-access/layout.tsx
function EarlyAccessLayout (line 4) | function EarlyAccessLayout({ children }: PropsWithChildren) {
FILE: src/app/(site)/early-access/page.tsx
function EarlyAccessPage (line 10) | function EarlyAccessPage() {
FILE: src/app/(site)/layout.tsx
function RootLayout (line 13) | function RootLayout({ children }: PropsWithChildren) {
FILE: src/app/(site)/page.tsx
function Home (line 13) | function Home() {
FILE: src/app/layout.tsx
function RootLayout (line 26) | function RootLayout({ children }: PropsWithChildren) {
FILE: src/app/manifest.ts
function manifest (line 10) | function manifest(): MetadataRoute.Manifest {
FILE: src/app/not-found.tsx
function NotFoundPage (line 7) | function NotFoundPage() {
FILE: src/app/robots.ts
function robots (line 10) | function robots(): MetadataRoute.Robots {
FILE: src/db/schema/modules.ts
type InsertModuleInput (line 39) | type InsertModuleInput = z.infer<typeof insertModuleSchema>;
FILE: src/emails/layouts/Base.tsx
type Props (line 15) | type Props = PropsWithChildren<{
FILE: src/emails/templates/early-access-joined.tsx
type Props (line 6) | interface Props {
function EarlyAccessJoinedEmail (line 11) | function EarlyAccessJoinedEmail({ name, email }: Props) {
FILE: src/lib/mdx.ts
function parseFrontmatter (line 5) | function parseFrontmatter<T extends Record<string, unknown>>(
function getMDXData (line 32) | async function getMDXData<T extends Record<string, unknown>>(dir: string) {
type BlogMetadata (line 54) | interface BlogMetadata {
type LegalMetadata (line 62) | interface LegalMetadata {
function getBlogPosts (line 68) | function getBlogPosts() {
function getLegalDocs (line 72) | function getLegalDocs() {
FILE: src/lib/trpc/react.tsx
function TRPCReactProvider (line 33) | function TRPCReactProvider(props: { children: React.ReactNode }) {
FILE: src/lib/trpc/types.ts
type ReactQueryOptions (line 5) | type ReactQueryOptions = inferReactQueryProcedureOptions<AppRouter>;
type RouterInputs (line 6) | type RouterInputs = inferRouterInputs<AppRouter>;
type RouterOutputs (line 7) | type RouterOutputs = inferRouterOutputs<AppRouter>;
FILE: src/mdx-components.tsx
function useMDXComponents (line 5) | function useMDXComponents(components: MDXComponents): MDXComponents {
FILE: src/primitives/button.tsx
type ButtonProps (line 38) | interface ButtonProps
FILE: src/primitives/form.tsx
type FormFieldContextValue (line 17) | interface FormFieldContextValue<
type FormItemContextValue (line 65) | interface FormItemContextValue {
FILE: src/primitives/icon.tsx
type Props (line 3) | interface Props {
type IconNames (line 19) | type IconNames = keyof typeof icons;
FILE: src/primitives/input.tsx
type InputProps (line 5) | type InputProps = React.InputHTMLAttributes<HTMLInputElement>;
FILE: src/primitives/resizable-panel.tsx
function ResizablePanel (line 21) | function ResizablePanel({ children }: PropsWithChildren) {
FILE: src/primitives/skeleton.tsx
function Skeleton (line 3) | function Skeleton({
FILE: src/primitives/sonner.tsx
type ToasterProps (line 6) | type ToasterProps = React.ComponentProps<typeof Sonner>;
FILE: src/primitives/textarea.tsx
type TextareaProps (line 5) | type TextareaProps = React.TextareaHTMLAttributes<HTMLTextAreaElement>;
FILE: src/server/index.ts
type AppRouter (line 11) | type AppRouter = typeof appRouter;
FILE: src/server/routers/early-access.ts
function isEmailGibberish (line 81) | function isEmailGibberish(username: string): boolean {
function hasAlternatingCharsAndNumbers (line 92) | function hasAlternatingCharsAndNumbers(username: string): boolean {
function scoreEmail (line 98) | function scoreEmail(email: string): number {
function isLikelyHuman (line 155) | function isLikelyHuman(email: string, threshold = 30): boolean {
FILE: src/server/trpc.ts
method errorFormatter (line 21) | errorFormatter({ shape, error }) {
FILE: src/utils/base-url.ts
function getBaseUrl (line 7) | function getBaseUrl() {
FILE: src/utils/cn.ts
function cn (line 15) | function cn(...inputs: ClassValue[]) {
FILE: src/utils/construct-metadata.ts
function constructMetadata (line 19) | function constructMetadata({
FILE: tailwind.config.ts
type Scale (line 8) | type Scale = 'gray' | 'pink' | 'salmon' | 'indigo' | 'red';
Condensed preview — 121 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (248K chars).
[
{
"path": ".changeset/config.json",
"chars": 275,
"preview": "{\n \"$schema\": \"https://unpkg.com/@changesets/config@3.0.0/schema.json\",\n \"changelog\": \"@changesets/cli/changelog\",\n \""
},
{
"path": ".editorconfig",
"chars": 229,
"preview": "# EditorConfig is awesome: https://EditorConfig.org\n\n# top-most EditorConfig file\nroot = true\n\n[*]\nindent_style = space\n"
},
{
"path": ".github/FUNDING.yaml",
"chars": 66,
"preview": "# These are supported funding model platforms\ngithub: [ixahmedxi]\n"
},
{
"path": ".github/ISSUE_TEMPLATE/bug_report.md",
"chars": 535,
"preview": "---\nname: Bug report\nabout: Create a report to help us improve\ntitle: ''\nlabels: ''\nassignees: ''\n---\n\n**Describe the bu"
},
{
"path": ".github/ISSUE_TEMPLATE/config.yaml",
"chars": 28,
"preview": "blank_issues_enabled: false\n"
},
{
"path": ".github/ISSUE_TEMPLATE/feature_request.md",
"chars": 594,
"preview": "---\nname: Feature request\nabout: Suggest an idea for this project\ntitle: ''\nlabels: ''\nassignees: ''\n---\n\n**Is your feat"
},
{
"path": ".github/PULL_REQUEST_TEMPLATE/pull_request_template.md",
"chars": 36,
"preview": "Fixes #\n\n## Proposed Changes\n\n-\n-\n-\n"
},
{
"path": ".github/workflows/main-ci.yml",
"chars": 1363,
"preview": "name: Main CI\n\non:\n push:\n branches:\n - main\n # TODO: remove this once next branch is merged into main\n "
},
{
"path": ".github/workflows/pr-ci.yml",
"chars": 2021,
"preview": "name: PR CI\n\non: [pull_request]\n\njobs:\n main-ci:\n runs-on: ubuntu-latest\n\n environment: CI\n env:\n # Neon\n"
},
{
"path": ".github/workflows/pr-cleanup.yml",
"chars": 712,
"preview": "name: Clean up after after a PR is closed or merged\nrun-name: Clean up PR database\non:\n pull_request:\n types: [close"
},
{
"path": ".gitignore",
"chars": 2107,
"preview": "# Logs\nlogs\n*.log\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\nlerna-debug.log*\n.pnpm-debug.log*\n\n# Diagnostic reports"
},
{
"path": ".husky/commit-msg",
"chars": 26,
"preview": "bun commitlint --edit ${1}"
},
{
"path": ".husky/pre-commit",
"chars": 15,
"preview": "bun lint-staged"
},
{
"path": ".husky/prepare-commit-msg",
"chars": 118,
"preview": "# only run this if no git commit message has been provided\n[ -z \"$2\" ] && exec < /dev/tty && bun git-cz --hook || true"
},
{
"path": ".markdownlint.json",
"chars": 195,
"preview": "{\n \"extends\": \"markdownlint/style/prettier\",\n \"first-line-h1\": false,\n \"no-inline-html\": false,\n \"no-space-in-emphas"
},
{
"path": ".prettierignore",
"chars": 80,
"preview": ".prettierignore\nnode_modules\n.next\nnext-env.d.ts\n.husky\nbun.lockb\n*.toml\ndrizzle"
},
{
"path": ".vscode/extensions.json",
"chars": 470,
"preview": "{\n \"recommendations\": [\n \"esbenp.prettier-vscode\",\n \"dbaeumer.vscode-eslint\",\n \"mikestead.dotenv\",\n \"street"
},
{
"path": ".vscode/settings.json",
"chars": 641,
"preview": "{\n // Editor\n \"editor.tabSize\": 2,\n \"editor.formatOnSave\": true,\n \"editor.defaultFormatter\": \"esbenp.prettier-vscode"
},
{
"path": "CODE_OF_CONDUCT.md",
"chars": 5507,
"preview": "# Contributor Covenant Code of Conduct\n\n## Our Pledge\n\nWe as members, contributors, and leaders pledge to make participa"
},
{
"path": "CONTRIBUTING.md",
"chars": 5862,
"preview": "# Noodle's contributing guidelines\n\nThank you for your interest in contributing to our project! Any contribution is high"
},
{
"path": "LICENSE",
"chars": 34299,
"preview": " GNU AFFERO GENERAL PUBLIC LICENSE\n Version 3, 19 November 2007\n\nCopyright (C) "
},
{
"path": "README.md",
"chars": 2050,
"preview": "<div align=\"center\">\n <img src=\"https://github.com/noodle-run/noodle/blob/main/public/logo.svg?raw=true\" alt=\"Noodle lo"
},
{
"path": "SECURITY.md",
"chars": 501,
"preview": "# Noodle Security\n\n## Reporting a Vulnerability\n\nTo report a security issue, please [open a security advisory](https://g"
},
{
"path": "cspell.config.yaml",
"chars": 1216,
"preview": "$schema: https://raw.githubusercontent.com/streetsidesoftware/cspell/main/cspell.schema.json\nversion: '0.2'\nignorePaths:"
},
{
"path": "drizzle/0000_funny_johnny_blaze.sql",
"chars": 349,
"preview": "CREATE TABLE IF NOT EXISTS \"early_access\" (\n\t\"id\" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,\n\t\"name\" text NOT "
},
{
"path": "drizzle/0001_minor_warlock.sql",
"chars": 561,
"preview": "CREATE TABLE IF NOT EXISTS \"modules\" (\n\t\"id\" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,\n\t\"user_id\" text NOT NU"
},
{
"path": "drizzle/0002_complex_sally_floyd.sql",
"chars": 63,
"preview": "ALTER TABLE \"modules\" ALTER COLUMN \"description\" DROP NOT NULL;"
},
{
"path": "drizzle/meta/0000_snapshot.json",
"chars": 1827,
"preview": "{\n \"version\": \"7\",\n \"dialect\": \"postgresql\",\n \"tables\": {\n \"public.early_access\": {\n \"name\": \"early_access\",\n"
},
{
"path": "drizzle/meta/0001_snapshot.json",
"chars": 4237,
"preview": "{\n \"id\": \"e2f7138b-3bc5-4e5c-8e9f-df04364cddcb\",\n \"prevId\": \"b304d26a-1927-40c9-9067-57935d6d9ab3\",\n \"version\": \"7\",\n"
},
{
"path": "drizzle/meta/0002_snapshot.json",
"chars": 4238,
"preview": "{\n \"id\": \"6f3e4fea-8b33-40d5-a9cd-1c4bbb28d564\",\n \"prevId\": \"e2f7138b-3bc5-4e5c-8e9f-df04364cddcb\",\n \"version\": \"7\",\n"
},
{
"path": "drizzle/meta/_journal.json",
"chars": 500,
"preview": "{\n \"version\": \"6\",\n \"dialect\": \"postgresql\",\n \"entries\": [\n {\n \"idx\": 0,\n \"version\": \"6\",\n \"when\": "
},
{
"path": "drizzle.config.ts",
"chars": 278,
"preview": "import type { Config } from 'drizzle-kit';\n\nimport { env } from '@/env';\n\nexport default {\n dialect: 'postgresql',\n sc"
},
{
"path": "eslint.config.js",
"chars": 3092,
"preview": "import path from 'path';\nimport { fileURLToPath } from 'url';\n\nimport comments from '@eslint-community/eslint-plugin-esl"
},
{
"path": "eslint.d.ts",
"chars": 2043,
"preview": "/**\n * Since ESLint and many plugins are written in JavaScript, we need to provide\n * or change some types to make them "
},
{
"path": "next.config.js",
"chars": 569,
"preview": "import { fileURLToPath } from 'node:url';\n\nimport { createJiti } from 'jiti';\n\nconst jiti = createJiti(fileURLToPath(imp"
},
{
"path": "package.json",
"chars": 5307,
"preview": "{\n \"name\": \"noodle\",\n \"version\": \"0.1.0\",\n \"private\": true,\n \"description\": \"Rethinking Student Productivity\",\n \"li"
},
{
"path": "postcss.config.js",
"chars": 135,
"preview": "/** @type {import('postcss-load-config').Config} */\nconst config = {\n plugins: {\n tailwindcss: {},\n },\n};\n\nexport d"
},
{
"path": "prettier.config.js",
"chars": 644,
"preview": "/** @type {import('@ianvs/prettier-plugin-sort-imports').PrettierConfig} */\nconst config = {\n semi: true,\n singleQuote"
},
{
"path": "public/.well-known/security.txt",
"chars": 313,
"preview": "Contact: https://github.com/noodle-run/noodle/security/advisories/new\nExpires: 2025-12-31T23:00:00.000Z\nAcknowledgments:"
},
{
"path": "public/browserconfig.xml",
"chars": 246,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<browserconfig>\n <msapplication>\n <tile>\n <square150x150logo"
},
{
"path": "reset.d.ts",
"chars": 37,
"preview": "import '@total-typescript/ts-reset';\n"
},
{
"path": "src/app/(dashboard)/(auth)/sign-in/[[...sign-in]]/page.tsx",
"chars": 275,
"preview": "import { SignIn } from '@clerk/nextjs';\n\n/**\n * The Signin page component.\n * @returns The signin page.\n */\nexport defau"
},
{
"path": "src/app/(dashboard)/(auth)/sign-up/[[...sign-in]]/page.tsx",
"chars": 275,
"preview": "import { SignUp } from '@clerk/nextjs';\n\n/**\n * The Signup page component.\n * @returns The signup page.\n */\nexport defau"
},
{
"path": "src/app/(dashboard)/app/_components/active-button.tsx",
"chars": 699,
"preview": "'use client';\n\nimport { cn } from '@/utils/cn';\nimport { Button } from '@/primitives/button';\nimport Link from 'next/lin"
},
{
"path": "src/app/(dashboard)/app/_components/create-module-popover.tsx",
"chars": 13077,
"preview": "'use client';\n\nimport { Button } from '@/primitives/button';\nimport { Input } from '@/primitives/input';\nimport { Popove"
},
{
"path": "src/app/(dashboard)/app/_components/module-card.tsx",
"chars": 1857,
"preview": "import Color from 'color';\nimport { Icon, type IconNames } from '@/primitives/icon';\nimport { Skeleton } from '@/primiti"
},
{
"path": "src/app/(dashboard)/app/_components/recent-modules.tsx",
"chars": 2533,
"preview": "'use client';\n\nimport { ScrollArea, ScrollBar } from '@/primitives/scroll-area';\nimport { ModuleCard } from './module-ca"
},
{
"path": "src/app/(dashboard)/app/_components/side-menu.tsx",
"chars": 3419,
"preview": "import { api } from '@/lib/trpc/server';\nimport {\n CircleHelpIcon,\n DiamondIcon,\n HomeIcon,\n MessageSquareMore,\n Pe"
},
{
"path": "src/app/(dashboard)/app/_components/welcome-message.tsx",
"chars": 1208,
"preview": "'use client';\n\nimport { Skeleton } from '@/primitives/skeleton';\nimport { useUser } from '@clerk/nextjs';\n\nexport functi"
},
{
"path": "src/app/(dashboard)/app/layout.tsx",
"chars": 773,
"preview": "import { PanelLeftCloseIcon } from 'lucide-react';\nimport type { PropsWithChildren } from 'react';\nimport { Button } fro"
},
{
"path": "src/app/(dashboard)/app/lib/color-choices.ts",
"chars": 1901,
"preview": "import {\n amber,\n blue,\n bronze,\n brown,\n crimson,\n cyan,\n gold,\n grass,\n gray,\n green,\n indigo,\n iris,\n ja"
},
{
"path": "src/app/(dashboard)/app/module/[id]/page.tsx",
"chars": 3351,
"preview": "import { api } from '@/lib/trpc/server';\nimport type { RouterOutputs } from '@/lib/trpc/types';\nimport type { IconNames "
},
{
"path": "src/app/(dashboard)/app/page.tsx",
"chars": 543,
"preview": "import { api } from '@/lib/trpc/server';\nimport { RecentModules } from './_components/recent-modules';\nimport { WelcomeM"
},
{
"path": "src/app/(dashboard)/layout.tsx",
"chars": 950,
"preview": "import { TRPCReactProvider } from '@/lib/trpc/react';\nimport { ClerkProvider } from '@clerk/nextjs';\nimport { dark } fro"
},
{
"path": "src/app/(site)/(legal)/layout.tsx",
"chars": 202,
"preview": "import type { PropsWithChildren } from 'react';\n\nexport default function LegalLayout({ children }: PropsWithChildren) {\n"
},
{
"path": "src/app/(site)/(legal)/privacy/page.tsx",
"chars": 580,
"preview": "import { getLegalDocs } from '@/lib/mdx';\nimport { notFound } from 'next/navigation';\nimport { CustomMDX, MDXComponents "
},
{
"path": "src/app/(site)/(legal)/tos/page.tsx",
"chars": 590,
"preview": "import { getLegalDocs } from '@/lib/mdx';\nimport { notFound } from 'next/navigation';\nimport { CustomMDX, MDXComponents "
},
{
"path": "src/app/(site)/_components/custom-mdx.tsx",
"chars": 2604,
"preview": "import { cn } from '@/utils/cn';\nimport slugify from 'slugify';\nimport { buttonVariants } from '@/primitives/button';\nim"
},
{
"path": "src/app/(site)/_components/footer.tsx",
"chars": 2192,
"preview": "import { constants } from '@/constants';\nimport Image from 'next/image';\nimport Link from 'next/link';\n\nconst footerLink"
},
{
"path": "src/app/(site)/_components/navbar.tsx",
"chars": 6967,
"preview": "'use client';\n\nimport { forwardRef, useState } from 'react';\nimport Image from 'next/image';\nimport Link from 'next/link"
},
{
"path": "src/app/(site)/blog/[slug]/page.tsx",
"chars": 1680,
"preview": "import { getBlogPosts } from '@/lib/mdx';\nimport { notFound } from 'next/navigation';\nimport { CustomMDX, MDXComponents "
},
{
"path": "src/app/(site)/blog/page.tsx",
"chars": 1555,
"preview": "import { getBlogPosts } from '@/lib/mdx';\nimport { Button } from '@/primitives/button';\nimport { MoveRightIcon } from 'l"
},
{
"path": "src/app/(site)/early-access/_forms/join.tsx",
"chars": 5805,
"preview": "'use client';\n\nimport { api } from '@/lib/trpc/react';\nimport { cn } from '@/utils/cn';\nimport { Button, buttonVariants "
},
{
"path": "src/app/(site)/early-access/layout.tsx",
"chars": 242,
"preview": "import { TRPCReactProvider } from '@/lib/trpc/react';\nimport type { PropsWithChildren } from 'react';\n\nexport default fu"
},
{
"path": "src/app/(site)/early-access/page.tsx",
"chars": 1444,
"preview": "import type { Metadata } from 'next';\nimport { JoinEarlyAccessForm } from './_forms/join';\nimport { constructMetadata } "
},
{
"path": "src/app/(site)/layout.tsx",
"chars": 771,
"preview": "import type { PropsWithChildren } from 'react';\n\nimport { Navbar } from './_components/navbar';\nimport { Footer } from '"
},
{
"path": "src/app/(site)/page.tsx",
"chars": 1955,
"preview": "import Link from 'next/link';\nimport { ChevronRightIcon, StarIcon } from 'lucide-react';\n\nimport { constants } from '@/c"
},
{
"path": "src/app/api/trpc/[trpc]/route.ts",
"chars": 764,
"preview": "import type { NextRequest } from 'next/server';\n\nimport { fetchRequestHandler } from '@trpc/server/adapters/fetch';\n\nimp"
},
{
"path": "src/app/globals.css",
"chars": 3282,
"preview": ":root {\n --gray-1: 0 0% 99%;\n --gray-2: 0 0% 98%;\n --gray-3: 0 0% 94%;\n --gray-4: 0 0% 91%;\n --gray-5: 0 0% 88%;\n "
},
{
"path": "src/app/layout.tsx",
"chars": 1239,
"preview": "import type { Metadata } from 'next';\n\nimport { GeistMono } from 'geist/font/mono';\nimport { GeistSans } from 'geist/fon"
},
{
"path": "src/app/manifest.ts",
"chars": 870,
"preview": "import type { MetadataRoute } from 'next';\n\nimport { constants } from '@/constants';\n\n/**\n * This function returns an ob"
},
{
"path": "src/app/not-found.tsx",
"chars": 1604,
"preview": "import { Button } from '@/primitives/button';\nimport { Footer } from './(site)/_components/footer';\nimport { Navbar } fr"
},
{
"path": "src/app/robots.ts",
"chars": 450,
"preview": "import type { MetadataRoute } from 'next';\n\nimport { getBaseUrl } from '@/utils/base-url';\n\n/**\n * This function returns"
},
{
"path": "src/constants.tsx",
"chars": 1446,
"preview": "import {\n ClipboardCheckIcon,\n DiamondIcon,\n Edit3Icon,\n ListChecksIcon,\n} from 'lucide-react';\n\nexport const consta"
},
{
"path": "src/content/blog/noodle-resurgence.md",
"chars": 4550,
"preview": "---\ntitle: Noodle is back to life!\npublishedAt: Jun 8th, 2024\nsummary: After a brief period of absence, Noodle is back a"
},
{
"path": "src/content/legal/privacy.md",
"chars": 1680,
"preview": "---\ntitle: Privacy Policy\neffectiveDate: Jun 8th, 2024\n---\n\n## 1. Introduction\n\nNoodle Run LTD (\"Noodle\") is committed t"
},
{
"path": "src/content/legal/tos.md",
"chars": 1538,
"preview": "---\ntitle: Terms of Service\neffectiveDate: Jun 8th, 2024\n---\n\n## 1. Introduction\n\nWelcome to Noodle Run LTD (\"Noodle\"). "
},
{
"path": "src/db/index.ts",
"chars": 292,
"preview": "import { neon } from '@neondatabase/serverless';\nimport { drizzle } from 'drizzle-orm/neon-http';\n\nimport { env } from '"
},
{
"path": "src/db/schema/early-access.ts",
"chars": 580,
"preview": "import { boolean, pgTable, text, timestamp, uuid } from 'drizzle-orm/pg-core';\n\nexport const earlyAccessTable = pgTable("
},
{
"path": "src/db/schema/index.ts",
"chars": 59,
"preview": "export * from './early-access';\nexport * from './modules';\n"
},
{
"path": "src/db/schema/modules.ts",
"chars": 1424,
"preview": "import {\n boolean,\n integer,\n pgTable,\n text,\n timestamp,\n uuid,\n} from 'drizzle-orm/pg-core';\nimport { createInse"
},
{
"path": "src/emails/layouts/Base.tsx",
"chars": 1329,
"preview": "import {\n Body,\n Container,\n Font,\n Head,\n Html,\n Preview,\n Tailwind,\n} from '@react-email/components';\nimport { "
},
{
"path": "src/emails/tailwind.ts",
"chars": 4672,
"preview": "import type { TailwindConfig } from '@react-email/components';\nimport { gray, indigo, tomato } from '@radix-ui/colors';\n"
},
{
"path": "src/emails/templates/early-access-joined.tsx",
"chars": 2012,
"preview": "import { Heading, Img, Link, Text } from '@react-email/components';\nimport { BaseEmailLayout } from '../layouts/Base';\ni"
},
{
"path": "src/emails/utils.ts",
"chars": 421,
"preview": "import { constants } from '@/constants';\nimport { env } from '@/env';\n\n/**\n * This is used to get the base URL of the as"
},
{
"path": "src/env.ts",
"chars": 942,
"preview": "import { createEnv } from '@t3-oss/env-nextjs';\nimport { vercel } from '@t3-oss/env-nextjs/presets';\nimport { z } from '"
},
{
"path": "src/lib/mdx.ts",
"chars": 2137,
"preview": "import fs from 'node:fs/promises';\nimport path from 'path';\n\n// eslint-disable-next-line @typescript-eslint/no-unnecessa"
},
{
"path": "src/lib/redis.ts",
"chars": 182,
"preview": "import { Redis } from '@upstash/redis';\n\nimport { env } from '@/env';\n\nexport const redis = new Redis({\n url: env.UPSTA"
},
{
"path": "src/lib/resend.ts",
"chars": 117,
"preview": "import { env } from '@/env';\nimport { Resend } from 'resend';\n\nexport const resend = new Resend(env.RESEND_API_KEY);\n"
},
{
"path": "src/lib/trpc/react.tsx",
"chars": 1993,
"preview": "'use client';\n\nimport { useState } from 'react';\n\nimport { QueryClient, QueryClientProvider } from '@tanstack/react-quer"
},
{
"path": "src/lib/trpc/server.ts",
"chars": 410,
"preview": "import 'server-only';\n\nimport { cache } from 'react';\nimport { headers } from 'next/headers';\n\nimport { createCaller } f"
},
{
"path": "src/lib/trpc/types.ts",
"chars": 385,
"preview": "import type { AppRouter } from '@/server';\nimport type { inferReactQueryProcedureOptions } from '@trpc/react-query';\nimp"
},
{
"path": "src/mdx-components.tsx",
"chars": 1409,
"preview": "import type { MDXComponents } from 'mdx/types';\nimport { buttonVariants } from './primitives/button';\nimport { cn } from"
},
{
"path": "src/middleware.ts",
"chars": 438,
"preview": "import { clerkMiddleware, createRouteMatcher } from '@clerk/nextjs/server';\n\nconst isProtectedRoute = createRouteMatcher"
},
{
"path": "src/primitives/button.tsx",
"chars": 2093,
"preview": "import * as React from 'react';\n\nimport type { VariantProps } from 'class-variance-authority';\n\nimport { Slot } from '@r"
},
{
"path": "src/primitives/checkbox.tsx",
"chars": 1209,
"preview": "'use client';\n\nimport * as React from 'react';\n\nimport * as CheckboxPrimitive from '@radix-ui/react-checkbox';\nimport { "
},
{
"path": "src/primitives/dropdown-menu.tsx",
"chars": 7445,
"preview": "'use client';\n\nimport * as React from 'react';\nimport * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';\ni"
},
{
"path": "src/primitives/form.tsx",
"chars": 4348,
"preview": "'use client';\n\nimport * as React from 'react';\n\nimport type * as LabelPrimitive from '@radix-ui/react-label';\nimport typ"
},
{
"path": "src/primitives/icon.tsx",
"chars": 525,
"preview": "import { icons } from 'lucide-react';\n\ninterface Props {\n name: keyof typeof icons;\n color?: string;\n size?: number;\n"
},
{
"path": "src/primitives/input.tsx",
"chars": 833,
"preview": "import * as React from 'react';\n\nimport { cn } from '@/utils/cn';\n\nexport type InputProps = React.InputHTMLAttributes<HT"
},
{
"path": "src/primitives/label.tsx",
"chars": 778,
"preview": "'use client';\n\nimport * as React from 'react';\n\nimport type { VariantProps } from 'class-variance-authority';\n\nimport * "
},
{
"path": "src/primitives/navigation-menu.tsx",
"chars": 4957,
"preview": "'use client';\n\nimport * as React from 'react';\n\nimport * as NavigationMenuPrimitive from '@radix-ui/react-navigation-men"
},
{
"path": "src/primitives/popover.tsx",
"chars": 1315,
"preview": "'use client';\n\nimport * as React from 'react';\n\nimport * as PopoverPrimitive from '@radix-ui/react-popover';\n\nimport { c"
},
{
"path": "src/primitives/resizable-panel.tsx",
"chars": 1342,
"preview": "import { AnimatePresence, motion } from 'framer-motion';\nimport { type PropsWithChildren } from 'react';\nimport useResiz"
},
{
"path": "src/primitives/scroll-area.tsx",
"chars": 1655,
"preview": "'use client';\n\nimport * as React from 'react';\nimport * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area';\n\nimpo"
},
{
"path": "src/primitives/select.tsx",
"chars": 5733,
"preview": "'use client';\n\nimport * as React from 'react';\n\nimport { CheckIcon, ChevronDownIcon, ChevronUpIcon } from 'lucide-react'"
},
{
"path": "src/primitives/separator.tsx",
"chars": 773,
"preview": "'use client';\n\nimport * as React from 'react';\nimport * as SeparatorPrimitive from '@radix-ui/react-separator';\n\nimport "
},
{
"path": "src/primitives/skeleton.tsx",
"chars": 373,
"preview": "import { cn } from '@/utils/cn';\n\nfunction Skeleton({\n className,\n noPulse = false,\n ...props\n}: React.HTMLAttributes"
},
{
"path": "src/primitives/sonner.tsx",
"chars": 981,
"preview": "'use client';\n\nimport { useTheme } from 'next-themes';\nimport { Toaster as Sonner } from 'sonner';\n\ntype ToasterProps = "
},
{
"path": "src/primitives/tabs.tsx",
"chars": 2061,
"preview": "'use client';\n\nimport * as React from 'react';\nimport * as TabsPrimitive from '@radix-ui/react-tabs';\n\nimport { cn } fro"
},
{
"path": "src/primitives/textarea.tsx",
"chars": 784,
"preview": "import * as React from 'react';\n\nimport { cn } from '@/utils/cn';\n\nexport type TextareaProps = React.TextareaHTMLAttribu"
},
{
"path": "src/server/index.ts",
"chars": 447,
"preview": "import { earlyAccessRouter } from './routers/early-access';\nimport { modulesRouter } from './routers/modules';\nimport { "
},
{
"path": "src/server/routers/early-access.ts",
"chars": 5466,
"preview": "import { earlyAccessTable } from '@/db/schema';\nimport { createRouter, publicProcedure } from '../trpc';\nimport EarlyAcc"
},
{
"path": "src/server/routers/modules.ts",
"chars": 3974,
"preview": "import { createRouter, protectedProcedure } from '../trpc';\nimport {\n insertModuleSchema,\n modulesTable,\n selectModul"
},
{
"path": "src/server/trpc.ts",
"chars": 1108,
"preview": "import { currentUser } from '@clerk/nextjs/server';\nimport { initTRPC, TRPCError } from '@trpc/server';\nimport superjson"
},
{
"path": "src/utils/base-url.ts",
"chars": 360,
"preview": "import { env } from '@/env';\n\n/**\n * A utility function to get the base URL of the current instance.\n * @returns The bas"
},
{
"path": "src/utils/cn.ts",
"chars": 504,
"preview": "import type { ClassValue } from 'clsx';\nimport clsx from 'clsx';\nimport { twMerge } from 'tailwind-merge';\n\n/**\n * A uti"
},
{
"path": "src/utils/construct-metadata.ts",
"chars": 2124,
"preview": "import { constants } from '@/constants';\nimport { getBaseUrl } from './base-url';\nimport type { Metadata } from 'next';\n"
},
{
"path": "tailwind.config.ts",
"chars": 1945,
"preview": "import type { Config } from 'tailwindcss';\n\nimport aspectRatioPlugin from '@tailwindcss/aspect-ratio';\nimport containerQ"
},
{
"path": "tsconfig.json",
"chars": 1174,
"preview": "{\n \"compilerOptions\": {\n \"strict\": true,\n \"allowUnusedLabels\": false,\n \"allowUnreachableCode\": false,\n \"exa"
}
]
// ... and 1 more files (download for full content)
About this extraction
This page contains the full source code of the noodle-run/noodle GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 121 files (225.9 KB), approximately 60.2k tokens, and a symbol index with 76 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.