mirror of
https://github.com/Litlyx/litlyx
synced 2025-12-09 23:48:36 +01:00
restructure
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
@use './utilities.scss';
|
||||
@use './colors.scss';
|
||||
|
||||
@import url('https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;0,1000;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900;1,1000&display=swap');
|
||||
@import url('https://fonts.cdnfonts.com/css/brockmann');
|
||||
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@100..900&display=swap');
|
||||
|
||||
@import '../font-awesome/css/all.css';
|
||||
@import './utilities.scss';
|
||||
@import './colors.scss';
|
||||
|
||||
@import url('https://fonts.cdnfonts.com/css/geometric-sans-serif-v1');
|
||||
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@200..800&display=swap');
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script lang="ts" setup>
|
||||
|
||||
import type { TProject } from '@schema/ProjectSchema';
|
||||
import type { TProject } from '@schema/project/ProjectSchema';
|
||||
|
||||
const { user } = useLoggedUser()
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
|
||||
|
||||
import type { TProject } from "@schema/ProjectSchema";
|
||||
import { ProjectSnapshotModel } from "@schema/ProjectSnapshot";
|
||||
import type { TProject } from "@schema/project/ProjectSchema";
|
||||
import { ProjectSnapshotModel } from "@schema/project/ProjectSnapshot";
|
||||
|
||||
const { token } = useAccessToken();
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { TProjectSnapshot } from "@schema/ProjectSnapshot";
|
||||
import type { TProjectSnapshot } from "@schema/project/ProjectSnapshot";
|
||||
|
||||
import fns from 'date-fns';
|
||||
|
||||
|
||||
@@ -15,21 +15,26 @@ export default defineNuxtConfig({
|
||||
autoprefixer: {},
|
||||
}
|
||||
},
|
||||
|
||||
colorMode: {
|
||||
preference: 'dark',
|
||||
},
|
||||
|
||||
devtools: {
|
||||
enabled: false
|
||||
},
|
||||
|
||||
pages: true,
|
||||
ssr: false,
|
||||
css: ['~/assets/scss/main.scss'],
|
||||
|
||||
alias: {
|
||||
'@schema': fileURLToPath(new URL('../shared/schema', import.meta.url)),
|
||||
'@services': fileURLToPath(new URL('../shared/services', import.meta.url)),
|
||||
'@data': fileURLToPath(new URL('../shared/data', import.meta.url)),
|
||||
'@functions': fileURLToPath(new URL('../shared/functions', import.meta.url)),
|
||||
},
|
||||
|
||||
runtimeConfig: {
|
||||
MONGO_CONNECTION_STRING: process.env.MONGO_CONNECTION_STRING,
|
||||
REDIS_URL: process.env.REDIS_URL,
|
||||
@@ -57,17 +62,23 @@ export default defineNuxtConfig({
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
nitro: {
|
||||
plugins: ['~/server/init.ts']
|
||||
},
|
||||
|
||||
plugins: [
|
||||
{ src: '~/plugins/chartjs.ts', mode: 'client' }
|
||||
],
|
||||
|
||||
...gooleSignInConfig,
|
||||
modules: ['@nuxt/ui', 'nuxt-vue3-google-signin'],
|
||||
|
||||
devServer: {
|
||||
host: '0.0.0.0',
|
||||
},
|
||||
|
||||
components: true,
|
||||
extends: ['../lyx-ui']
|
||||
})
|
||||
extends: ['../lyx-ui'],
|
||||
compatibilityDate: '2024-11-16'
|
||||
})
|
||||
@@ -22,7 +22,6 @@
|
||||
"googleapis": "^144.0.0",
|
||||
"highlight.js": "^11.10.0",
|
||||
"jsonwebtoken": "^9.0.2",
|
||||
"mongoose": "^8.3.2",
|
||||
"nuxt": "^3.11.2",
|
||||
"nuxt-vue3-google-signin": "^0.0.11",
|
||||
"openai": "^4.61.0",
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { AuthContext } from "./middleware/01-authorization";
|
||||
import { ProjectModel } from "~/../shared/schema/ProjectSchema";
|
||||
import { ProjectModel } from "@schema/project/ProjectSchema";
|
||||
import { LITLYX_PROJECT_ID } from '@data/LITLYX'
|
||||
import { hasAccessToProject } from "./utils/hasAccessToProject";
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ProjectModel } from "@schema/ProjectSchema";
|
||||
import { ProjectModel } from "@schema/project/ProjectSchema";
|
||||
import { UserModel } from "@schema/UserSchema";
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { ProjectModel } from "@schema/ProjectSchema";
|
||||
import { ProjectCountModel } from "@schema/ProjectsCounts";
|
||||
import { ProjectLimitModel } from "@schema/ProjectsLimits";
|
||||
import { ProjectModel } from "@schema/project/ProjectSchema";
|
||||
import { ProjectCountModel } from "@schema/project/ProjectsCounts";
|
||||
import { ProjectLimitModel } from "@schema/project/ProjectsLimits";
|
||||
import { UserModel } from "@schema/UserSchema";
|
||||
import StripeService from '~/server/services/StripeService';
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
import { ProjectCountModel } from "@schema/ProjectsCounts";
|
||||
import { ProjectCountModel } from "@schema/project/ProjectsCounts";
|
||||
import { EventModel } from "@schema/metrics/EventSchema";
|
||||
import { SessionModel } from "@schema/metrics/SessionSchema";
|
||||
import { VisitModel } from "@schema/metrics/VisitSchema";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ProjectLimitModel } from "@schema/ProjectsLimits";
|
||||
import { ProjectLimitModel } from "@schema/project/ProjectsLimits";
|
||||
|
||||
export async function getAiChatRemainings(project_id: string) {
|
||||
const limits = await ProjectLimitModel.findOne({ project_id })
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
|
||||
import { getUserProjectFromId } from "~/server/LIVE_DEMO_DATA";
|
||||
import { ApiSettingsModel, TApiSettings } from "@schema/ApiSettingsSchema";
|
||||
import { ProjectModel } from "@schema/ProjectSchema";
|
||||
import { ProjectModel } from "@schema/project/ProjectSchema";
|
||||
|
||||
import crypto from 'crypto';
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ProjectModel, TProject } from "@schema/ProjectSchema";
|
||||
import { ProjectModel, TProject } from "@schema/project/ProjectSchema";
|
||||
|
||||
export default defineEventHandler(async event => {
|
||||
const liveDemoProject = await ProjectModel.findById('6643cd08a1854e3b81722ab5');
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { getUserProjectFromId } from "~/server/LIVE_DEMO_DATA";
|
||||
import { ProjectCountModel } from "@schema/ProjectsCounts";
|
||||
import { ProjectCountModel } from "@schema/project/ProjectsCounts";
|
||||
import { SessionModel } from "@schema/metrics/SessionSchema";
|
||||
import { COUNTS_EXPIRE_TIME, COUNTS_SESSIONS_EXPIRE_TIME, Redis } from "~/server/services/CacheService";
|
||||
import { EventModel } from "@schema/metrics/EventSchema";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
|
||||
import { EventModel } from "@schema/metrics/EventSchema";
|
||||
import { ProjectModel } from "@schema/ProjectSchema";
|
||||
import { ProjectModel } from "@schema/project/ProjectSchema";
|
||||
import { Redis, TIMELINE_EXPIRE_TIME } from "~/server/services/CacheService";
|
||||
|
||||
export type EventsPie = {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { EventModel } from "@schema/metrics/EventSchema";
|
||||
import { VisitModel } from "@schema/metrics/VisitSchema";
|
||||
import { ProjectModel } from "@schema/ProjectSchema";
|
||||
import { ProjectModel } from "@schema/project/ProjectSchema";
|
||||
|
||||
export default defineEventHandler(async event => {
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { AggregateOptions, Model, Types } from "mongoose";
|
||||
import { ProjectModel } from "@schema/ProjectSchema";
|
||||
import { ProjectModel } from "@schema/project/ProjectSchema";
|
||||
|
||||
|
||||
export type MetricsTimeline = {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { AppsumoCodeTryModel } from "@schema/AppsumoCodeTrySchema";
|
||||
import { AppsumoCodeTryModel } from "@schema/appsumo/AppsumoCodeTrySchema";
|
||||
|
||||
export default defineEventHandler(async event => {
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
|
||||
import StripeService from '~/server/services/StripeService';
|
||||
import type Event from 'stripe';
|
||||
import { ProjectModel } from '@schema/ProjectSchema';
|
||||
import { ProjectModel } from '@schema/project/ProjectSchema';
|
||||
import { PREMIUM_DATA, PREMIUM_PLAN, getPlanFromId, getPlanFromPrice, getPlanFromTag } from '@data/PREMIUM';
|
||||
import { ProjectLimitModel } from '@schema/ProjectsLimits';
|
||||
import { ProjectLimitModel } from '@schema/project/ProjectsLimits';
|
||||
import EmailService from '@services/EmailService'
|
||||
import { UserModel } from '@schema/UserSchema';
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { ProjectModel, TProject } from "@schema/ProjectSchema";
|
||||
import { ProjectCountModel } from "@schema/ProjectsCounts";
|
||||
import { ProjectLimitModel } from "@schema/ProjectsLimits";
|
||||
import { ProjectModel, TProject } from "@schema/project/ProjectSchema";
|
||||
import { ProjectCountModel } from "@schema/project/ProjectsCounts";
|
||||
import { ProjectLimitModel } from "@schema/project/ProjectsLimits";
|
||||
import { UserSettingsModel } from "@schema/UserSettings";
|
||||
import StripeService from '~/server/services/StripeService';
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { ProjectModel } from "@schema/ProjectSchema";
|
||||
import { ProjectCountModel } from "@schema/ProjectsCounts";
|
||||
import { ProjectLimitModel } from "@schema/ProjectsLimits";
|
||||
import { ProjectModel } from "@schema/project/ProjectSchema";
|
||||
import { ProjectCountModel } from "@schema/project/ProjectsCounts";
|
||||
import { ProjectLimitModel } from "@schema/project/ProjectsLimits";
|
||||
import { SessionModel } from "@schema/metrics/SessionSchema";
|
||||
import { LimitNotifyModel } from "@schema/broker/LimitNotifySchema";
|
||||
import StripeService from '~/server/services/StripeService';
|
||||
|
||||
@@ -3,7 +3,7 @@ import pdfkit from 'pdfkit';
|
||||
|
||||
import { PassThrough } from 'node:stream';
|
||||
|
||||
import { ProjectModel } from "@schema/ProjectSchema";
|
||||
import { ProjectModel } from "@schema/project/ProjectSchema";
|
||||
import { VisitModel } from '@schema/metrics/VisitSchema';
|
||||
import { EventModel } from '@schema/metrics/EventSchema';
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
import { ProjectLimitModel } from "@schema/ProjectsLimits";
|
||||
import { ProjectLimitModel } from "@schema/project/ProjectsLimits";
|
||||
import { MAX_LOG_LIMIT_PERCENT } from '@data/broker/Limits';
|
||||
|
||||
export default defineEventHandler(async event => {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ProjectModel, TProject } from "@schema/ProjectSchema";
|
||||
import { ProjectModel, TProject } from "@schema/project/ProjectSchema";
|
||||
|
||||
export default defineEventHandler(async event => {
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ProjectModel, TProject } from "@schema/ProjectSchema";
|
||||
import { ProjectModel, TProject } from "@schema/project/ProjectSchema";
|
||||
import { TTeamMember, TeamMemberModel } from "@schema/TeamMemberSchema";
|
||||
|
||||
export default defineEventHandler(async event => {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ProjectModel } from "@schema/ProjectSchema";
|
||||
import { ProjectModel } from "@schema/project/ProjectSchema";
|
||||
import { TeamMemberModel } from "@schema/TeamMemberSchema";
|
||||
import { UserModel } from "@schema/UserSchema";
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ProjectLimitModel } from "@schema/ProjectsLimits";
|
||||
import { ProjectLimitModel } from "@schema/project/ProjectsLimits";
|
||||
import StripeService from '~/server/services/StripeService';
|
||||
|
||||
export default defineEventHandler(async event => {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
import { ProjectSnapshotModel, TProjectSnapshot } from "@schema/ProjectSnapshot";
|
||||
import { ProjectSnapshotModel, TProjectSnapshot } from "@schema/project/ProjectSnapshot";
|
||||
|
||||
export default defineEventHandler(async event => {
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { ProjectModel } from "@schema/ProjectSchema";
|
||||
import { ProjectSnapshotModel } from "@schema/ProjectSnapshot";
|
||||
import { ProjectModel } from "@schema/project/ProjectSchema";
|
||||
import { ProjectSnapshotModel } from "@schema/project/ProjectSnapshot";
|
||||
|
||||
|
||||
export default defineEventHandler(async event => {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { ProjectModel } from "@schema/ProjectSchema";
|
||||
import { ProjectSnapshotModel } from "@schema/ProjectSnapshot";
|
||||
import { ProjectModel } from "@schema/project/ProjectSchema";
|
||||
import { ProjectSnapshotModel } from "@schema/project/ProjectSnapshot";
|
||||
|
||||
|
||||
export default defineEventHandler(async event => {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
|
||||
import { ProjectModel } from "@schema/ProjectSchema";
|
||||
import { ProjectCountModel } from "@schema/ProjectsCounts";
|
||||
import { ProjectLimitModel } from "@schema/ProjectsLimits";
|
||||
import { ProjectModel } from "@schema/project/ProjectSchema";
|
||||
import { ProjectCountModel } from "@schema/project/ProjectsCounts";
|
||||
import { ProjectLimitModel } from "@schema/project/ProjectsLimits";
|
||||
import { UserSettingsModel } from "@schema/UserSettings";
|
||||
import { AiChatModel } from "@schema/ai/AiChatSchema";
|
||||
import { LimitNotifyModel } from "@schema/broker/LimitNotifySchema";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ProjectModel } from "@schema/ProjectSchema";
|
||||
import { ProjectModel } from "@schema/project/ProjectSchema";
|
||||
import { AuthContext } from "~/server/middleware/01-authorization";
|
||||
|
||||
export default defineEventHandler(async event => {
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
import OpenAI from "openai";
|
||||
import { AiChatModel } from '@schema/ai/AiChatSchema';
|
||||
import { ProjectCountModel } from '@schema/ProjectsCounts';
|
||||
import { ProjectLimitModel } from '@schema/ProjectsLimits';
|
||||
import { ProjectCountModel } from '@schema/project/ProjectsCounts';
|
||||
import { ProjectLimitModel } from '@schema/project/ProjectsLimits';
|
||||
|
||||
import { AiEventsInstance } from '../ai/functions/AI_Events';
|
||||
import { AiVisitsInstance } from '../ai/functions/AI_Visits';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
|
||||
|
||||
import { AppsumoCodeModel } from '@schema/AppsumoCodeSchema';
|
||||
import { AppsumoCodeTryModel } from '@schema/AppsumoCodeTrySchema';
|
||||
import { AppsumoCodeTryModel } from '@schema/appsumo/AppsumoCodeTrySchema';
|
||||
|
||||
|
||||
export async function canTryAppsumoCode(project_id: string) {
|
||||
|
||||
@@ -2,7 +2,7 @@ import type { AuthContext } from "../middleware/01-authorization";
|
||||
import type { EventHandlerRequest, H3Event } from 'h3'
|
||||
import { allowedModels, TModelName } from "../services/DataService";
|
||||
import { LITLYX_PROJECT_ID } from "@data/LITLYX";
|
||||
import { ProjectModel, TProject } from "@schema/ProjectSchema";
|
||||
import { ProjectModel, TProject } from "@schema/project/ProjectSchema";
|
||||
import { Model, Types } from "mongoose";
|
||||
import { TeamMemberModel } from "@schema/TeamMemberSchema";
|
||||
import { Slice } from "@services/DateService";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ProjectModel, TProject } from "@schema/ProjectSchema";
|
||||
import { ProjectModel, TProject } from "@schema/project/ProjectSchema";
|
||||
import { TeamMemberModel } from "@schema/TeamMemberSchema";
|
||||
|
||||
export async function hasAccessToProject(user_id: string, project_id: string, project?: TProject) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
packages:
|
||||
# - "dashboard"
|
||||
- "dashboard"
|
||||
- "producer"
|
||||
- "consumer"
|
||||
- "security"
|
||||
|
||||
@@ -1,27 +1,23 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"cors": "^2.8.5",
|
||||
"express": "^4.19.2",
|
||||
"ioredis": "^5.4.1",
|
||||
"redis": "^4.6.14",
|
||||
"remove": "^0.1.5"
|
||||
"express": "^4.19.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/cors": "^2.8.17",
|
||||
"@types/express": "^4.17.21",
|
||||
"@types/node": "^20.14.2",
|
||||
"glob": "^10.4.1",
|
||||
"ts-node": "^10.9.2",
|
||||
"typescript": "^5.4.5"
|
||||
},
|
||||
"name": "litlyx-producer",
|
||||
"name": "producer",
|
||||
"version": "1.0.0",
|
||||
"main": "dist/index.js",
|
||||
"scripts": {
|
||||
"dev": "node scripts/start_dev.js",
|
||||
"compile": "tsc",
|
||||
"build": "node ../scripts/build.js",
|
||||
"build_all": "npm run compile && npm run build",
|
||||
"build_project": "node ../scripts/build.js",
|
||||
"build": "npm run compile && npm run build",
|
||||
"docker-build": "docker build -t litlyx-producer -f Dockerfile ../",
|
||||
"docker-inspect": "docker run -it litlyx-producer sh"
|
||||
},
|
||||
|
||||
@@ -1,26 +1,10 @@
|
||||
{
|
||||
"extends": "../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"module": "NodeNext",
|
||||
"target": "ESNext",
|
||||
"esModuleInterop": true,
|
||||
"outDir": "dist",
|
||||
"paths": {
|
||||
"@schema/*": [
|
||||
"../shared/schema/*"
|
||||
],
|
||||
"@services/*": [
|
||||
"../shared/services/*"
|
||||
],
|
||||
"@data/*": [
|
||||
"../shared/data/*"
|
||||
],
|
||||
"@functions/*": [
|
||||
"../shared/functions/*"
|
||||
],
|
||||
"@utils/*": [
|
||||
"../shared/utils/*"
|
||||
]
|
||||
}
|
||||
"outDir": "dist"
|
||||
},
|
||||
"include": [
|
||||
"src/**/*.ts"
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"@getbrevo/brevo": "^2.2.0",
|
||||
"dayjs": "^1.11.13",
|
||||
"mongoose": "^8.3.2"
|
||||
},
|
||||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"@types/node": "^20.12.13",
|
||||
"ts-node": "^10.9.2",
|
||||
@@ -15,11 +11,11 @@
|
||||
"scripts": {
|
||||
"dev": "node scripts/start_dev.js",
|
||||
"compile": "tsc",
|
||||
"build": "node ../scripts/build.js",
|
||||
"build_all": "npm run compile && npm run build"
|
||||
"build_project": "node ../scripts/build.js",
|
||||
"build": "npm run compile && npm run build"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "Emily",
|
||||
"license": "MIT",
|
||||
"description": "."
|
||||
"description": ""
|
||||
}
|
||||
@@ -6,7 +6,7 @@ import { EventModel } from "@schema/metrics/EventSchema";
|
||||
import { VisitModel } from '@schema/metrics/VisitSchema'
|
||||
|
||||
import * as url from 'url';
|
||||
import { ProjectModel } from "@schema/ProjectSchema";
|
||||
import { ProjectModel } from "@schema/project/ProjectSchema";
|
||||
import { getAggregation } from "./Aggregations";
|
||||
|
||||
type TAvgInput = { _id: string, count: number }
|
||||
|
||||
@@ -4,7 +4,7 @@ import { requireEnv } from '@utils/requireEnv'
|
||||
|
||||
import EmailService from "@services/EmailService";
|
||||
|
||||
import { ProjectModel } from "@schema/ProjectSchema";
|
||||
import { ProjectModel } from "@schema/project/ProjectSchema";
|
||||
import { UserModel } from "@schema/UserSchema";
|
||||
|
||||
EmailService.init(requireEnv('BREVO_API_KEY'));
|
||||
|
||||
Reference in New Issue
Block a user