Skip to content

Commit

Permalink
Merge pull request #19 from desci-labs/m0ar/remove-poc-app
Browse files Browse the repository at this point in the history
Remove PoC webapp, general cleanup
  • Loading branch information
m0ar authored Nov 2, 2023
2 parents cb51409 + 21191c0 commit b11e3e4
Show file tree
Hide file tree
Showing 69 changed files with 2,922 additions and 5,191 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
src/__generated__/*
18 changes: 18 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
module.exports = {
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended'
],
parser: '@typescript-eslint/parser',
plugins: [
'@typescript-eslint',
'prettier',
],
root: true,
rules: {
"prettier/prettier": "error",
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": ["error", { "varsIgnorePattern": "^_" }]
}
};
3 changes: 0 additions & 3 deletions .eslintrc.json

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
on:
pull_request:
branches:
branches:
- main
jobs:
test:
Expand Down
8 changes: 8 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

if ! npm run lint:check; then
echo "⚠️ Linting failed, trying to fix. Solve any remaining issues and try again."
npm run lint:fix
exit 1
fi
68 changes: 34 additions & 34 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
{
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"files.exclude": {
"**/.git": true,
"**/.svn": true,
"**/.hg": true,
"**/CVS": true,
"**/.DS_Store": true,
"**/Thumbs.db": true
},
"hide-files.files": [],
"editor.formatOnSave": true, // Tell VSCode to format files on save
"editor.defaultFormatter": "esbenp.prettier-vscode",
"typescript.format.enable": false,
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"files.exclude": {
"**/.git": true,
"**/.svn": true,
"**/.hg": true,
"**/CVS": true,
"**/.DS_Store": true,
"**/Thumbs.db": true
},
"hide-files.files": [],
"editor.formatOnSave": true, // Tell VSCode to format files on save
/// TSX auto format on save ESLint
"source.fixAll.eslint": true
}
},
"[typescriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"typescript.format.enable": false,
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
/// TSX auto format on save ESLint
"source.fixAll.eslint": true
}
},
"[typescriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
/// TSX auto format on save ESLint
"source.fixAll.eslint": true
}
},
"[xml]": {
"editor.defaultFormatter": "redhat.vscode-xml"
},
"[properties]": {
"editor.defaultFormatter": "foxundermoon.shell-format"
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
/// TSX auto format on save ESLint
"source.fixAll.eslint": true
}
},
"[xml]": {
"editor.defaultFormatter": "redhat.vscode-xml"
},
"[properties]": {
"editor.defaultFormatter": "foxundermoon.shell-format"
}
}
17 changes: 13 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
.PHONY: clean-test test
.PHONY: clean clean-test test

clean:
rm -rf node_modules local-data

clean-test:
rm -rf local-data/ceramic-test

test: clean-test
sed 's|local-data/ceramic|local-data/ceramic-test|' composedb.config.json > test.config.json
if pgrep --older 1 --count --full "ceramic daemon|ipfs daemon"; then \
echo "Refusing to clobber running daemons"; exit 1; \
fi

sed 's|local-data/ceramic|local-data/ceramic-test|' composedb.config.json \
> test.config.json
npx ceramic daemon --config test.config.json &>/dev/null &
sleep 5
node scripts/composites.mjs
# Kill daemons without losing test exit code for CI

npm run deployComposites
# Ensure daemons dead, without losing test exit code for CI
if npm test; then \
npm run kill; true; \
else \
Expand Down
46 changes: 28 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,37 +1,47 @@
# ComposeDB configuration
This is a rough take on model definitions for DeSci Nodes on Ceramic and ComposeDB,
based on a Ceramic demo at ETHDenver and snippets from Mark Krasner.
# Protocol V2 reference implementation
This repo contains a reference implementation for the next generation of the protocol, built on [Ceramic](https://ceramic.network/) and [ComposeDB](https://composedb.js.org/docs/0.5.x/introduction). It includes data models and an extensive test suite to ensure correct functionality, but also example data population and a GraphiQL interface to explore the protocol structure.

## Getting Started
1. Install your dependencies:
By default, the application runs a local Ceramic/ComposeDB node with the bundled IPFS server, uses the `inmemory` network for anchoring, and writes all data and logs to `local-data`.

The protocol documentation can be found [here](pls-replace-me)!

## Getting started

1. Install dependencies:

```bash
nvm use # ensure node 20 is selected according to .nvmrc
npm install
nvm use # or otherwise ensure the use of node v20
npm ci # install deps
```

2. Generate your admin seed, admin did, and ComposeDB configuration file:
2. Generate your own seed, admin DID, and ComposeDB configuration file:

```bash
npm run generate
```

3. Finally, run your application in a new terminal:
3. Finally, start the services:

```bash
npm run dev
```
- Open [http://localhost:3000](http://localhost:3000) to get to Nodes Home
- Open [http://localhost:5001](http://localhost:5001) for the GraphiQL interface

## Reset
To clean everything up, delete `local-data`. This is necessary when changing networks, for example.
Now you can open [http://localhost:5001](http://localhost:5001) for the GraphiQL interface and explore the data models.

## Tests
There is a test suite running through API operations demonstrating the functional protocol
requirements in an isolated ceramic instance not to dirty down the state, but can also be
run against the dev process. Not both at the same time though, because the ports overlap.
## Test suite

There is a test suite running through API operations demonstrating the functional protocol requirements, by generating random DID's and performing create and mutation operations. Before each run, it will remove the remains of the last test execution.

The test setup clones your user configuration, but changes storage to `local-data/ceramic-test` not to interfere with prepopulated data. It will refuse to run if `npm run dev` is already active.

```bash
make test
```
```

## Reset

To reset to a clean state, deleting everything except generated seed and user config:

```bash
make clean
```
34 changes: 0 additions & 34 deletions components/AttestButton.tsx

This file was deleted.

40 changes: 0 additions & 40 deletions components/AttestList.tsx

This file was deleted.

33 changes: 0 additions & 33 deletions components/AuthPrompt.tsx

This file was deleted.

25 changes: 0 additions & 25 deletions components/ResearchObject.tsx

This file was deleted.

Loading

0 comments on commit b11e3e4

Please sign in to comment.