Organize world's knowledge, explore connections and curate learning paths
End goal of Learn Anything is to become best place and tool for keeping track of what you know. What ideas you have. What you want to learn next. What you don't know yet. And how you can learn that in most optimal way possible given what you know already.
Try website yourself first to get feel for it.
It is fully open source project with active community on Discord. There is great focus on both DX of developing everything LA and even more, end user UX.
- File structure - make sense of how code is laid out
- Setup - get started with development
- Run GraphQL server (Grafbase)
- Run website (Solid)
- Run desktop app (Tauri/Rust)
- Contribute - contribute to project effectively
- Docs
- Design
- Tasks / Explore
- Commands
Tech stack is described in docs/tech-stack.md.
- app - desktop app in Tauri/Solid
- grafbase - Grafbase provides GraphQL API layer for all server functions like talking with database
- edgedb - EdgeDB used as main server database
- dbschema
- default.esdl - EdgeDB schema defining all models and relations
- migrations - migration files get generated after running
bun db:migrate
- crud - CRUD functions on models (imported either from grafbase resolvers or from cli)
- dbschema
- resolvers - edge resolvers are server functions exposed with GraphQL
- grafbase.config.ts - Grafbase's config. You create file in resolvers folder, then extend grafbase.config.ts. Can use Pathfinder to test query. Then call it from anywhere using some GraphQL client.
- edgedb - EdgeDB used as main server database
- mobile - mobile app using NativeScript/Solid
- shared - shared TS functions (can be used by any part of monorepo)
- website - learn-anything.xyz website code in Solid
- components - solid components
- routes - routes defined using file system
Bun is used to run things as part of monorepo. However pnpm & pnpm workspaces are used to manage dependencies (bun gave issues with installing deps and breaking builds)
First run:
pnpm i
bun setup
bun setup
runs bun cmd.ts init
(can see cmd.ts code for what it does). It will create .env
files for you so you can start coding the project fast. It will also git clone
tasks and data repos.
Monorepo tooling should get better soon. If you're intested in making it better by integrating Nx or similar tools, please reach out on Discord.
Warning Instructions might break, if you get an unexpected error or anything, reach out on Discord, we will resolve it
Install EdgeDB by running curl ..
command from EdgeDB website. It is used as main server database. Should be below command for Linux/Mac:
curl --proto '=https' --tlsv1.2 -sSf https://sh.edgedb.com | sh
Then run:
bun db:init
Follow instructions, name EdgeDB instance learn-anything
.
Then run bun cmd.ts seedEdgeDb
.
Then do:
cd grafbase/edgedb
edgedb database wipe -I learn-anything
edgedb restore seed.db
Now you can run bun db:ui
. This will open EdgeDB graphical interface where you can run queries or explore the schema. The EdgeDB database you got, has all the content of existing Learn Anything, you can explore the data inside and run various queries.
If you ran bun setup
, you should have already a grafbase/.env
file with this content:
LOCAL=true
EDGEDB_DSN=
PUBLIC_HANKO_API_URL=https://e879ccc9-285e-49d3-b37e-b569f0db4035.hanko.io
INTERNAL_SECRET=secret
Fill EDGEDB_DSN
value with value you get from running bun db:get-dsn
. It's needed to connect to EdgeDB locally.
bun db:migrate
This gives you type safe access to EdgeDB and lets you use the query builder nicely.
Warning Below command is incomplete and needs testing, please reach out on Discord and we do it together with you
bun db:seed
Above command is incomplete but will be soon. It should take the files you got in data folder (after running bun dev-setup
) and fill EdgeDB db with content necessary to develop LA very fast.
Reach out on Discord to get a semi working version of the command.
Warning If you reach any problems with setup, reach out on Discord
Assumes you followed instructions for Setup EdgeDB and have grafbase/.env
file with:
LOCAL=true
EDGEDB_DSN=edgedb://
PUBLIC_HANKO_API_URL=https://e879ccc9-285e-49d3-b37e-b569f0db4035.hanko.io
INTERNAL_SECRET=secret
Then run:
npx grafbase@latest dev
This starts Grafbase locally and give you GraphQL access.
Download Pathfinder app and open http://localhost:4000 inside. Can also open http://localhost:4000 in browser but Pathfinder is nice app. In there, you can run various queries calling resolvers defined in grafbase/resolvers. Grafbase picks up any changes you make to the files in the folder.
Grafbase config is set in grafbase/grafbase.config.ts. You specify what resolvers are defined, what inputs/outputs they have. Then you create or edit files in grafbase/resolvers. Read existing resolvers to make sense of how it works.
When you make changes to grafbase.config.ts as we are using Mobius as our GraphQL client and it is fully typed. You can run bun mobius-update
, it will update the schema in shared/lib/mobius.ts with new schema.
Warning If you reach any problems with setup, reach out on Discord
If you ran bun setup
before, you should have website/.env
file with this content:
VITE_HANKO_API=https://e879ccc9-285e-49d3-b37e-b569f0db4035.hanko.io
VITE_GRAFBASE_API_URL=http://127.0.0.1:4000/graphql
VITE_GRAFBASE_INTERNAL_SECRET=secret
Hanko is used as auth provider. You can swap Hanko API variable content with one from a project you create yourself. Above is project we made for local dev you can use.
Run:
bun web
Warning You need to make sure you have data in the database to actually develop. So do section
Seed EdgeDB with content
. Reach out on Discord for help as things are unstable still.
Warning WIP, massive effort is put here after website is released and is working without issues
Goal of desktop app is to be essentially a clone of Obsidian/Reflect (working with local markdown files). And with ability to publish the markdown content to LA. All private data and files will be end to end encrypted and synced with mobile app.
It will be the best note taking experience you can get. All open source.
bun app
Warning WIP, Above command will give you issues most likely, reach out on Discord and we will help resolve them
Always open to useful ideas or fixes in form of issues or PRs.
Current issues are organised with labels. Issues currently in focus are labeled with Current Month label.
If issue is not already present (do search first), open new issue, start discussion or ask about it on Discord.
It's okay to submit draft PR as you can get help along the way to make it merge ready.
Any issues with setup or making your first feature or trying to fix a bug will be resolved asap. Same goes for discussing ideas on how to make the tool even better than it is now.
All docs can be seen in docs.
It is advisable you read them, before you start developing anything as they provide a lot of context and general knowledge.
There is big focus on documentation and clarity in the project. All code should be clear and understandable and well documented.
Check Dev Tips for some advice on development.
All design is done in Figma. There is also a FigJam going over the software architecture such as the EdgeDB schema.
If you're designer and want to help out or have ideas, mention it on Discord.
There is separate repo of tasks with goal to take the tasks used in LA and generalise it for use by community.
Together with explore for prototyping of various kind.
bun cmd.ts setup
Fully sets up LA for development (website, desktop, mobile, api, ..).
cd app && bun tauri:dev
Run desktop app built with Tauri.
cd app && bun run tauri build --debug
Create debug build with Tauri.
cd website && bun dev
Run website.
cd grafbase/edgedb && bun --watch cli/cli.ts
Run CLI to quickly execute TS code (run queries and more..).
cd grafbase/edgedb && edgedb ui
Open EdgeDB UI to run queries and more.
cd grafbase/edgedb && edgedb watch
Watch for changes in EdgeDB schema and apply them making migrations.
cd grafbase/edgedb && edgedb migration create && edgedb migrate && bunx @edgedb/generate edgeql-js --target ts && bunx @edgedb/generate queries --target ts
Create new migration, apply migrations and generate EdgeDB-JS types
cd grafbase/edgedb && bunx @edgedb/generate edgeql-js --target ts && bunx @edgedb/generate queries --target ts
Generate EdgeDB-JS types from custom queries.
cd grafbase/edgedb && edgedb instance credentials --insecure-dsn
Get insecure DSN for EdgeDB instance.
cd private && edgedb dump prod.db
Dump production database.
cd grafbase/edgedb && tput reset && bun cli/loadConnectionsIntoGrafbase.ts
Load topic connections into Grafbase cache.
bunx grafbase@latest dev
Run Grafbase API in development mode.
bun --watch cmd.ts run
Execute run()
function in cmd.ts for quick experiments
cd app/src-tauri/crates/wiki/ && cargo watch -q -- sh -c "tput reset && cargo test -q --lib"
Run tests for Rust wiki crate in watch mode.
npx grafbase@latest dev
Run Grafbase in development mode.
bun cmd.ts updateMobiusSchema
Update Mobius schema.
prettier -w .
Format codebase with Prettier.
eslint --ignore-path .gitignore --max-warnings 0 --ext .ts,.tsx,.js,.jsx .
Lint code with ESLint.
tsc --noEmit
Check for TypeScript type errors.
bun lint:code && bun lint:types
Run both code and type linting.