Skip to content

Commit

Permalink
Merge pull request #42 from KSJaay/docs
Browse files Browse the repository at this point in the history
Docs - Updates docs and fixes issues with demo mode
  • Loading branch information
KSJaay authored Jun 3, 2024
2 parents 6273ccb + 90d646d commit 4513e27
Show file tree
Hide file tree
Showing 34 changed files with 781 additions and 24 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
</div>

<h2 align="center">Open source monitoring tool built with Node.js & React</h2>
<div align="center">
<a href="https://lunalytics.xyz">Documentation</a> ·
<a href="https://demo.lunalytics.xyz">Try live demo</a> ·
<a href="https://lunalytics.xyz/api/monitor">API Docs</a> ·
<a href="https://lunalytics.xyz/internal/roadmap">Roadmap</a>
</div>

## ⭐ Features

Expand Down
47 changes: 45 additions & 2 deletions docs/.vitepress/config.mts
Original file line number Diff line number Diff line change
@@ -1,20 +1,45 @@
import { defineConfig } from 'vitepress';

// https://vitepress.dev/reference/site-config
export default defineConfig({
title: 'Lunalytics',
description: 'Documentation for Lunalytics',
head: [
['link', { rel: 'icon', href: '/icon-192x192.png' }],
['link', { rel: 'manifest', href: '/manifest.json' }],
['meta', { name: 'theme-color', content: '#ffffff' }],
['meta', { name: 'apple-mobile-web-app-capable', content: 'yes' }],
[
'meta',
{ name: 'apple-mobile-web-app-status-bar-style', content: 'black' },
],
['link', { rel: 'apple-touch-icon', href: '/icon-192x192.png' }],
['meta', { name: 'msapplication-TileImage', content: '/icon-192x192.png' }],
['meta', { name: 'msapplication-TileColor', content: '#000000' }],
[
'meta',
{ name: 'viewport', content: 'width=device-width, initial-scale=1.0' },
],
['meta', { name: 'description', content: 'Documentation for Lunalytics' }],
],
themeConfig: {
// https://vitepress.dev/reference/default-theme-config
logo: 'https://raw.githubusercontent.com/KSJaay/Lunalytics/main/public/icon-512x512.png',
nav: [
{ text: 'Home', link: '/' },
{ text: 'Docs', link: '/intro' },
{ text: 'API', link: '/api/monitor' },
// { text: 'Blog', link: '/blog' },
],

sidebar: [
{
text: 'Getting Started',
items: [{ text: 'What is Lunalytics?', link: '/intro' }],
items: [
{ text: 'What is Lunalytics?', link: '/intro' },
{ text: 'Getting Started', link: '/getting-started' },
{ text: 'Configuration', link: '/configuration' },
],
collapsed: false,
},
{
Expand All @@ -27,7 +52,25 @@ export default defineConfig({
},
{
text: 'Internals',
items: [{ text: 'Changelog', link: '/internals/changelog' }],
items: [
// { text: 'Overview', link: '/internals/overview' },
{ text: 'Changelog', link: '/internals/changelog' },
// { text: 'Flows', link: '/internals/flows' },
{ text: 'Notifications', link: '/internals/notifications' },
{ text: 'Permissions', link: '/internals/permissions' },
{ text: 'Roadmap', link: '/internals/roadmap' },
],
collapsed: false,
},
{
text: 'Contributing',
items: [
// { text: 'Overview', link: '/contributing/overview' },
// { text: 'Code of Conduct', link: '/contributing/conduct' },
{ text: 'Pull request', link: '/contributing/pull-request' },
{ text: 'Testing', link: '/contributing/testing' },
// { text: 'Issues', link: '/contributing/issues' },
],
collapsed: false,
},
],
Expand Down
31 changes: 31 additions & 0 deletions docs/components/kanban/badge.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<template>
<div
:style="{ backgroundColor: color.background, color: color.color }"
class="badge"
>
<slot></slot>
</div>
</template>
<script>
export default {
props: {
color: {
type: Object,
default: {
color: '#8f44e1',
background: 'white',
},
},
},
};
</script>

<style scoped>
.badge {
padding: 3px 6px;
display: inline-flex;
align-items: center;
border-radius: 8px;
font-weight: 600;
}
</style>
83 changes: 83 additions & 0 deletions docs/components/kanban/index.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
<!--
Type: Low, Medium, High, Bug, Design, Complete
-->

<template>
<div id="app" class="kanban-container">
<div v-for="column in columns" :key="column.title" class="kanban-column">
<div class="kanban-column-container">
{{ column.title }}
<span class="kanban-column-content">
{{ column.tasks.length }}
</span>
</div>
<TaskCard v-for="task in column.tasks" :key="task.title" :task="task" />
</div>
</div>
</template>

<script>
import TaskCard from './taskCard.vue';
import axios from 'axios';

export default {
name: 'App',
components: { TaskCard },
data() {
return {
columns: [],
};
},
mounted() {
axios
.get('https://demo.lunalytics.xyz/api/kanban')
.then((response) => (this.columns = response));
},
};
</script>

<style scoped>
.kanban-container {
display: flex;
flex-direction: column;
gap: 20px;
margin-top: 16px;
}

.kanban-column {
background-color: var(--vp-c-brand-dimm);
padding: 8px 10px 16px 10px;
border-radius: 12px;
flex: 1;
}

.kanban-column-container {
display: flex;
justify-content: center;
align-items: center;
gap: 8px;
font-weight: 600;
}

.kanban-column-content {
font-weight: 600;
color: var(--vp-c-brand);
background-color: var(--vp-c-brand-light);
border-radius: 100%;
text-align: center;
width: 20px;
height: 20px;
display: flex;
justify-content: center;
align-items: center;
font-size: 14px;
color: black;
}

@media only screen and (min-width: 1100px) {
.kanban-container {
flex-direction: row;
gap: 16px;
}
}
</style>
101 changes: 101 additions & 0 deletions docs/components/kanban/taskCard.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
<template>
<div class="kanban-task">
<div :style="{ display: 'flex', justifyContent: 'space-between' }">
<badge v-if="task.type" :color="badgeColor">{{ task.type }}</badge>
<a v-if="task.link" class="link-container" :href="task.link">🔗</a>
</div>

<div class="kanban-title">
{{ task.title }}
</div>

<div class="kanban-description">
{{ task.description }}
</div>

<div
:style="{
display: 'flex',
justifyContent: 'flex-end',
color: '#a5a5a5',
}"
>
📅 {{ task.date }}
</div>
</div>
</template>

<script>
import Badge from './badge.vue';
export default {
components: {
Badge,
},
props: {
task: {
type: Object,
default: () => ({}),
},
},
computed: {
badgeColor() {
const mappings = {
Low: { background: '#6d6d6d', color: 'white' },
Medium: { background: '#e9c739', color: '#222222' },
High: { background: '#d92f20', color: 'white' },
Bug: { background: '#fb8a31', color: '#222222' },
Design: { background: '#8f44e1', color: 'white' },
Complete: { background: '#00b846', color: 'white' },
default: { background: '#8f44e1', color: 'white' },
};
return mappings[this.task.type] || mappings.default;
},
},
};
</script>

<style scoped>
.kanban-task {
display: flex;
flex-direction: column;
gap: 8px;
margin-top: 10px;
padding: 8px 10px;
border-radius: 12px;
background-color: var(--vp-c-brand-dimm);
}
.kanban-title {
font-size: 18px;
font-weight: 600;
color: white;
margin: 0;
padding: 0;
text-align: left;
margin: 6px 0 4px 0;
}
.kanban-description {
font-size: 14px;
font-weight: 400;
color: #bbbbbb;
margin: 0;
padding: 0;
text-align: left;
}
.link-container {
display: flex;
padding: 4px;
align-items: center;
gap: 4px;
background-color: var(--vp-c-brand-dimm);
border-radius: 8px;
cursor: pointer;
text-decoration: none;
}
.link-container:hover {
background-color: var(--vp-c-brand-darker);
}
</style>
73 changes: 73 additions & 0 deletions docs/configuration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# Configuration

## Setup Lunalytics

Configurations don't need to be setup before starting Lunalytics. But this it is HIGHLY recommended you run the setup script or create a `config.json` for security reasons. A script can be created by running the following command:

::: code-group

```bash [npm]
# Setup application
npm run setup
```

```bash [yarn]
# Setup application
yarn setup
```

```bash [pnpm]
# Setup application
pnpm setup

```

:::

The following values need to be added to the config.json file:

::: code-group

```json [config.json]
{
"port": Number,
"jwtSecret": String,
"migrationType": String,
"database": {
"name": String
},
"version": String,
"isDemo": Boolean
}
```

:::

### Port

Port needs to be a number between 1 and 65535. The application will be hosted on this port.

### JWT Secret Key

We use Json Web Tokens (JWT) to authenticate users. The JWT is signed using a secret key, and then stored in the users cookies. Any requests made to the API is verified using the JWT token (`access_token` cookie). We strongly recommend the JWT secret key being at least 64 bytes.

### Migration Type

Migration type can be one of the following:

- automatic
- manual

When migration type is set to `automatic`, the application will automatically run migrations, when the latest version is pulled from GitHub. When it is set to `manual`, the application will not run migrations. You can manually run migrations using the `npm run migrate` command.

### Database

Database is an Object that contains a name key with the name of the database. In the future this will be expanded with other database options.

### Version

Version is the current version of the application. This is used in the migrations script to determine which migrations to run. For example, if the version is `0.4.0` and the latest version is `0.5.0`, then migrations from `0.4.0` to `0.5.0` will be run.

### isDemo

isDemo is a boolean that is used to determine if the application is in demo mode. When it is in demo mode, users will not be required to log into the application and will be given access to the application as a `guest` user.
Empty file added docs/contributing/conduct.md
Empty file.
Empty file added docs/contributing/issues.md
Empty file.
Empty file added docs/contributing/overview.md
Empty file.
Loading

0 comments on commit 4513e27

Please sign in to comment.