Skip to content

Commit

Permalink
feat: init
Browse files Browse the repository at this point in the history
  • Loading branch information
jackdishman committed Jul 25, 2022
0 parents commit 886497d
Show file tree
Hide file tree
Showing 172 changed files with 14,006 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
module.exports = {
root: true,
env: {
node: true,
"vue/setup-compiler-macros": true,
},
extends: [
"plugin:vue/vue3-recommended",
"@vue/typescript/recommended",
"plugin:prettier/recommended",
],
parserOptions: {
ecmaVersion: 2020,
},
rules: {
"no-console": process.env.NODE_ENV === "production" ? "warn" : "off",
"no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off",
"vue/multi-word-component-names": "off",
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-unused-vars": "off",
},
};
25 changes: 25 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
.env
9 changes: 9 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"useTabs": true,
"semi": false,
"quoteProps": "as-needed",
"singleQuote": true,
"trailingComma": "all",
"arrowParens": "always",
"printWidth": 120
}
57 changes: 57 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<div align="center">

<h1>Capsule-Author Dashboard</h1>

Front-End powering Capsule Social's author dashboard.

</div>

## Requirements

- NodeJS v14.5.0 or higher.

## Getting started

### .env Setup

```bash
# Create .env with the credentials below

VUE_CAPSULE_SERVER=https://payments.capsule.social/server
VUE_CONTRACT_NAME=dev-1635323648697-81373157539648
VUE_NEAR_NETWORK=testnet

```

### Deploy Web App

```bash
# install dependencies
$ `yarn install`

# Server with hot reload on http://localhost:3000
$ `yarn dev`

# Code Linting
$ `yarn lint`

# Code Formatting
$ `yarn format`

# Production build
$ `yarn build`


```

# Vue 3 + Typescript + Vue-CLI

This template should help get you started developing with Vue 3 and Typescript in Vite. The template uses Vue 3 `<script setup>` SFCs, check out the [script setup docs](https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup) to learn more.

## Recommended IDE Setup

- [VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=johnsoncodehk.volar)

## Type Support For `.vue` Imports in TS

Since TypeScript cannot handle type information for `.vue` imports, they are shimmed to be a generic Vue component type by default. In most cases this is fine if you don't really care about component prop types outside of templates. However, if you wish to get actual prop types in `.vue` imports (for example to get props validation when using manual `h(...)` calls), you can enable Volar's `.vue` type support plugin by running `Volar: Switch TS Plugin on/off` from VSCode command palette.
3 changes: 3 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
presets: ["@vue/cli-plugin-babel/preset"],
};
6 changes: 6 additions & 0 deletions example.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Create .env with the credentials below

VUE_APP_CAPSULE_SERVER=https://payments.capsule.social/server
VUE_APP_CONTRACT_NAME=dev-1635323648697-81373157539648
VUE_APP_BASE_URL=https://payments.capsule.social
NEAR_NETWORK=testnet
57 changes: 57 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"name": "blogchain-dashboard",
"private": true,
"version": "0.0.0",
"scripts": {
"dev": "vue-cli-service serve",
"preview": "serve -s dist",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint",
"format": "prettier . --write"
},
"dependencies": {
"axios": "^0.27.2",
"capsule-config": "^1.2.3",
"core-js": "^3.22.8",
"ipfs-core": "^0.14.3",
"libsodium-wrappers": "^0.7.10",
"near-api-js": "^0.44.2",
"pinia": "^2.0.14",
"pinia-plugin-persistedstate": "^1.6.1",
"toastify-js": "^1.11.2",
"util": "^0.12.4",
"vue": "^3.2.36",
"vue-router": "^4.0.15"
},
"devDependencies": {
"@babel/core": "^7.18.5",
"@babel/eslint-parser": "^7.18.2",
"@types/libsodium-wrappers": "^0.7.9",
"@types/toastify-js": "^1.11.1",
"@typescript-eslint/eslint-plugin": "^5.29.0",
"@typescript-eslint/parser": "^5.29.0",
"@vue/cli-plugin-babel": "~5.0.6",
"@vue/cli-plugin-eslint": "~5.0.6",
"@vue/cli-plugin-typescript": "~5.0.6",
"@vue/cli-service": "~5.0.6",
"@vue/eslint-config-typescript": "^11.0.0",
"autoprefixer": "^10.4.7",
"crypto-browserify": "^3.12.0",
"eslint": "^8.18.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-vue": "^9.1.1",
"path-browserify": "^1.0.1",
"postcss": "^8.4.14",
"prettier": "^2.7.1",
"serve": "^13.0.2",
"stream-browserify": "^3.0.0",
"tailwindcss": "^3.1.4",
"typescript": "^4.7.2"
},
"browserslist": [
"last 2 versions",
"not dead",
"not IE 11"
]
}
6 changes: 6 additions & 0 deletions postcss.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
};
Binary file added public/favicon.ico
Binary file not shown.
21 changes: 21 additions & 0 deletions public/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!DOCTYPE html>
<html lang="">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
<link rel="icon" href="<%= BASE_URL %>favicon.ico" />
<title><%= htmlWebpackPlugin.options.title %></title>
</head>
<body>
<noscript>
<strong
>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work
properly without JavaScript enabled. Please enable it to
continue.</strong
>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>
83 changes: 83 additions & 0 deletions src/App.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
<script setup lang="ts">
// This starter template is using Vue 3 <script setup> SFCs
// Check out https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup
import TopHeader from './components/TopHeader.vue'
import SideNav from './components/SideNav.vue'
import Footer from './components/Footer.vue'
import Ressouces from './components/Ressources.vue'
import { useStore } from './store/session'
import { useStoreSettings } from './store/settings'
import { initColors } from './plugins/colors'
import { getBGImage } from './plugins/background'
import { setColorMode } from './plugins/colormode'
import ipfs, { initIPFS } from './backend/utilities/ipfs'
import { onBeforeMount, ref } from 'vue'
// import { useRouter } from 'vue-router'
initIPFS()
const store = useStore()
const settings = useStoreSettings()
const avatar = ref<string>(``)
// const router = useRouter()
// Methods
function getAvatar(cid: string) {
if (cid === ``) {
return
}
ipfs()
.getData(cid)
.then((res) => {
avatar.value = res
})
}
// Run init methods
onBeforeMount(() => {
store.login()
settings.sync()
setColorMode(settings.mode)
initColors()
getAvatar(store.$state.avatar)
})
// onMounted(async () => {
// if (!store.$state.id) {
// })
</script>

<template>
<!-- wrapper -->
<main
class="bg-img m-0 h-screen overflow-y-hidden p-0 bg-lightBG dark:bg-darkBG"
:style="{
backgroundImage: `url(` + getBGImage(store.background) + `)`,
}"
>
<!-- Wrapper -->
<div class="flex w-full justify-center">
<div class="flex flex-col w-full lg:w-11/12 xl:w-10/12 max-w-1220">
<TopHeader :name="store.name" :avatar="avatar" />
<!-- Body -->
<section class="modal-animation flex flex-row">
<div
class="lg:w-7.5 min-h-80 h-80 from-lightBGStart to-lightBGStop dark:from-darkBGStart dark:to-darkBGStop border border-lightBorder z-10 w-full overflow-y-auto rounded-t-lg bg-gradient-to-r p-6 pt-4 pb-0 shadow-lg"
>
<router-view :key="$route.path" />
</div>
<aside
class="w-5/12 -mr-5 -mt-4 hidden overflow-y-auto p-4 lg:block"
:style="`min-height: calc(100vh - 150px); height: calc(100vh - 80px)`"
>
<SideNav
class="from-lightBGStart to-lightBGStop dark:from-darkBGStart dark:to-darkBGStop border-lightBorder mb-5 overflow-hidden rounded-lg border bg-gradient-to-r shadow-lg"
style="backdrop-filter: blur(10px)"
/>
<Ressouces />
<Footer />
</aside>
</section>
</div>
</div>
</main>
</template>
Binary file added src/assets/fonts/NotoSans-Black.woff2
Binary file not shown.
Binary file added src/assets/fonts/NotoSans-Bold.woff2
Binary file not shown.
Binary file added src/assets/fonts/NotoSans-BoldItalic.woff2
Binary file not shown.
Binary file added src/assets/fonts/NotoSans-ExtraBold.woff2
Binary file not shown.
Binary file added src/assets/fonts/NotoSans-ExtraLight.woff2
Binary file not shown.
Binary file added src/assets/fonts/NotoSans-Italic.woff2
Binary file not shown.
Binary file added src/assets/fonts/NotoSans-Light.woff2
Binary file not shown.
Binary file added src/assets/fonts/NotoSans-Medium.woff2
Binary file not shown.
Binary file added src/assets/fonts/NotoSans-Regular.woff2
Binary file not shown.
Binary file added src/assets/fonts/NotoSans-SemiBold.woff2
Binary file not shown.
Binary file added src/assets/fonts/NotoSans-Thin.woff2
Binary file not shown.
Binary file added src/assets/fonts/NotoSerif-Bold.woff2
Binary file not shown.
Binary file added src/assets/fonts/NotoSerif-BoldItalic.woff2
Binary file not shown.
Binary file added src/assets/fonts/NotoSerif-Italic.woff2
Binary file not shown.
Binary file added src/assets/fonts/NotoSerif-Regular.woff2
Binary file not shown.
Binary file added src/assets/images/avatars/beats.webp
Binary file not shown.
Binary file added src/assets/images/avatars/blues.webp
Binary file not shown.
Binary file added src/assets/images/avatars/cassete.webp
Binary file not shown.
Binary file added src/assets/images/avatars/fastfood.webp
Binary file not shown.
Binary file added src/assets/images/avatars/footballhead.webp
Binary file not shown.
Binary file added src/assets/images/avatars/hiphopblood.webp
Binary file not shown.
Binary file added src/assets/images/avatars/hiphopcribs.webp
Binary file not shown.
Binary file added src/assets/images/avatars/hiphopking.webp
Binary file not shown.
Binary file added src/assets/images/avatars/meathead.webp
Binary file not shown.
Binary file added src/assets/images/avatars/streetart.webp
Binary file not shown.
Binary file added src/assets/images/avatars/strongwomen.webp
Binary file not shown.
Binary file added src/assets/images/avatars/unauthenticated.webp
Binary file not shown.
Binary file not shown.
Binary file added src/assets/images/backgrounds/dark/blue.webp
Binary file not shown.
Binary file not shown.
Binary file added src/assets/images/backgrounds/dark/buoy.webp
Binary file not shown.
Binary file added src/assets/images/backgrounds/dark/green.webp
Binary file not shown.
Binary file added src/assets/images/backgrounds/dark/jelly.webp
Binary file not shown.
Binary file added src/assets/images/backgrounds/dark/mainBG.webp
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added src/assets/images/backgrounds/dark/old_guy.webp
Binary file not shown.
Binary file added src/assets/images/backgrounds/dark/orange.webp
Binary file not shown.
Binary file added src/assets/images/backgrounds/dark/pink.webp
Binary file not shown.
Binary file added src/assets/images/backgrounds/dark/sharkman.webp
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added src/assets/images/backgrounds/dark/yellow.webp
Binary file not shown.
Binary file not shown.
Binary file added src/assets/images/backgrounds/light/blue.webp
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added src/assets/images/backgrounds/light/buoy.webp
Binary file not shown.
Binary file added src/assets/images/backgrounds/light/green.webp
Binary file not shown.
Binary file not shown.
Binary file added src/assets/images/backgrounds/light/jelly.webp
Binary file not shown.
Binary file added src/assets/images/backgrounds/light/mainBG.webp
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added src/assets/images/backgrounds/light/old_guy.webp
Binary file not shown.
Binary file added src/assets/images/backgrounds/light/orange.webp
Binary file not shown.
Binary file added src/assets/images/backgrounds/light/pink.webp
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added src/assets/images/backgrounds/light/yellow.webp
Binary file not shown.
Binary file added src/assets/images/monetize.webp
Binary file not shown.
Binary file added src/assets/images/util/error.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/images/util/message.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/images/util/success.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/images/util/warning.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 886497d

Please sign in to comment.