87 | >(({ className, ...props }, ref) => (
88 | [role=checkbox]]:translate-y-[2px]",
92 | className
93 | )}
94 | {...props}
95 | />
96 | ))
97 | TableCell.displayName = "TableCell"
98 |
99 | const TableCaption = React.forwardRef<
100 | HTMLTableCaptionElement,
101 | React.HTMLAttributes
102 | >(({ className, ...props }, ref) => (
103 |
108 | ))
109 | TableCaption.displayName = "TableCaption"
110 |
111 | export {
112 | Table,
113 | TableHeader,
114 | TableBody,
115 | TableFooter,
116 | TableHead,
117 | TableRow,
118 | TableCell,
119 | TableCaption,
120 | }
121 |
--------------------------------------------------------------------------------
/components/ui/textarea.tsx:
--------------------------------------------------------------------------------
1 | import * as React from "react";
2 |
3 | import { cn } from "@/lib/utils";
4 |
5 | export interface TextareaProps
6 | extends React.TextareaHTMLAttributes {}
7 |
8 | const Textarea = React.forwardRef(
9 | ({ className, ...props }, ref) => {
10 | return (
11 |
19 | );
20 | }
21 | );
22 | Textarea.displayName = "Textarea";
23 |
24 | export { Textarea };
25 |
--------------------------------------------------------------------------------
/components/ui/toast.tsx:
--------------------------------------------------------------------------------
1 | "use client"
2 |
3 | import * as React from "react"
4 | import { Cross2Icon } from "@radix-ui/react-icons"
5 | import * as ToastPrimitives from "@radix-ui/react-toast"
6 | import { cva, type VariantProps } from "class-variance-authority"
7 |
8 | import { cn } from "@/lib/utils"
9 |
10 | const ToastProvider = ToastPrimitives.Provider
11 |
12 | const ToastViewport = React.forwardRef<
13 | React.ElementRef,
14 | React.ComponentPropsWithoutRef
15 | >(({ className, ...props }, ref) => (
16 |
24 | ))
25 | ToastViewport.displayName = ToastPrimitives.Viewport.displayName
26 |
27 | const toastVariants = cva(
28 | "group pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md border p-4 pr-6 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",
29 | {
30 | variants: {
31 | variant: {
32 | default: "border bg-background text-foreground",
33 | destructive:
34 | "destructive group border-destructive bg-destructive text-destructive-foreground",
35 | },
36 | },
37 | defaultVariants: {
38 | variant: "default",
39 | },
40 | }
41 | )
42 |
43 | const Toast = React.forwardRef<
44 | React.ElementRef,
45 | React.ComponentPropsWithoutRef &
46 | VariantProps
47 | >(({ className, variant, ...props }, ref) => {
48 | return (
49 |
54 | )
55 | })
56 | Toast.displayName = ToastPrimitives.Root.displayName
57 |
58 | const ToastAction = React.forwardRef<
59 | React.ElementRef,
60 | React.ComponentPropsWithoutRef
61 | >(({ className, ...props }, ref) => (
62 |
70 | ))
71 | ToastAction.displayName = ToastPrimitives.Action.displayName
72 |
73 | const ToastClose = React.forwardRef<
74 | React.ElementRef,
75 | React.ComponentPropsWithoutRef
76 | >(({ className, ...props }, ref) => (
77 |
86 |
87 |
88 | ))
89 | ToastClose.displayName = ToastPrimitives.Close.displayName
90 |
91 | const ToastTitle = React.forwardRef<
92 | React.ElementRef,
93 | React.ComponentPropsWithoutRef
94 | >(({ className, ...props }, ref) => (
95 |
100 | ))
101 | ToastTitle.displayName = ToastPrimitives.Title.displayName
102 |
103 | const ToastDescription = React.forwardRef<
104 | React.ElementRef,
105 | React.ComponentPropsWithoutRef
106 | >(({ className, ...props }, ref) => (
107 |
112 | ))
113 | ToastDescription.displayName = ToastPrimitives.Description.displayName
114 |
115 | type ToastProps = React.ComponentPropsWithoutRef
116 |
117 | type ToastActionElement = React.ReactElement
118 |
119 | export {
120 | type ToastProps,
121 | type ToastActionElement,
122 | ToastProvider,
123 | ToastViewport,
124 | Toast,
125 | ToastTitle,
126 | ToastDescription,
127 | ToastClose,
128 | ToastAction,
129 | }
130 |
--------------------------------------------------------------------------------
/components/ui/toaster.tsx:
--------------------------------------------------------------------------------
1 | "use client"
2 |
3 | import {
4 | Toast,
5 | ToastClose,
6 | ToastDescription,
7 | ToastProvider,
8 | ToastTitle,
9 | ToastViewport,
10 | } from "@/components/ui/toast"
11 | import { useToast } from "@/components/ui/use-toast"
12 |
13 | export function Toaster() {
14 | const { toasts } = useToast()
15 |
16 | return (
17 |
18 | {toasts.map(function ({ id, title, description, action, ...props }) {
19 | return (
20 |
21 |
22 | {title && {title}}
23 | {description && (
24 | {description}
25 | )}
26 |
27 | {action}
28 |
29 |
30 | )
31 | })}
32 |
33 |
34 | )
35 | }
36 |
--------------------------------------------------------------------------------
/components/ui/toggle-group.tsx:
--------------------------------------------------------------------------------
1 | "use client"
2 |
3 | import * as React from "react"
4 | import * as ToggleGroupPrimitive from "@radix-ui/react-toggle-group"
5 | import { VariantProps } from "class-variance-authority"
6 |
7 | import { cn } from "@/lib/utils"
8 | import { toggleVariants } from "@/components/ui/toggle"
9 |
10 | const ToggleGroupContext = React.createContext<
11 | VariantProps
12 | >({
13 | size: "default",
14 | variant: "default",
15 | })
16 |
17 | const ToggleGroup = React.forwardRef<
18 | React.ElementRef,
19 | React.ComponentPropsWithoutRef &
20 | VariantProps
21 | >(({ className, variant, size, children, ...props }, ref) => (
22 |
27 |
28 | {children}
29 |
30 |
31 | ))
32 |
33 | ToggleGroup.displayName = ToggleGroupPrimitive.Root.displayName
34 |
35 | const ToggleGroupItem = React.forwardRef<
36 | React.ElementRef,
37 | React.ComponentPropsWithoutRef &
38 | VariantProps
39 | >(({ className, children, variant, size, ...props }, ref) => {
40 | const context = React.useContext(ToggleGroupContext)
41 |
42 | return (
43 |
54 | {children}
55 |
56 | )
57 | })
58 |
59 | ToggleGroupItem.displayName = ToggleGroupPrimitive.Item.displayName
60 |
61 | export { ToggleGroup, ToggleGroupItem }
62 |
--------------------------------------------------------------------------------
/components/ui/toggle.tsx:
--------------------------------------------------------------------------------
1 | "use client"
2 |
3 | import * as React from "react"
4 | import * as TogglePrimitive from "@radix-ui/react-toggle"
5 | import { cva, type VariantProps } from "class-variance-authority"
6 |
7 | import { cn } from "@/lib/utils"
8 |
9 | const toggleVariants = cva(
10 | "inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground",
11 | {
12 | variants: {
13 | variant: {
14 | default: "bg-transparent",
15 | outline:
16 | "border border-input bg-transparent shadow-sm hover:bg-accent hover:text-accent-foreground",
17 | },
18 | size: {
19 | default: "h-9 px-3",
20 | sm: "h-8 px-2",
21 | lg: "h-10 px-3",
22 | },
23 | },
24 | defaultVariants: {
25 | variant: "default",
26 | size: "default",
27 | },
28 | }
29 | )
30 |
31 | const Toggle = React.forwardRef<
32 | React.ElementRef,
33 | React.ComponentPropsWithoutRef &
34 | VariantProps
35 | >(({ className, variant, size, ...props }, ref) => (
36 |
41 | ))
42 |
43 | Toggle.displayName = TogglePrimitive.Root.displayName
44 |
45 | export { Toggle, toggleVariants }
46 |
--------------------------------------------------------------------------------
/components/ui/tooltip.tsx:
--------------------------------------------------------------------------------
1 | "use client"
2 |
3 | import * as React from "react"
4 | import * as TooltipPrimitive from "@radix-ui/react-tooltip"
5 |
6 | import { cn } from "@/lib/utils"
7 |
8 | const TooltipProvider = TooltipPrimitive.Provider
9 |
10 | const Tooltip = TooltipPrimitive.Root
11 |
12 | const TooltipTrigger = TooltipPrimitive.Trigger
13 |
14 | const TooltipContent = React.forwardRef<
15 | React.ElementRef,
16 | React.ComponentPropsWithoutRef
17 | >(({ className, sideOffset = 4, ...props }, ref) => (
18 |
27 | ))
28 | TooltipContent.displayName = TooltipPrimitive.Content.displayName
29 |
30 | export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider }
31 |
--------------------------------------------------------------------------------
/components/ui/use-toast.ts:
--------------------------------------------------------------------------------
1 | "use client"
2 |
3 | // Inspired by react-hot-toast library
4 | import * as React from "react"
5 |
6 | import type {
7 | ToastActionElement,
8 | ToastProps,
9 | } from "@/components/ui/toast"
10 |
11 | const TOAST_LIMIT = 1
12 | const TOAST_REMOVE_DELAY = 1000000
13 |
14 | type ToasterToast = ToastProps & {
15 | id: string
16 | title?: React.ReactNode
17 | description?: React.ReactNode
18 | action?: ToastActionElement
19 | }
20 |
21 | const actionTypes = {
22 | ADD_TOAST: "ADD_TOAST",
23 | UPDATE_TOAST: "UPDATE_TOAST",
24 | DISMISS_TOAST: "DISMISS_TOAST",
25 | REMOVE_TOAST: "REMOVE_TOAST",
26 | } as const
27 |
28 | let count = 0
29 |
30 | function genId() {
31 | count = (count + 1) % Number.MAX_SAFE_INTEGER
32 | return count.toString()
33 | }
34 |
35 | type ActionType = typeof actionTypes
36 |
37 | type Action =
38 | | {
39 | type: ActionType["ADD_TOAST"]
40 | toast: ToasterToast
41 | }
42 | | {
43 | type: ActionType["UPDATE_TOAST"]
44 | toast: Partial
45 | }
46 | | {
47 | type: ActionType["DISMISS_TOAST"]
48 | toastId?: ToasterToast["id"]
49 | }
50 | | {
51 | type: ActionType["REMOVE_TOAST"]
52 | toastId?: ToasterToast["id"]
53 | }
54 |
55 | interface State {
56 | toasts: ToasterToast[]
57 | }
58 |
59 | const toastTimeouts = new Map>()
60 |
61 | const addToRemoveQueue = (toastId: string) => {
62 | if (toastTimeouts.has(toastId)) {
63 | return
64 | }
65 |
66 | const timeout = setTimeout(() => {
67 | toastTimeouts.delete(toastId)
68 | dispatch({
69 | type: "REMOVE_TOAST",
70 | toastId: toastId,
71 | })
72 | }, TOAST_REMOVE_DELAY)
73 |
74 | toastTimeouts.set(toastId, timeout)
75 | }
76 |
77 | export const reducer = (state: State, action: Action): State => {
78 | switch (action.type) {
79 | case "ADD_TOAST":
80 | return {
81 | ...state,
82 | toasts: [action.toast, ...state.toasts].slice(0, TOAST_LIMIT),
83 | }
84 |
85 | case "UPDATE_TOAST":
86 | return {
87 | ...state,
88 | toasts: state.toasts.map((t) =>
89 | t.id === action.toast.id ? { ...t, ...action.toast } : t
90 | ),
91 | }
92 |
93 | case "DISMISS_TOAST": {
94 | const { toastId } = action
95 |
96 | // ! Side effects ! - This could be extracted into a dismissToast() action,
97 | // but I'll keep it here for simplicity
98 | if (toastId) {
99 | addToRemoveQueue(toastId)
100 | } else {
101 | state.toasts.forEach((toast) => {
102 | addToRemoveQueue(toast.id)
103 | })
104 | }
105 |
106 | return {
107 | ...state,
108 | toasts: state.toasts.map((t) =>
109 | t.id === toastId || toastId === undefined
110 | ? {
111 | ...t,
112 | open: false,
113 | }
114 | : t
115 | ),
116 | }
117 | }
118 | case "REMOVE_TOAST":
119 | if (action.toastId === undefined) {
120 | return {
121 | ...state,
122 | toasts: [],
123 | }
124 | }
125 | return {
126 | ...state,
127 | toasts: state.toasts.filter((t) => t.id !== action.toastId),
128 | }
129 | }
130 | }
131 |
132 | const listeners: Array<(state: State) => void> = []
133 |
134 | let memoryState: State = { toasts: [] }
135 |
136 | function dispatch(action: Action) {
137 | memoryState = reducer(memoryState, action)
138 | listeners.forEach((listener) => {
139 | listener(memoryState)
140 | })
141 | }
142 |
143 | type Toast = Omit
144 |
145 | function toast({ ...props }: Toast) {
146 | const id = genId()
147 |
148 | const update = (props: ToasterToast) =>
149 | dispatch({
150 | type: "UPDATE_TOAST",
151 | toast: { ...props, id },
152 | })
153 | const dismiss = () => dispatch({ type: "DISMISS_TOAST", toastId: id })
154 |
155 | dispatch({
156 | type: "ADD_TOAST",
157 | toast: {
158 | ...props,
159 | id,
160 | open: true,
161 | onOpenChange: (open) => {
162 | if (!open) dismiss()
163 | },
164 | },
165 | })
166 |
167 | return {
168 | id: id,
169 | dismiss,
170 | update,
171 | }
172 | }
173 |
174 | function useToast() {
175 | const [state, setState] = React.useState(memoryState)
176 |
177 | React.useEffect(() => {
178 | listeners.push(setState)
179 | return () => {
180 | const index = listeners.indexOf(setState)
181 | if (index > -1) {
182 | listeners.splice(index, 1)
183 | }
184 | }
185 | }, [state])
186 |
187 | return {
188 | ...state,
189 | toast,
190 | dismiss: (toastId?: string) => dispatch({ type: "DISMISS_TOAST", toastId }),
191 | }
192 | }
193 |
194 | export { useToast, toast }
195 |
--------------------------------------------------------------------------------
/context/add.ts:
--------------------------------------------------------------------------------
1 | import { create } from "zustand";
2 |
3 | type AddState = {
4 | isAdd: boolean;
5 | setIsAdd: (newAdd: boolean) => void;
6 | };
7 |
8 | const useAdd = create((set) => ({
9 | isAdd: false,
10 | setIsAdd: (newAdd) => set({ isAdd: newAdd }),
11 | }));
12 |
13 | export default useAdd;
14 |
--------------------------------------------------------------------------------
/context/color.ts:
--------------------------------------------------------------------------------
1 | import { create } from "zustand";
2 |
3 | type Color = {
4 | color: string;
5 | setColor: (newColor: string) => void;
6 | };
7 |
8 | const useColor = create()((set) => ({
9 | color: "primary",
10 | setColor: (newColor) => set(() => ({ color: newColor })),
11 | }));
12 |
13 | export default useColor;
14 |
--------------------------------------------------------------------------------
/context/date.ts:
--------------------------------------------------------------------------------
1 | import { create } from "zustand";
2 |
3 | type Date = {
4 | dateGet: string;
5 | setDateGet: (newDate: string) => void;
6 | };
7 |
8 | const useDate = create()((set) => ({
9 | dateGet: "Oct 24, 2003",
10 | setDateGet: (newDate) => set(() => ({ dateGet: newDate })),
11 | }));
12 |
13 | export default useDate;
14 |
--------------------------------------------------------------------------------
/context/diaryDetail.ts:
--------------------------------------------------------------------------------
1 | import { create } from "zustand";
2 |
3 | interface Diary {
4 | _id: string;
5 | userId: string;
6 | content: string;
7 | picture: string[];
8 | mood: string;
9 | theme: string;
10 | isPublic: boolean;
11 | date: string;
12 | status: boolean;
13 | reports: any[];
14 | likes: any[];
15 | dislikes: any[];
16 | comments: any[];
17 | }
18 |
19 | interface DiaryState {
20 | diary: Diary;
21 | setDiary: (newDiary: Diary) => void;
22 | resetDiary: () => void;
23 | }
24 |
25 | const initialDiary: Diary = {
26 | _id: "",
27 | userId: "",
28 | content: "",
29 | picture: [],
30 | mood: "",
31 | theme: "",
32 | isPublic: false,
33 | date: "",
34 | status: true,
35 | reports: [],
36 | likes: [],
37 | dislikes: [],
38 | comments: [],
39 | };
40 |
41 | const useDiaryState = create((set) => ({
42 | diary: initialDiary,
43 | setDiary: (setDiary) => set({ diary: setDiary }),
44 | resetDiary: () => set({ diary: initialDiary }),
45 | }));
46 |
47 | export default useDiaryState;
48 |
--------------------------------------------------------------------------------
/context/images.ts:
--------------------------------------------------------------------------------
1 | import { create } from "zustand";
2 |
3 | type Images = {
4 | images: string[];
5 | setImages: (newImages: string[]) => void;
6 | resetImages: () => void;
7 | };
8 |
9 | const useImage = create((set) => ({
10 | images: [],
11 | setImages: (newImages: string[]) =>
12 | set((state) => ({ images: [...state.images, ...newImages] })),
13 | resetImages: () => set(() => ({ images: [] })),
14 | }));
15 |
16 | export default useImage;
17 |
--------------------------------------------------------------------------------
/context/loggedIn.ts:
--------------------------------------------------------------------------------
1 | import { create } from "zustand";
2 |
3 | type LoginData = {
4 | isLoggedIn: boolean;
5 | setIsLoggedIn: (newIsLoggedIn: boolean) => void;
6 | };
7 |
8 | const useLoginData = create()((set) => ({
9 | isLoggedIn: false,
10 | setIsLoggedIn: (newIsLoggedIn) => set({ isLoggedIn: newIsLoggedIn }),
11 | }));
12 |
13 | export default useLoginData;
14 |
--------------------------------------------------------------------------------
/context/mood.ts:
--------------------------------------------------------------------------------
1 | import { create } from "zustand";
2 |
3 | type Mood = {
4 | mood: string;
5 | setMood: (newMood: string) => void;
6 | };
7 |
8 | const useMood = create((set) => ({
9 | mood: "no Mood 🫠",
10 | setMood: (newMood) => set({ mood: newMood }),
11 | }));
12 |
13 | export default useMood;
14 |
--------------------------------------------------------------------------------
/context/myDetails.ts:
--------------------------------------------------------------------------------
1 | import { create } from "zustand";
2 |
3 | interface User {
4 | _id: string;
5 | name: string;
6 | profilePicture: string;
7 | username: string;
8 | password: string;
9 | diaries: string[];
10 | theme: string;
11 | __v: number;
12 | }
13 |
14 | interface UserState {
15 | user: User;
16 | setUser: (userData: User) => void;
17 | updateUser: (updatedFields: Partial) => void;
18 | }
19 |
20 | const useUserStore = create((set) => ({
21 | user: {
22 | _id: "",
23 | name: "",
24 | profilePicture: "",
25 | username: "",
26 | password: "",
27 | diaries: [],
28 | theme: "",
29 | __v: 0,
30 | },
31 | setUser: (userData) => set({ user: userData }),
32 | updateUser: (updatedFields) =>
33 | set((state) => ({
34 | user: { ...state.user, ...updatedFields },
35 | })),
36 | }));
37 |
38 | export default useUserStore;
39 |
--------------------------------------------------------------------------------
/context/page.tsx:
--------------------------------------------------------------------------------
1 | import { Registration } from "@/components/custom/home";
2 | import { Button } from "@/components/ui/button";
3 | import Image from "next/image";
4 |
5 | export default function Home() {
6 | return (
7 |
8 |
9 |
10 |
11 |
15 | Minespace.com
16 |
17 |
18 | |
19 |
20 |
21 | Powered by TechNerd
22 |
23 |
24 |
25 | );
26 | }
27 |
--------------------------------------------------------------------------------
/context/screens.ts:
--------------------------------------------------------------------------------
1 | import { create } from "zustand";
2 |
3 | type Screen = {
4 | screen: string;
5 | setScreen: (newScreen: string) => void;
6 | };
7 |
8 | const useScreen = create((set) => ({
9 | screen: "",
10 | setScreen: (newScreen) => set(() => ({ screen: newScreen })),
11 | }));
12 |
13 | export default useScreen;
14 |
--------------------------------------------------------------------------------
/lib/utils.ts:
--------------------------------------------------------------------------------
1 | import { type ClassValue, clsx } from "clsx"
2 | import { twMerge } from "tailwind-merge"
3 |
4 | export function cn(...inputs: ClassValue[]) {
5 | return twMerge(clsx(inputs))
6 | }
7 |
--------------------------------------------------------------------------------
/middleware/authService.ts:
--------------------------------------------------------------------------------
1 | import Cookies from "js-cookie";
2 | import axios from "axios";
3 |
4 | const TOKEN_COOKIE_NAME = "jwtTokenLoggedIn";
5 |
6 | export const login = async (
7 | username: string,
8 | password: string
9 | ): Promise => {
10 | try {
11 | const response = await axios.post(
12 | `${process.env.NEXT_PUBLIC_MAIN_URL}/login`,
13 | {
14 | username,
15 | password,
16 | }
17 | );
18 | const { token } = response.data;
19 | setAuthToken(token);
20 | return true;
21 | } catch (error) {
22 | console.error("Login failed:", error);
23 | return false;
24 | }
25 | };
26 |
27 | export const register = async (
28 | name: string,
29 | username: string,
30 | password: string
31 | ): Promise => {
32 | try {
33 | const response = await axios.post(
34 | `${process.env.NEXT_PUBLIC_MAIN_URL}/register`,
35 | {
36 | name,
37 | username,
38 | password,
39 | }
40 | );
41 | const { token } = response.data;
42 | setAuthToken(token);
43 | return true;
44 | } catch (error) {
45 | console.error("Register failed:", error);
46 | return false;
47 | }
48 | };
49 |
50 | export const logout = () => {
51 | Cookies.remove(TOKEN_COOKIE_NAME);
52 | };
53 |
54 | export const setAuthToken = (token: string) => {
55 | // Cookies.set(TOKEN_COOKIE_NAME, token, { secure: true, sameSite: "strict" });
56 | Cookies.set(TOKEN_COOKIE_NAME, token, {});
57 | axios.defaults.headers.common["Authorization"] = `Bearer ${token}`;
58 | };
59 |
60 | export const getAuthToken = (): string | undefined => {
61 | return Cookies.get(TOKEN_COOKIE_NAME);
62 | };
63 |
--------------------------------------------------------------------------------
/next.config.mjs:
--------------------------------------------------------------------------------
1 | /** @type {import('next').NextConfig} */
2 | const nextConfig = {
3 | images: {
4 | remotePatterns: [
5 | {
6 | protocol: "https",
7 | hostname: "d22e6o9mp4t2lx.cloudfront.net",
8 | port: "",
9 | pathname: "/cms/**",
10 | },
11 | { protocol: "https", hostname: "images.unsplash.com" },
12 | { protocol: "https", hostname: "res.cloudinary.com" },
13 | {
14 | protocol: "https",
15 | hostname: "i.ibb.co",
16 | port: "",
17 | pathname: "/nCNGk7F/**",
18 | },
19 | {
20 | protocol: "https",
21 | hostname: "i.pinimg.com",
22 | port: "",
23 | pathname: "/736x/2d/5d/30/**",
24 | },
25 | ],
26 | },
27 | };
28 |
29 | export default nextConfig;
30 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "minespace",
3 | "version": "0.1.0",
4 | "private": true,
5 | "scripts": {
6 | "dev": "next dev -p 8000",
7 | "build": "next build",
8 | "start": "next start -p 8000",
9 | "lint": "next lint"
10 | },
11 | "dependencies": {
12 | "@hookform/resolvers": "^3.4.2",
13 | "@radix-ui/react-dialog": "^1.0.5",
14 | "@radix-ui/react-dropdown-menu": "^2.0.6",
15 | "@radix-ui/react-icons": "^1.3.0",
16 | "@radix-ui/react-label": "^2.0.2",
17 | "@radix-ui/react-popover": "^1.0.7",
18 | "@radix-ui/react-select": "^2.0.0",
19 | "@radix-ui/react-slot": "^1.0.2",
20 | "@radix-ui/react-switch": "^1.0.3",
21 | "@radix-ui/react-toast": "^1.1.5",
22 | "@radix-ui/react-toggle": "^1.0.3",
23 | "@radix-ui/react-toggle-group": "^1.0.4",
24 | "@radix-ui/react-tooltip": "^1.0.7",
25 | "axios": "^1.7.2",
26 | "class-variance-authority": "^0.7.0",
27 | "clsx": "^2.1.1",
28 | "cropperjs": "^1.6.2",
29 | "date-fns": "^3.6.0",
30 | "js-cookie": "^3.0.5",
31 | "lucide-react": "^0.379.0",
32 | "next": "14.2.3",
33 | "react": "^18",
34 | "react-day-picker": "^8.10.1",
35 | "react-dom": "^18",
36 | "react-draggable": "^4.4.6",
37 | "react-hook-form": "^7.51.5",
38 | "react-image-crop": "^11.0.5",
39 | "swiper": "^11.1.3",
40 | "tailwind-merge": "^2.3.0",
41 | "tailwindcss-animate": "^1.0.7",
42 | "zod": "^3.23.8",
43 | "zustand": "^4.5.2"
44 | },
45 | "devDependencies": {
46 | "@types/js-cookie": "^3.0.6",
47 | "@types/node": "^20",
48 | "@types/react": "^18",
49 | "@types/react-dom": "^18",
50 | "eslint": "^8",
51 | "eslint-config-next": "14.2.3",
52 | "postcss": "^8",
53 | "tailwindcss": "^3.4.1",
54 | "typescript": "^5"
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/postcss.config.mjs:
--------------------------------------------------------------------------------
1 | /** @type {import('postcss-load-config').Config} */
2 | const config = {
3 | plugins: {
4 | tailwindcss: {},
5 | },
6 | };
7 |
8 | export default config;
9 |
--------------------------------------------------------------------------------
/public/111.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yeabnoah/My_space/df8e690de69ae94c8dda767948f2074b9988828f/public/111.jpg
--------------------------------------------------------------------------------
/public/116-1166655_spiral-binding-png-spiral-binder-coil-png-transparent-removebg-preview-removebg-preview(1).png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yeabnoah/My_space/df8e690de69ae94c8dda767948f2074b9988828f/public/116-1166655_spiral-binding-png-spiral-binder-coil-png-transparent-removebg-preview-removebg-preview(1).png
--------------------------------------------------------------------------------
/public/2222.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yeabnoah/My_space/df8e690de69ae94c8dda767948f2074b9988828f/public/2222.jpg
--------------------------------------------------------------------------------
/public/68937983395.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yeabnoah/My_space/df8e690de69ae94c8dda767948f2074b9988828f/public/68937983395.png
--------------------------------------------------------------------------------
/public/avatar.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yeabnoah/My_space/df8e690de69ae94c8dda767948f2074b9988828f/public/avatar.png
--------------------------------------------------------------------------------
/public/bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yeabnoah/My_space/df8e690de69ae94c8dda767948f2074b9988828f/public/bg.png
--------------------------------------------------------------------------------
/public/bgb.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yeabnoah/My_space/df8e690de69ae94c8dda767948f2074b9988828f/public/bgb.png
--------------------------------------------------------------------------------
/public/book.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yeabnoah/My_space/df8e690de69ae94c8dda767948f2074b9988828f/public/book.png
--------------------------------------------------------------------------------
/public/colored-paper-sculpture-background-spring-memo-notes-illustration-set-diary-notebook-paper-memo_632180-956-removebg-preview.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yeabnoah/My_space/df8e690de69ae94c8dda767948f2074b9988828f/public/colored-paper-sculpture-background-spring-memo-notes-illustration-set-diary-notebook-paper-memo_632180-956-removebg-preview.png
--------------------------------------------------------------------------------
/public/eee-removebg-preview.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yeabnoah/My_space/df8e690de69ae94c8dda767948f2074b9988828f/public/eee-removebg-preview.png
--------------------------------------------------------------------------------
/public/et.avif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yeabnoah/My_space/df8e690de69ae94c8dda767948f2074b9988828f/public/et.avif
--------------------------------------------------------------------------------
/public/ff.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yeabnoah/My_space/df8e690de69ae94c8dda767948f2074b9988828f/public/ff.png
--------------------------------------------------------------------------------
/public/filmbg.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yeabnoah/My_space/df8e690de69ae94c8dda767948f2074b9988828f/public/filmbg.jpg
--------------------------------------------------------------------------------
/public/hhh-removebg-preview.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yeabnoah/My_space/df8e690de69ae94c8dda767948f2074b9988828f/public/hhh-removebg-preview.png
--------------------------------------------------------------------------------
/public/next.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/public/noPost.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yeabnoah/My_space/df8e690de69ae94c8dda767948f2074b9988828f/public/noPost.png
--------------------------------------------------------------------------------
/public/nopost (2).png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yeabnoah/My_space/df8e690de69ae94c8dda767948f2074b9988828f/public/nopost (2).png
--------------------------------------------------------------------------------
/public/ok.avif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yeabnoah/My_space/df8e690de69ae94c8dda767948f2074b9988828f/public/ok.avif
--------------------------------------------------------------------------------
/public/one.avif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yeabnoah/My_space/df8e690de69ae94c8dda767948f2074b9988828f/public/one.avif
--------------------------------------------------------------------------------
/public/scratch.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yeabnoah/My_space/df8e690de69ae94c8dda767948f2074b9988828f/public/scratch.jpg
--------------------------------------------------------------------------------
/public/spinner.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/public/spring.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yeabnoah/My_space/df8e690de69ae94c8dda767948f2074b9988828f/public/spring.png
--------------------------------------------------------------------------------
/public/springer.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yeabnoah/My_space/df8e690de69ae94c8dda767948f2074b9988828f/public/springer.png
--------------------------------------------------------------------------------
/public/thunderstorm-lightning-clip-art-thunder-removebg-preview.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yeabnoah/My_space/df8e690de69ae94c8dda767948f2074b9988828f/public/thunderstorm-lightning-clip-art-thunder-removebg-preview.png
--------------------------------------------------------------------------------
/public/tttj.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yeabnoah/My_space/df8e690de69ae94c8dda767948f2074b9988828f/public/tttj.jpg
--------------------------------------------------------------------------------
/public/user.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yeabnoah/My_space/df8e690de69ae94c8dda767948f2074b9988828f/public/user.jpg
--------------------------------------------------------------------------------
/public/uuu.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yeabnoah/My_space/df8e690de69ae94c8dda767948f2074b9988828f/public/uuu.png
--------------------------------------------------------------------------------
/public/uuuu.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yeabnoah/My_space/df8e690de69ae94c8dda767948f2074b9988828f/public/uuuu.jpg
--------------------------------------------------------------------------------
/public/vercel.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/public/yyy.avif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yeabnoah/My_space/df8e690de69ae94c8dda767948f2074b9988828f/public/yyy.avif
--------------------------------------------------------------------------------
/tailwind.config.ts:
--------------------------------------------------------------------------------
1 | import { Sidebar } from "lucide-react";
2 | import type { Config } from "tailwindcss";
3 |
4 | const config = {
5 | darkMode: ["class"],
6 | content: [
7 | "./pages/**/*.{ts,tsx}",
8 | "./components/**/*.{ts,tsx}",
9 | "./app/**/*.{ts,tsx}",
10 | "./src/**/*.{ts,tsx}",
11 | ],
12 | safelist: [
13 | "primary",
14 | "secondary",
15 | "success",
16 | "pink",
17 | "color1",
18 | "color2",
19 | "color3",
20 | "color4",
21 | "color5",
22 | "color6",
23 | "color7",
24 | "color8",
25 | "color9",
26 | "color10",
27 | "color11",
28 | "color12",
29 | "color13",
30 | "color14",
31 | "color15",
32 | "color16",
33 | "color17",
34 | "color18",
35 | ],
36 | prefix: "",
37 | theme: {
38 | extend: {
39 | fontFamily: {
40 | test: ["CourierPrime"],
41 | },
42 | colors: {
43 | primary: "#AFC8AD",
44 | primary1: "#40A578",
45 | secondary: "#FBF3D5",
46 | success: "#DED0B6",
47 | pink: "#FEC7B4",
48 | testu: "#7864f6",
49 | Sidebar: "#101317",
50 | setting: "#352F44",
51 | test: "#846358",
52 | background: "#222831",
53 | back: "#16191f",
54 | color1: "#686D76",
55 | color2: "#D2649A",
56 | color3: "#FF9F66",
57 | color4: "#FF5580",
58 | color5: "#A67B5B",
59 | color7: "#C7B7A3",
60 | color8: "#E1AFD1",
61 | color9: "#AD88C6",
62 | color10: "#7AB2B2",
63 | color11: "#E1ACAC",
64 | color12: "#CA8787",
65 | color13: "#BACD92",
66 | color14: "#3C5B6F",
67 | color15: "#8576FF",
68 | color17: "#77B0AA",
69 | color18: "#E9A89B",
70 | },
71 | },
72 | },
73 | plugins: [require("tailwindcss-animate")],
74 | } satisfies Config;
75 |
76 | export default config;
77 |
--------------------------------------------------------------------------------
/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "lib": [
4 | "dom",
5 | "dom.iterable",
6 | "esnext"
7 | ],
8 | "allowJs": true,
9 | "skipLibCheck": true,
10 | "strict": true,
11 | "noEmit": true,
12 | "esModuleInterop": true,
13 | "module": "esnext",
14 | "moduleResolution": "bundler",
15 | "resolveJsonModule": true,
16 | "isolatedModules": true,
17 | "jsx": "preserve",
18 | "incremental": true,
19 | "plugins": [
20 | {
21 | "name": "next"
22 | }
23 | ],
24 | "paths": {
25 | "@/*": [
26 | "./*"
27 | ]
28 | },
29 | "forceConsistentCasingInFileNames": true
30 | },
31 | "include": [
32 | "next-env.d.ts",
33 | "**/*.ts",
34 | "**/*.tsx",
35 | ".next/types/**/*.ts"
36 | ],
37 | "exclude": [
38 | "node_modules"
39 | ]
40 | }
41 |
--------------------------------------------------------------------------------
/utils/dummy.ts:
--------------------------------------------------------------------------------
1 | type Diary = {
2 | id: number;
3 | content: string;
4 | image: string[];
5 | mood: string;
6 | theme: string;
7 | };
8 |
9 | type DiaryCollection = Diary[];
10 |
11 | const getDiaries: DiaryCollection = [
12 | {
13 | id: 1,
14 | content:
15 | "Why do we use it? It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using Content here, content here,",
16 | image: [
17 | "https://images.unsplash.com/photo-1626387765635-16d0724b49bf?q=80&w=1931&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D",
18 | "https://images.unsplash.com/photo-1591035897819-f4bdf739f446?q=80&w=2070&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D",
19 | ],
20 | mood: "Happy : 😁",
21 | theme: "primary",
22 | },
23 | {
24 | id: 2,
25 | content:
26 | "Why do we use it? It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using Content here, content here,",
27 | image: [
28 | "https://i.pinimg.com/736x/2d/5d/30/2d5d30e77694c012fa18a194640f44e1.jpg",
29 | ],
30 | mood: "Happy : 😁",
31 | theme: "secondary",
32 | },
33 | {
34 | id: 3,
35 | content:
36 | "Why do we use it? It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using Content here, content here,",
37 | image: [
38 | "https://i.pinimg.com/736x/2d/5d/30/2d5d30e77694c012fa18a194640f44e1.jpg",
39 | ],
40 | mood: "Happy : 😁",
41 | theme: "pink", // Ensure the theme includes success
42 | },
43 | {
44 | id: 4,
45 | content:
46 | "Why do we use it? It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using Content here, content here,",
47 | image: [
48 | "https://i.pinimg.com/736x/2d/5d/30/2d5d30e77694c012fa18a194640f44e1.jpg",
49 | ],
50 | mood: "Happy : 😁",
51 | theme: "success", // Ensure the theme includes success
52 | },
53 | {
54 | id: 5,
55 | content:
56 | "Why do we use it? It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using Content here, content here,",
57 | image: [
58 | "https://i.pinimg.com/736x/2d/5d/30/2d5d30e77694c012fa18a194640f44e1.jpg",
59 | ],
60 | mood: "Happy : 😁",
61 | theme: "success", // Ensure the theme includes success
62 | },
63 | ];
64 |
65 | export default getDiaries;
66 |
--------------------------------------------------------------------------------
|