Organize world's knowledge, explore connections and curate learning paths
The end goal of Learn Anything is to become the 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 the most optimal way possible given what you know already.
Try the website yourself first to get a feel for it.
It is a fully open source project with an active community on Discord. There is great focus on both DX of developing everything LA and even more, the end user UX.
Project consists of a website, desktop app, mobile app.
There is also separate repo of AI where we train & fine tune LLMs to provide AI interfaces to all things knowledge. Part of the goals of LA is to reach AGI and do it in a fully open way. The current start of that journey is in providing state of art ability to index any knowledge of a person and provide chat bot interface to it with different privacy controls. As well as having state of the art chat bots for each of the topics in LA platform.
If you're interested in the mission and like the project, join Discord where you can ask questions and interact with community and read on to get you started writing your first code.
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.
Current tasks to do are in GitHub issues (organised with labels). Tasks currently in focus are seen here.
- File structure - make sense of how code is laid out in the repo
- Setup - get started with development
- Run GraphQL server (Grafbase)
- Run website (Solid)
- Run desktop app (Tauri/Rust)
- Run mobile app (NativeScript/Solid)
- Contribute - contribute to project effectively
- Docs
- Design
- Commands
Tech stack is described in docs/tech-stack.md.
- app - desktop app in Tauri/Solid
- docs - all the docs
- 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 the 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
Everything is driven using bun commands as part of monorepo setup using pnpm workspaces (bun gave issues with installing deps and breaking builds) so pnpm is used to install and add dependencies but bun to run them. You can also swap bun
with pnpm
and commands will work as well. Bun is used only because it's faster to run and works quite well already in most cases.
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
seed, ai and solana 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 seed 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
Read instructions in mobile
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.
We want this project to have by far the best DX of any open source project on GitHub. There will be live streams of developing the code, various educational videos and a lot more in coming time.
All docs can be seen in docs. Will be rendered nicely on website with VitePress soon.
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 docs/dev-tips.md 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.
Warning Table below may be out of date. We need to write an automated github action or similar to keep it up to date.
Ran with bun <Name>
Name | Command |
---|---|
setup | bun cmd.ts init |
seed-clone | git clone https://github.com/learn-anything/seed |
seed-update | cd seed && git pull |
app | cd app && bun tauri:dev |
web | cd website && bun dev |
web:build | cd website && solid-start build |
web:start | cd website && solid-start start |
db | cd grafbase/edgedb && tput reset && bun --watch cli/cli.ts |
db:init | cd grafbase/edgedb && edgedb project init |
db:ui | cd grafbase/edgedb && edgedb ui |
db:watch | cd grafbase/edgedb && edgedb watch |
db:migrate | cd grafbase/edgedb && edgedb migration create && edgedb migrate && bunx @edgedb/generate edgeql-js --target ts && bunx @edgedb/generate queries --target ts |
db:queries-generate | cd grafbase/edgedb && bunx @edgedb/generate edgeql-js --target ts && bunx @edgedb/generate queries --target ts |
db:get-dsn | cd grafbase/edgedb && edgedb instance credentials --insecure-dsn |
db:dump | cd private && edgedb dump prod.db |
db:load-connections | cd grafbase/edgedb && tput reset && bun cli/loadConnectionsIntoGrafbase.ts |
api | bunx grafbase@latest dev |
ts | tput reset && bun --watch run.ts |
test-rust-wiki | cd app/src-tauri/crates/wiki/ && cargo watch -q -- sh -c "tput reset && cargo test -q --lib" |
grafbase | npx grafbase@latest dev |
format | prettier -w . |
lint:code | eslint --ignore-path .gitignore --max-warnings 0 --ext .ts,.tsx,.js,.jsx . |
lint:types | tsc --noEmit |
lint | bun lint:code && bun lint:types |
Learn Anything logo by NUMI: