/ipfs-notes

stroring use notes on ipfs server and extracting them as and when required

Primary LanguageTypeScriptMIT LicenseMIT

IPFS Notes: DeSci Labs - Software Engineer Coding Challenge

Please follow the instructions below to complete our coding challenge. Once you are finished, send the result of your work to people@desci.com and mention your name in the email as well.

As a small team dedicated to careful review of each application, our response may take some time. We will get back to you as soon as possible.


DeSci Labs is trying to improve the pace of innovation in science. We're approaching this by building tools to grow open science. One way we're doing this is by upgrading the PID system for academic research. We want to catalog and reference research outputs for the long term, and solve issues caused by the legacy DOI system.

One component of this is using content-addressed storage. IPFS is an implementation of distributed content-addressed storage.

In this project we have a full-stack Next.js application using Typescript and ESLint, alongside an IPFS node managed by Docker.

Note: There is a configuration for a local IPFS node that uses a swarm key in order to make the node private. This key will be autogenerated by setup.sh (auto-ran when npm run dev) and placed in the .env file. If this key is not set, the IPFS node may not function properly in private mode.

Requirements

  1. *nix box or Windows running WSL
  2. Docker installed

The challenge here is to enable the following functions

  1. Write text notes in the UI and save them to IPFS
  2. Display these notes to the user on-demand

Bonus Points (we suggest trying at least one)

  1. Figure out how to allow the notes to survive between server restarts
  2. Make the UI modern and smooth (we have pre-included TailwindCSS)
  3. Allow users to sign notes using encryption
  4. Allow support for file uploads
  5. Enable IPLD support (nested directory file management)
  6. Enable search support
  7. Support for 10k+ notes
  8. Enable multiplayer (multiple collaborators in real-time can work on notes)
  9. Enable WebGL/3D support for exploring notes (or just to look cool)
  10. Write highly useful tests
  11. ??? (surprise us)

We respect your time

We don't want you to spend too long on this project, just enough to get basic functionality down. If you have time left over, feel free to add bonus features. We've set up some basic plumbing for you, to make this exercise as productive as possible, read on to see what's been set up.

Running the code

  1. ./setup.sh (copies your local environment variables and sets your swarm key, this will be done for you in the next step)
  2. npm run dev (starts Next.js frontend/backend)
  3. docker compose up (starts local IPFS on port 5001)

Blank Slate: Testing the pipes

You should be greeted with the following page on http://localhost:3000 (or another port if 3000 is taken)

First Load

Then if you click "Retrieve Data" a simple API is called and information is delivered to the frontend.

After Retrieve

Notes

The following error message is normal, it means you're running a private IPFS node

ERROR   cmd/ipfs        ipfs/daemon.go:567      failed to bootstrap (no peers found): consider updating Bootstrap or Peering section of your config

Want to reset IPFS state? The IPFS data volume is persisted in ./local-data you may also opt to destroy the Docker container

Known issues

How to solve "JSX element implicitly has type 'any' " error?

(Windows: ctrl + shift + p) or (Mac: cmd + shift + p) then search Typescript:Restart TS server hit enter and done.