Organize world's knowledge, explore connections and curate learning paths
- 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).
Ask questions on Discord if interested in developing the project or you get issues with setup.
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 DB
- edgedb - EdgeDB used as main server database
- dbschema
- default.esdl - EdgeDB schema definining all the models and relations
- migrations - migration files get generated after running
bun db:migrate
- client.ts - exports client to connect with EdgeDB
- topic.ts / user.ts - CRUD functions on models
- dbschema
- resolvers - edge resolvers are server functions exposed with GraphQL
- grafbase.config.ts - Grafbase's config
- 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 dev-setup
bun dev-setup
will git clone
seed repo. It's needed for some commands below to work.
Warning Instructions might break, will be reviewed before first LA public release
Install EdgeDB by running curl ..
command from EdgeDB website. It is used as main server database.
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.
Run below command to apply the schema defined in default.esdl on your local DB:
bun db:watch
Then, generate EdgeDB-TS bindings with:
bun db:ts-generate
Warning Instructions might break, will be reviewed before first LA public release
Before running Grafbase server, create file at grafbase/.env
with this content:
EDGEDB_INSTANCE=learn-anything
EDGEDB_SECRET_KEY=edbt_ey
EDGEDB_SECRET_KEY
can be gotten by running bun db:ui
which will open the EdgeDB UI.
In terminal after running above command you will see url like http://localhost:10700/ui?authToken=edbt_ey
. EDGEDB_SECRET_KEY
is the authToken content.
Then run:
npx grafbase@latest dev
Note Ideally bunx is used but
bun api
fails to run
Will start Grafbase locally and give you GraphQL access.
Visit http://localhost:4000/ to see Grafbase pathfinder
Warning Instructions might break, will be reviewed before first LA public release
Create .env
file inside website with this content:
VITE_HANKO_API=https://e879ccc9-285e-49d3-b37e-b569f0db4035.hanko.io
API_OF_GRAFBASE=http://127.0.0.1:4000/graphql
Hanko is used as auth provider. You can swap Hanko API variable content with one from a project you create yourself.
Run:
bun web
Warning Instructions might break, will be reviewed before first LA public release
bun app
Current tasks to do are in todo.md (sorted by priority).
If task/bug is not mentioned there, open a GitHub issue or start a discussion.
Join Discord to get any help you need to make your contribution.
All PRs with improvements to docs/code or contributions to existing discussions/issues are welcome.
All docs can be seen in docs.
It is advisable you read them, before you start developing anything as they try give 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.
Ran with bun <Name>
Name | Command |
---|---|
seed-clone | git clone https://github.com/learn-anything/seed |
seed-update | cd seed && git pull |
dev-setup | bun seed-clone |
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 edgedb && tput reset && bun --watch cli/cli.ts |
db:init | cd edgedb && edgedb project init |
db:ui | cd edgedb && edgedb ui |
db:watch | cd edgedb && edgedb watch |
db:migrate | cd edgedb && edgedb migration create && edgedb migrate && bunx @edgedb/generate edgeql-js --target ts |
db:ts-generate | cd edgedb && bunx @edgedb/generate edgeql-js --target ts |
api | bunx grafbase@latest dev |
api:codegen | graphql-codegen |
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" |