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 as it stands is a website and a desktop app. There is also mobile app in works currently in separate repo. We plan to train our own LLMs as we provide AI interfaces to all things knowledge, be it global AGI level queries ala ChatGPT or querying into any person's knowledge base with different levels of privacy.
There is more exciting projects planned and under way (like digital idea/goods marketplace with solana support). If interested, read on to setup the project and start writing your first code.
- 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)
- Contribute - contribute to project effectively
- Docs
- Commands
Current tasks to do are in todo.md (sorted by priority). Will be migrated to GitHub issues soon. As aside there is work being done too to make KusKus be the GitHub issues client that will be recommended to keep track of issues being worked on. Can join development of that too if you like.
Do join Discord and ask questions. 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.
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
- packages - shared TS packages
- 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 bun workspaces.
First run:
bun i
bun setup
bun setup
runs bun setup.ts init
(can see setup.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 repo. Which contains various files needed to bootstrap the database with content.
Running bun setup:full
will clone ai, mobile and buy codebases so you can work with them as one monorepo. Tooling for that will get better with time.
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
.
Run bun db:ui
. This will open EdgeDB graphical interface where you can run queries or explore the schema.
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.
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
Current tasks to do are in todo.md (sorted by priority). Will be organised much better with GitHub issues very soon.
If task/bug is not mentioned there, open a GitHub issue or start discussion on GitHub or Discord.
All PRs with improvements to docs/code or contributions to existing discussions/issues are welcome.
We want this project to have by far the best DX of any open source project on GitHub. We plan to do 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.
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 setup.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 |