# time-line **Repository Path**: ifeb2/time-line ## Basic Information - **Project Name**: time-line - **Description**: arcblock dapp 示例 - **Primary Language**: JavaScript - **License**: Apache-2.0 - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2023-03-12 - **Last Updated**: 2024-05-28 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Getting Started with Create Blocklet This project was bootstrapped with [Create Blocklet](https://github.com/blocklet/create-blocklet). This blocklet is a static project, which means this is a frontend application. It's contained `client` code. ## File Structure - public/ - static files - favicon.ico - favicon - favicon.svg - favicon - index.html - main html file, template for vite vue - screenshots/ - Screenshots - src/ - Client side code (A standard vue app structure) - .env - Environment variables - .env.local - Local environment variables - .eslintrc.js - ESLint configuration - .gitignore - Git ignore file - .prettierrc - Prettier configuration - blocklet.md - Blocklet README - blocklet.yml - Blocklet configuration - LICENSE - License file - logo.png - Blocklet logo file - Makefile - Makefile - package.json - Npm package file - README.md - A guide for this blocklet - version - Version file ## Development 1. Make sure you have [@blocklet/cli](https://www.npmjs.com/package/@blocklet/cli) installed Blocklet needs blocklet server as a dependency. So you need to install it first. `npm install -g @blocklet/cli` See details in [https://developer.blocklet.io/docs/en/quick-start/blocklet-server#use-the-binary-distribution](https://developer.blocklet.io/docs/en/quick-start/blocklet-server#use-the-binary-distribution) 2. Init blocklet server & start blocklet server Before starting an blocklet server, you need to init blocklet server. `blocklet server init --mode=debug` `blocklet server start` See details in [https://developer.blocklet.io/docs/en/quick-start/blocklet-server](https://developer.blocklet.io/docs/en/quick-start/blocklet-server) 3. Go to the project directory `cd [name]` 4. Install dependencies: `npm install` or `yarn` 5. Start development server: `blocklet dev` ## Bundle After developing a blocklet, you may need to bundle it. Use `npm run bundle` command. ## Deploy - If you want to deploy this blocklet to local blocklet server, you can use `blocklet deploy .blocklet/bundle` command(Make sure the blocklet is bundled before deployment.) > Or you can simply use `npm run deploy` command. - If you want to deploy this blocklet to remote blocklet server, you can use the command below. ```shell blocklet deploy .blocklet/bundle --endpoint {your blocklet server url} --access-key {blocklet server access key} --access-secret {blocklet server access secret} ``` > Make sure the blocklet is bundled before deployment. ## Upload to blocklet store - If you want to upload the blocklet to any store for other users to download and use, you can following the following instructions. Bump version at first. ```shell make bump-version ``` Then config blocklet store url. You can use those store url in below. 1. [https://store.blocklet.dev/](https://store.blocklet.dev/) 2. [https://dev.store.blocklet.dev/](https://dev.store.blocklet.dev/) 3. A blocklet store started by yourself. > Make sure you have installed a `blocklet store` on your own blocklet server. Check it on here: [https://store.blocklet.dev/blocklet/z8ia29UsENBg6tLZUKi2HABj38Cw1LmHZocbQ](https://store.blocklet.dev/blocklet/z8ia29UsENBg6tLZUKi2HABj38Cw1LmHZocbQ) ```shell blocklet config set store {store url} ``` Get a `accessToken` from blocklet store. > Why we need a `accessToken`? > A `accessToken` is genrate by blocklet store, which help us upload our blocklet to any store. Set `accessToken` to blocklet config ```shell blocklet config set accessToken {accessToken} ``` Upload a new version to a store. > Make sure the blocklet is bundled before upload. ```shell blocklet upload ``` Or you can simply use `npm run upload` command. - You also can upload a new version to blocklet store by Github CI. Bump version at first. ```shell make bump-version ``` Push your code to Github main/master branch, or make a pull request to the main/master branch. The CI workflow will automatically upload a new version to a store. ## Q & A 1. Q: How to change a blocklet's name? A: Change the `name` field in the `package.json` file, change the `name` field in the `blocklet.yml` file. You can also change the `title` field and `description` field in the `blocklet.yml` file. Run `blocklet meta` command, you will get a `did` config, copy the `did` value. Replace this command `"bundle": "vite build --base /.blocklet/proxy/<%= did %>",` in `package.json` Replace `did` field in the `blocklet.yml` 2. Q: How to change a blocklet's logo? Change the `logo.png` file root folder. Or you can change the `logo` field in the `blocklet.yml` file. > Make sure you have added the logo path to the `blocklet.yml` file `files` field. ## Learn More - Full specification of `blocklet.yml`: [https://github.com/blocklet/blocklet-specification/blob/main/docs/meta.md](https://github.com/blocklet/blocklet-specification/blob/main/docs/meta.md) - Full document of Blocklet Server & blocklet development: [https://developer.blocklet.io/docs/en](https://developer.blocklet.io/docs/en) ## npx - npx prisma migrate dev --name init // 只在本地环境执行 - npx prisma init --datasource-provider sqlite 执行以下命令初始化 prisma,并使用 SQLite 作为你的数据库: - Prisma 带有一个内置的 GUI,用于查看和编辑数据库中的数据。您可以使用以下命令打开它: npx prisma studio z1o9qts5yJXbVcMcJvagH2h9jB3qgbhFCsz z5n5W7jbGHUiVgeadfCazkk6NJH8j1Jji6aad6ziSsFWZUDtRGzCZmDTTZWZuR6YG6HCA22kwdRCAAQuB9SvtRSLg blocklet deploy .blocklet/bundle \ --endpoint http://39.108.170.106/admin \ --access-key z1bs3htiFkS9QY5MY6NDKD8x1LF53ztgk15 \ --access-secret z5MYG8xfKVDbgaDua9bF54SZbbBhKYEXsxphydrecmd1eSNaMXtoRnHPLGrD2nL2EXDJL4DzaafGxfX3FiKKZ4PPw ## License The code is licensed under the Apache 2.0 license found in the [LICENSE](LICENSE) file.