commit 228faf226add422196dbf7589f715e13b68cac3e Author: Nikita Date: Mon Jul 15 20:08:18 2024 +0400 . diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..c4c909d1 --- /dev/null +++ b/.gitignore @@ -0,0 +1,46 @@ +# dependencies +node_modules +/.pnp +.pnp.js +.yarn/install-state.gz + +# testing +/coverage + +# next.js +/.next/ +/out/ + +# production +/build + +# misc +.DS_Store +*.pem + +# debug +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# local env files +.env*.local + +# vercel +.vercel + +# typescript +*.tsbuildinfo +next-env.d.ts + +dbschema/edgeql-js +dbschema/interfaces.ts + +# other +package-lock.json +pnpm-lock.yaml +.env +cli/run.ts +.next-types +.env +.next diff --git a/bun.lockb b/bun.lockb new file mode 100755 index 00000000..16415812 Binary files /dev/null and b/bun.lockb differ diff --git a/eslint.config.js b/eslint.config.js new file mode 100644 index 00000000..22c9826a --- /dev/null +++ b/eslint.config.js @@ -0,0 +1,24 @@ +import { FlatCompat } from "@eslint/eslintrc" +import js from "@eslint/js" + +const compat = new FlatCompat() + +export default [ + { + ...compat + .extends( + "eslint:recommended", + "plugin:@typescript-eslint/recommended-type-checked", + "plugin:@typescript-eslint/stylistic-type-checked", + "prettier" + ) + .map(c => ({ + ...c, + files: ["**/*.{ts,tsx,mts}"] + })) + }, + { + files: ["**/*.{js,jsx,cjs,mjs}"], + ...js.configs.recommended + } +] diff --git a/package.json b/package.json new file mode 100644 index 00000000..e379ccc6 --- /dev/null +++ b/package.json @@ -0,0 +1,22 @@ +{ + "name": "learn-anything", + "scripts": { + "dev": "bun web", + "web": "cd web && bun dev", + "web:build": "bun run --filter '*' build" + }, + "devDependencies": { + "bun-types": "^1.1.18" + }, + "workspaces": [ + "web" + ], + "prettier": { + "useTabs": true, + "semi": false, + "trailingComma": "none", + "printWidth": 120, + "arrowParens": "avoid" + }, + "private": true +} diff --git a/readme.md b/readme.md new file mode 100644 index 00000000..04ee1085 --- /dev/null +++ b/readme.md @@ -0,0 +1,33 @@ +# [Learn-Anything.xyz](https://learn-anything.xyz) + +## Setup + +Using [Bun](https://bun.sh). + +``` +bun i +``` + +[Jazz](https://jazz.tools/) is used for all global/local state management. + +## Run website + +``` +bun web +``` + +## Contribute + +Currently things are unstable but will improve. + +If you want to help contribute to code, ask for help on [Discord](https://discord.gg/bxtD8x6aNF)'s `#dev` channel. You will be onboarded and unblocked fast. + +Can always submit draft PRs with good ideas/fixes. We will help along the way to make it merge ready. + +## Chat + +Community chat in [Discord server](https://discord.gg/bxtD8x6aNF). + +Internal dev chat in Telegram (can email `join@learn-anything.xyz` to join core team). We will reach out with offer to join if you contribute to repo in form of PRs too. + +[![X](https://img.shields.io/badge/learnanything-100000?logo=X&color=black)](https://x.com/learnanything_) diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 00000000..1bb3943b --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,30 @@ +{ + "compilerOptions": { + "rootDirs": [".", ".next-types"], + "target": "esnext", + "module": "esnext", + "moduleResolution": "bundler", + "lib": ["dom", "dom.iterable", "esnext"], + "allowJs": true, + "skipLibCheck": true, + "strict": true, + "noEmit": true, + "esModuleInterop": true, + "resolveJsonModule": true, + "isolatedModules": true, + "jsx": "preserve", + "incremental": true, + "plugins": [ + { + "name": "next" + } + ], + "baseUrl": ".", + "paths": { + "@/*": ["./*"] + }, + "types": ["bun-types"] + }, + "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts", "**/*.(mts|ts)"], + "exclude": ["node_modules"] +} diff --git a/web/.eslintrc.json b/web/.eslintrc.json new file mode 100644 index 00000000..72cc705c --- /dev/null +++ b/web/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "next/core-web-vitals" +} diff --git a/web/.gitignore b/web/.gitignore new file mode 100644 index 00000000..fd3dbb57 --- /dev/null +++ b/web/.gitignore @@ -0,0 +1,36 @@ +# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. + +# dependencies +/node_modules +/.pnp +.pnp.js +.yarn/install-state.gz + +# testing +/coverage + +# next.js +/.next/ +/out/ + +# production +/build + +# misc +.DS_Store +*.pem + +# debug +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# local env files +.env*.local + +# vercel +.vercel + +# typescript +*.tsbuildinfo +next-env.d.ts diff --git a/web/app/favicon.ico b/web/app/favicon.ico new file mode 100644 index 00000000..718d6fea Binary files /dev/null and b/web/app/favicon.ico differ diff --git a/web/app/globals.css b/web/app/globals.css new file mode 100644 index 00000000..56208c36 --- /dev/null +++ b/web/app/globals.css @@ -0,0 +1,28 @@ +@tailwind base; +@tailwind components; +@tailwind utilities; + +:root { + --foreground-rgb: 0, 0, 0; + --background-start-rgb: 214, 219, 220; + --background-end-rgb: 255, 255, 255; +} + +@media (prefers-color-scheme: dark) { + :root { + --foreground-rgb: 255, 255, 255; + --background-start-rgb: 0, 0, 0; + --background-end-rgb: 0, 0, 0; + } +} + +body { + color: rgb(var(--foreground-rgb)); + background: linear-gradient(to bottom, transparent, rgb(var(--background-end-rgb))) rgb(var(--background-start-rgb)); +} + +@layer utilities { + .text-balance { + text-wrap: balance; + } +} diff --git a/web/app/layout.tsx b/web/app/layout.tsx new file mode 100644 index 00000000..d2910887 --- /dev/null +++ b/web/app/layout.tsx @@ -0,0 +1,22 @@ +import type { Metadata } from "next" +import { Inter } from "next/font/google" +import "./globals.css" + +const inter = Inter({ subsets: ["latin"] }) + +export const metadata: Metadata = { + title: "Learn Anything", + description: "Organize world's knowledge, explore connections and curate learning paths" +} + +export default function RootLayout({ + children +}: Readonly<{ + children: React.ReactNode +}>) { + return ( + + {children} + + ) +} diff --git a/web/app/page.tsx b/web/app/page.tsx new file mode 100644 index 00000000..d9621817 --- /dev/null +++ b/web/app/page.tsx @@ -0,0 +1,5 @@ +"use client" + +export default function Home() { + return
+} diff --git a/web/next.config.mjs b/web/next.config.mjs new file mode 100644 index 00000000..4678774e --- /dev/null +++ b/web/next.config.mjs @@ -0,0 +1,4 @@ +/** @type {import('next').NextConfig} */ +const nextConfig = {}; + +export default nextConfig; diff --git a/web/package.json b/web/package.json new file mode 100644 index 00000000..4ec875c3 --- /dev/null +++ b/web/package.json @@ -0,0 +1,27 @@ +{ + "name": "web", + "version": "0.1.0", + "scripts": { + "dev": "next dev", + "build": "next build", + "start": "next start", + "lint": "next lint" + }, + "dependencies": { + "react": "^18", + "react-dom": "^18", + "next": "14.2.5" + }, + "devDependencies": { + "typescript": "^5", + "@types/node": "^20", + "@types/react": "^18", + "@types/react-dom": "^18", + "postcss": "^8", + "tailwindcss": "^3.4.1", + "eslint": "^8", + "eslint-config-next": "14.2.5", + "prettier-plugin-tailwindcss": "^0.6.5" + }, + "private": true +} diff --git a/web/postcss.config.mjs b/web/postcss.config.mjs new file mode 100644 index 00000000..1a69fd2a --- /dev/null +++ b/web/postcss.config.mjs @@ -0,0 +1,8 @@ +/** @type {import('postcss-load-config').Config} */ +const config = { + plugins: { + tailwindcss: {}, + }, +}; + +export default config; diff --git a/web/public/next.svg b/web/public/next.svg new file mode 100644 index 00000000..5174b28c --- /dev/null +++ b/web/public/next.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/web/public/vercel.svg b/web/public/vercel.svg new file mode 100644 index 00000000..d2f84222 --- /dev/null +++ b/web/public/vercel.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/web/tailwind.config.ts b/web/tailwind.config.ts new file mode 100644 index 00000000..d5f9834a --- /dev/null +++ b/web/tailwind.config.ts @@ -0,0 +1,19 @@ +import type { Config } from "tailwindcss" + +const config: Config = { + content: [ + "./pages/**/*.{js,ts,jsx,tsx,mdx}", + "./components/**/*.{js,ts,jsx,tsx,mdx}", + "./app/**/*.{js,ts,jsx,tsx,mdx}" + ], + theme: { + extend: { + backgroundImage: { + "gradient-radial": "radial-gradient(var(--tw-gradient-stops))", + "gradient-conic": "conic-gradient(from 180deg at 50% 50%, var(--tw-gradient-stops))" + } + } + }, + plugins: [] +} +export default config diff --git a/web/tsconfig.json b/web/tsconfig.json new file mode 100644 index 00000000..7a75d434 --- /dev/null +++ b/web/tsconfig.json @@ -0,0 +1,26 @@ +{ + "compilerOptions": { + "lib": ["dom", "dom.iterable", "esnext"], + "allowJs": true, + "skipLibCheck": true, + "strict": true, + "noEmit": true, + "esModuleInterop": true, + "module": "esnext", + "moduleResolution": "bundler", + "resolveJsonModule": true, + "isolatedModules": true, + "jsx": "preserve", + "incremental": true, + "plugins": [ + { + "name": "next" + } + ], + "paths": { + "@/*": ["./*"] + } + }, + "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"], + "exclude": ["node_modules"] +}