| @@ -1,50 +0,0 @@ | |||||
| export type IWord = { | |||||
| name: string, | |||||
| pronounciation: { | |||||
| text: string, | |||||
| audio: string, // URL for the audio file | |||||
| }, | |||||
| similarWords: Array<IWord>, | |||||
| gramaticalDetails: Array<{ | |||||
| type: 'NOUN' | 'PRONOUN' | 'ADJECTIVE' | 'VERB' | 'ADVERB' | 'PREPOSITION' | 'CONJUNCTION' | 'INTERJECTION', | |||||
| description: string, | |||||
| examples: Array<string>, | |||||
| }> | |||||
| } | |||||
| export type IShelf = { | |||||
| name: string, | |||||
| description: string, | |||||
| viewType: 'PUBLIC' | 'PRIVATE' | 'FRIENDS' | 'FOLLOWERS', | |||||
| isArchived: boolean, | |||||
| addedWords: Array<{ | |||||
| word: IWord, | |||||
| notes: Array<string>, | |||||
| isFavourite: boolean, | |||||
| nextRevisionDateTime: Date, | |||||
| revisionHistory : Array<{ | |||||
| day: Date, | |||||
| wasRecallSuccessful: boolean, | |||||
| }> | |||||
| }> | |||||
| } | |||||
| export type ICategory = { | |||||
| name: string, | |||||
| icon: string, | |||||
| shelves: Array<IShelf>, | |||||
| isArchived: boolean, | |||||
| } | |||||
| export type IUser = { | |||||
| // For Auth purposes | |||||
| _id: string, | |||||
| name: string, | |||||
| email: string, | |||||
| password: string, | |||||
| isVerified: boolean, | |||||
| otp: number, | |||||
| // Other records | |||||
| categories: Array<ICategory> | |||||
| } | |||||
| @@ -0,0 +1,9 @@ | |||||
| import { Shelf } from "./shelf"; | |||||
| export interface Category { | |||||
| _id: string, | |||||
| name: string, | |||||
| icon: string, | |||||
| shelves: Array<Shelf>, | |||||
| isArchived: boolean, | |||||
| } | |||||
| @@ -0,0 +1,16 @@ | |||||
| import { LanguageType } from "./variables"; | |||||
| import { Word } from "./word"; | |||||
| export interface Library { | |||||
| _id: string, | |||||
| languageType: LanguageType, | |||||
| isArchived: boolean, | |||||
| allWords: Array<{ | |||||
| word: Word, | |||||
| isArchived: boolean, | |||||
| wordStats: { | |||||
| favouriteCount: number, // Total users who liked this word | |||||
| addCount: number, // Total users have added this word to their shelf | |||||
| } | |||||
| }>, | |||||
| } | |||||
| @@ -0,0 +1,20 @@ | |||||
| import { viewPermissionType } from "./variables"; | |||||
| import { Word } from "./word"; | |||||
| export interface Shelf { | |||||
| _id: string, | |||||
| name: string, | |||||
| description: string, | |||||
| viewType: viewPermissionType, | |||||
| isArchived: boolean, | |||||
| addedWords: Array<{ | |||||
| word: Word, | |||||
| notes: Array<string>, | |||||
| isFavourite: boolean, | |||||
| nextRevisionDateTime: Date, | |||||
| revisionHistory : Array<{ | |||||
| day: Date, | |||||
| wasRecallSuccessful: boolean, | |||||
| }> | |||||
| }> | |||||
| } | |||||
| @@ -0,0 +1,11 @@ | |||||
| import { Category } from "./category"; | |||||
| export type IUser = { | |||||
| _id: string, | |||||
| name: string, | |||||
| email: string, | |||||
| password: string, | |||||
| isVerified: boolean, | |||||
| otp: number, | |||||
| categories: Array<Category>, | |||||
| } | |||||
| @@ -0,0 +1,3 @@ | |||||
| export type grammarType = 'NOUN' | 'PRONOUN' | 'ADJECTIVE' | 'VERB' | 'ADVERB' | 'PREPOSITION' | 'CONJUNCTION' | 'INTERJECTION'; | |||||
| export type viewPermissionType = 'PUBLIC' | 'PRIVATE' | 'FRIENDS' | 'FOLLOWERS'; | |||||
| export type LanguageType = 'ENGLISH' | 'KANNADA' | 'HINDI' | 'TAMIL' | 'TELUGU'; | |||||
| @@ -0,0 +1,16 @@ | |||||
| import { grammarType } from "./variables"; | |||||
| export interface Word { | |||||
| _id: string, | |||||
| name: string, | |||||
| pronounciation: { | |||||
| text: string, | |||||
| audio: string, | |||||
| }, | |||||
| similarWords: Array<Word>, | |||||
| grammaticalDetails: Array<{ | |||||
| type: grammarType, | |||||
| description: string, | |||||
| examples: Array<string>, | |||||
| }> | |||||
| } | |||||
| @@ -1,6 +1,6 @@ | |||||
| import express from 'express'; | import express from 'express'; | ||||
| import passport from 'passport'; | import passport from 'passport'; | ||||
| import { IUser } from '../../models/user'; | |||||
| import { IUser } from '../models/user'; | |||||
| export const userProfileRoutes = express.Router(); | export const userProfileRoutes = express.Router(); | ||||