Skip to content

Commit

Permalink
Merge pull request #9 from dao-xyz/blog-platform
Browse files Browse the repository at this point in the history
New demo: Blog platform
  • Loading branch information
marcus-pousette authored Feb 24, 2024
2 parents ad08625 + f09e5df commit c6f73a5
Show file tree
Hide file tree
Showing 27 changed files with 2,471 additions and 809 deletions.
49 changes: 49 additions & 0 deletions packages/blog-platform/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Blog platform

A app that allwos you to do blogging

## Library
In the library folder you can find all code that is handling the file data.


## CLI

This is the UI

<img src="./demo-cli.gif" width="600" />

There is a CLI application inside [./cli](./cli), that allows you to do the basic functionality.

Install from remote:

```sh
npm install @peerbit/blog -g
```

Launch it
```sh
blog
```


### Run CLI locally
To run it locally:

First go to the root folder of the exampels repo and build it

```
yarn build
```

Then go back to the [./cli](./cli) folder and now you can do:

```node ./cli/lib/esm/bin.js``` instead of ```blog``` to invoke the cli.



## Server

This package contains an express server that wraps the blog client

You can interact with the server using API tools, like Insomnia to read blog posts

7 changes: 7 additions & 0 deletions packages/blog-platform/cli/nodemon.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"watch": ["src"],
"ext": "ts",
"ignore": ["src/__tests__/**"],
"exec": "ts-node --esm ./src/bin.ts",
"stdin": false
}
49 changes: 49 additions & 0 deletions packages/blog-platform/cli/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"name": "@peerbit/blog",
"version": "0.0.1",
"author": "dao.xyz",
"repository": "https://github.com/@dao-xyz/peerbit-examples",
"license": "Apache-2.0",
"type": "module",
"private": false,
"sideEffects": false,
"module": "lib/esm/index.js",
"types": "lib/esm/index.d.ts",
"exports": {
"import": "./lib/esm/index.js"
},
"bin": {
"blog": "./lib/esm/bin.js"
},
"files": [
"lib",
"src",
"!src/**/__tests__",
"!lib/**/__tests__",
"LICENSE"
],
"publishConfig": {
"access": "public"
},
"engines": {
"node": ">=16.15.1"
},
"scripts": {
"clean": "shx rm -rf lib/*",
"build": "yarn clean && tsc -p tsconfig.json",
"test": "node ../../../node_modules/.bin/jest test -c ../../../jest.config.ts --runInBand --forceExit",
"test:unit": "node ../../../node_modules/.bin/jest test -c ../../../jest.config.unit.ts --runInBand --forceExit",
"test:integration": "node ../../../node_modules/.bin/jest test -c ../../../jest.config.integration.ts --runInBand --forceExit",
"watch": "nodemon"
},
"devDependencies": {
"typescript": "^5.3.3",
"@types/inquirer": "^9"
},
"dependencies": {
"@peerbit/blog-sdk": "^0.0.1",
"@inquirer/editor": "^2",
"@inquirer/select": "^2",
"@inquirer/input": "^2"
}
}
3 changes: 3 additions & 0 deletions packages/blog-platform/cli/src/bin.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { start } from "./cli.js";

start();
Loading

0 comments on commit c6f73a5

Please sign in to comment.