├── .github
└── workflows
│ └── main.yml
├── CHANGELOG.md
├── README.md
├── backend
└── .gitkeep
├── docker-compose.yml
├── nginx
└── nginx.conf
└── ui-mantis
├── .env
├── .eslintrc
├── .gitignore
├── .prettierrc
├── Dockerfile
├── LICENSE
├── README.md
├── favicon.svg
├── index.html
├── jsconfig.json
├── package-lock.json
├── package.json
├── src
├── App.jsx
├── api
│ └── menu.js
├── assets
│ ├── images
│ │ ├── auth
│ │ │ └── AuthBackground.jsx
│ │ ├── icons
│ │ │ ├── facebook.svg
│ │ │ ├── github.svg
│ │ │ ├── google.svg
│ │ │ └── twitter.svg
│ │ └── users
│ │ │ ├── avatar-1.png
│ │ │ ├── avatar-2.png
│ │ │ ├── avatar-3.png
│ │ │ ├── avatar-4.png
│ │ │ ├── avatar-5.png
│ │ │ └── avatar-group.png
│ └── third-party
│ │ └── apex-chart.css
├── components
│ ├── @extended
│ │ ├── AnimateButton.jsx
│ │ ├── Avatar.jsx
│ │ ├── Breadcrumbs.jsx
│ │ ├── Dot.jsx
│ │ └── Transitions.jsx
│ ├── Loadable.jsx
│ ├── Loader.jsx
│ ├── MainCard.jsx
│ ├── ScrollTop.jsx
│ ├── cards
│ │ ├── AuthFooter.jsx
│ │ └── statistics
│ │ │ └── AnalyticEcommerce.jsx
│ ├── logo
│ │ ├── LogoMain.jsx
│ │ └── index.jsx
│ └── third-party
│ │ └── SimpleBar.jsx
├── config.js
├── contexts
│ ├── auth-reducer
│ │ ├── actions.js
│ │ └── auth.js
│ └── authContext.jsx
├── index.jsx
├── layout
│ ├── Dashboard
│ │ ├── Drawer
│ │ │ ├── DrawerContent
│ │ │ │ ├── NavCard.jsx
│ │ │ │ ├── Navigation
│ │ │ │ │ ├── NavGroup.jsx
│ │ │ │ │ ├── NavItem.jsx
│ │ │ │ │ └── index.jsx
│ │ │ │ └── index.jsx
│ │ │ ├── DrawerHeader
│ │ │ │ ├── DrawerHeaderStyled.js
│ │ │ │ └── index.jsx
│ │ │ ├── MiniDrawerStyled.js
│ │ │ └── index.jsx
│ │ ├── Header
│ │ │ ├── AppBarStyled.jsx
│ │ │ ├── HeaderContent
│ │ │ │ ├── MobileSection.jsx
│ │ │ │ ├── Notification.jsx
│ │ │ │ ├── Profile
│ │ │ │ │ ├── ProfileTab.jsx
│ │ │ │ │ ├── SettingTab.jsx
│ │ │ │ │ └── index.jsx
│ │ │ │ ├── Search.jsx
│ │ │ │ └── index.jsx
│ │ │ └── index.jsx
│ │ └── index.jsx
│ └── MinimalLayout
│ │ └── index.jsx
├── menu-items
│ ├── dashboard.jsx
│ ├── index.jsx
│ ├── page.jsx
│ ├── support.jsx
│ ├── users.jsx
│ └── utilities.jsx
├── pages
│ ├── authentication
│ │ ├── AuthCard.jsx
│ │ ├── AuthWrapper.jsx
│ │ ├── auth-forms
│ │ │ ├── AuthLogin.jsx
│ │ │ ├── AuthRegister.jsx
│ │ │ └── FirebaseSocial.jsx
│ │ ├── login.jsx
│ │ └── register.jsx
│ ├── component-overview
│ │ ├── ComponentSkeleton.jsx
│ │ ├── ComponentWrapper.js
│ │ ├── color.jsx
│ │ ├── shadows.jsx
│ │ └── typography.jsx
│ ├── dashboard
│ │ ├── IncomeAreaChart.jsx
│ │ ├── MonthlyBarChart.jsx
│ │ ├── OrdersTable.jsx
│ │ ├── ReportAreaChart.jsx
│ │ ├── SaleReportCard.jsx
│ │ ├── SalesChart.jsx
│ │ ├── UniqueVisitorCard.jsx
│ │ └── index.jsx
│ ├── extra-pages
│ │ └── sample-page.jsx
│ └── users
│ │ ├── Billing.jsx
│ │ ├── Detail.jsx
│ │ ├── EditProfile.jsx
│ │ └── UserManagement.jsx
├── reportWebVitals.js
├── routes
│ ├── LoginRoutes.jsx
│ ├── MainRoutes.jsx
│ └── index.jsx
├── themes
│ ├── index.jsx
│ ├── overrides
│ │ ├── Badge.js
│ │ ├── Button.js
│ │ ├── CardContent.js
│ │ ├── Checkbox.jsx
│ │ ├── Chip.js
│ │ ├── IconButton.js
│ │ ├── InputLabel.js
│ │ ├── LinearProgress.js
│ │ ├── Link.js
│ │ ├── ListItemIcon.jsx
│ │ ├── OutlinedInput.js
│ │ ├── Tab.js
│ │ ├── TableCell.js
│ │ ├── Tabs.js
│ │ ├── Typography.js
│ │ └── index.js
│ ├── palette.js
│ ├── shadows.jsx
│ ├── theme
│ │ └── index.js
│ └── typography.js
├── utils
│ ├── getColors.js
│ ├── getShadow.js
│ ├── password-strength.js
│ └── password-validation.js
└── vite-env.d.js
├── tsconfig.node.json
├── vite.config.mjs
└── yarn.lock
/.github/workflows/main.yml:
--------------------------------------------------------------------------------
1 | name: JS - Main
2 |
3 | on:
4 | push:
5 | branches:
6 | - main
7 |
8 | jobs:
9 | deployment:
10 | runs-on: ubuntu-latest
11 | timeout-minutes: 120
12 | steps:
13 | - name: Execute remote SSH commands
14 | uses: appleboy/ssh-action@master
15 | timeout-minutes: 120
16 | with:
17 | host: ${{ secrets.HOST }}
18 | username: ${{ secrets.USER }}
19 | password: ${{ secrets.PASS }}
20 | port: ${{ secrets.PORT }}
21 | timeout: 120m
22 | command_timeout: 120m
23 | script: |
24 | cd ~/api-server-nestjs
25 | git fetch origin main
26 | if [ $(git rev-parse HEAD) != $(git rev-parse @{u}) ]; then
27 | git pull origin main
28 | export DOCKER_BUILDKIT=1
29 | docker compose up -d --build --no-deps --pull always && docker system prune -af
30 | else
31 | echo "No changes detected, skipping deployment."
32 | fi
33 |
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # Change Log
2 |
3 | ## [0.0.2] 2024-12-15
4 | ### Changes
5 |
6 | - Added Backend
7 | - Added React UI (Mantis Design)
8 |
9 | ## [0.0.1] 2024-11-11
10 | ### Changes
11 |
12 | - REPO Created
13 | - Specs Added (RM)
14 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Django API Server
2 |
3 | Open-Source API server powered by [Django](https://app-generator.dev/docs/technologies/django/index.html), a progressive Node.js framework for building efficient, reliable, and scalable server-side applications.
4 |
5 | > Status: **Work in progress**
6 |
7 | - 👉 [Django API Server](#) - **Complete Documentation**
8 | - 👉 [Get Support](https://app-generator.dev/ticket/create/) via Email and Discord
9 |
10 |
11 |
12 | ## Features
13 |
14 | - **Best Practices**: Follows industry-standard best practices for building robust APIs.
15 | - **Backend**: Built with Django, a powerful and scalable Node.js framework.
16 | - **UI**:
17 | - React Mantis (optional frontend integration).
18 |
19 |
20 |
21 | ## Backend API
22 |
23 | - **Simple, modular & intuitive structure**: Easy to understand and extend.
24 | - **Toolchain**:
25 | - Usable with the latest Node.js LTS versions:
26 | - v22.x
27 | - v21.x
28 | - v20.x
29 | - Package Managers:
30 | - PNPM,
31 | - Yarn,
32 | - Npm
33 | - **Authentication**: Auth0 for GitHub integration.
34 | - GitHub email pulled during OAuth SignIN.
35 | - Optional: Email validation.
36 | - **Roles**: Admin, Users.
37 | - **ORM**: Prisma for database management.
38 | - **User Profiles**:
39 | - ROLE: Default user.
40 | - Fields: Name, surname, bio, country, address, job.
41 | - **API Features**:
42 | - Search, Pagination.
43 | - Public Access: GET by ID, get all.
44 | - Private access (requires token):
45 | - Create, Update, Delete.
46 | - **Admin**:
47 | - Can search or mutate any user.
48 | - **Users**:
49 | - Can view and mutate only their own information.
50 |
51 | ## Start with Docker
52 |
53 | @Todo
54 |
55 | ## Start Django Backend
56 |
57 | > Edit Environment
58 |
59 | Add a `.env` file to your project root directory and populate as follows:
60 |
61 | ```env
62 | AUTH0_DOMAIN=YOUR_AUTH0_DOMAIN
63 | AUTH0_CLIENT_ID=YOUR_AUTH0_CLIENT_ID
64 | AUTH0_CLIENT_SECRET=YOUR_AUTH0_CLIENT_SECRET
65 |
66 | JWT_SECRET=YOUR_JWT_SECRET
67 |
68 | DATABASE_URL=YOUR_DATABASE_URL
69 | ```
70 |
71 | Here's how to get the required Auth0 details. You need to register a client (application) in your Auth0 dashboard.
72 |
73 | Follow these steps to register a client with Auth0:
74 |
75 | 1. Open the [Auth0 Applications](https://manage.auth0.com/?_gl=1*1a4zekg*_ga*Mjg3MzE5NzcyLjE3MzcwMjU4MzA.*_ga_QKMSDV5369*MTczNzIwMTkzNy45LjEuMTczNzIwMTk1Ni40MS4wLjA.#/applications) section of the Auth0 Dashboard.
76 | 2. Click on the **Create Application** button.
77 | 3. Provide a **Name**, such as "GitHub Auth".
78 | 4. Choose `Single Page Web Applications` as the application type.
79 | 5. Click on the **Create** button.
80 | 6. Finally, note down your `Domain`, `Client ID`, and `Client Secret` and add them to your `.env` file. Click the settings tab if you do not see them.
81 |
82 | Choose a random string of letters and numbers for your `JWT_SECRET` and populate the `DATABASE_URL` with your database connection string.
83 |
84 | > Install Dependencies
85 |
86 | Run the following to install dependencies:
87 |
88 | ```bash
89 | npm install
90 | ```
91 |
92 | OR
93 |
94 | ```bash
95 | yarn
96 | ```
97 |
98 | > Set Up Prisma
99 |
100 | 1. Run the following command to generate the Prisma client and apply migrations:
101 |
102 | ```bash
103 | npx prisma generate
104 | npx prisma migrate dev --name init
105 | ```
106 |
107 | 2. If you need to seed your database, you can add a `seed` script in the `prisma/seed.ts` file and run:
108 |
109 | ```bash
110 | npx prisma db seed
111 | ```
112 |
113 | > Run Your Server
114 |
115 | Start the Django server with:
116 |
117 | ```bash
118 | npm run start:dev
119 | ```
120 |
121 | OR
122 |
123 | ```bash
124 | yarn start:dev
125 | ```
126 |
127 | ## Compile [React UI](https://github.com/codedthemes/mantis-free-react-admin-template)
128 |
129 | > Edit Environment
130 |
131 | Add your server base URL to your environment variables as follows:
132 |
133 | ```env
134 | VITE_APP_PUBLIC_URL=
135 | ```
136 |
137 | > Install Dependencies
138 |
139 | ```bash
140 | npm install
141 | ```
142 |
143 | OR
144 |
145 | ```bash
146 | yarn
147 | ```
148 |
149 | > Start the React UI
150 |
151 | ```bash
152 | npm run dev
153 | ```
154 |
155 | OR
156 |
157 | ```bash
158 | yarn dev
159 | ```
160 |
161 | ---
162 | Django API Starter provided by [App Generator](https://app-generator.dev/) - Open-source service for developers and companies.
163 |
--------------------------------------------------------------------------------
/backend/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/app-generator/api-server-django/a6cc878ce93edd5e5cea0d5f4d7c39e22acffc8d/backend/.gitkeep
--------------------------------------------------------------------------------
/docker-compose.yml:
--------------------------------------------------------------------------------
1 | services:
2 | backend:
3 | build: ./backend
4 | container_name: backend
5 | ports:
6 | - "3000:3000"
7 | env_file:
8 | - ./backend/.env
9 | command: >
10 | sh -c "
11 | npx prisma generate
12 | npx prisma migrate deploy
13 | yarn start:dev
14 | "
15 | networks:
16 | - app-network
17 |
18 | frontend:
19 | build: ./ui-mantis
20 | container_name: frontend
21 | ports:
22 | - "4000:4000"
23 | env_file:
24 | - ./ui-mantis/.env
25 | networks:
26 | - app-network
27 | depends_on:
28 | - backend
29 |
30 | # nginx:
31 | # image: nginx:alpine
32 | # container_name: nginx
33 | # ports:
34 | # - "80:80"
35 | # volumes:
36 | # - ./nginx/nginx.conf:/etc/nginx/nginx.conf
37 | # depends_on:
38 | # - backend
39 | # - frontend
40 | # networks:
41 | # - app-network
42 |
43 | networks:
44 | app-network:
45 | driver: bridge
46 |
--------------------------------------------------------------------------------
/nginx/nginx.conf:
--------------------------------------------------------------------------------
1 | events {}
2 |
3 | http {
4 | upstream backend {
5 | server backend:3000;
6 | }
7 |
8 | upstream frontend {
9 | server frontend:4000;
10 | }
11 |
12 | server {
13 | listen 80;
14 |
15 | location /api/ {
16 | proxy_pass http://backend;
17 | proxy_set_header Host $host;
18 | proxy_set_header X-Real-IP $remote_addr;
19 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
20 | proxy_set_header X-Forwarded-Proto $scheme;
21 | }
22 |
23 | location / {
24 | proxy_pass http://frontend;
25 | proxy_set_header Host $host;
26 | proxy_set_header X-Real-IP $remote_addr;
27 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
28 | proxy_set_header X-Forwarded-Proto $scheme;
29 | }
30 | }
31 | }
--------------------------------------------------------------------------------
/ui-mantis/.env:
--------------------------------------------------------------------------------
1 | VITE_APP_VERSION=v1.3.0
2 | GENERATE_SOURCEMAP=false
3 |
4 | ## Backend API URL
5 | VITE_APP_PUBLIC_URL = http://0.0.0.0:4000
6 | VITE_APP_BASE_NAME = /free
7 |
--------------------------------------------------------------------------------
/ui-mantis/.eslintrc:
--------------------------------------------------------------------------------
1 | {
2 | "root": true,
3 | "env": {
4 | "browser": true,
5 | "es2021": true
6 | },
7 | "extends": [
8 | "prettier",
9 | "plugin:react/jsx-runtime",
10 | "plugin:jsx-a11y/recommended",
11 | "plugin:react-hooks/recommended",
12 | "eslint:recommended",
13 | "plugin:react/recommended"
14 | ],
15 | "settings": {
16 | "react": {
17 | "createClass": "createReactClass", // Regex for Component Factory to use,
18 | // default to "createReactClass"
19 | "pragma": "React", // Pragma to use, default to "React"
20 | "fragment": "Fragment", // Fragment to use (may be a property of ), default to "Fragment"
21 | "version": "detect", // React version. "detect" automatically picks the version you have installed.
22 | // You can also use `16.0`, `16.3`, etc, if you want to override the detected value.
23 | // It will default to "latest" and warn if missing, and to "detect" in the future
24 | "flowVersion": "0.53" // Flow version
25 | },
26 | "import/resolver": {
27 | "node": {
28 | "moduleDirectory": ["node_modules", "src/"]
29 | }
30 | }
31 | },
32 | "parser": "@babel/eslint-parser",
33 | "parserOptions": {
34 | "ecmaFeatures": {
35 | "experimentalObjectRestSpread": true,
36 | "impliedStrict": true,
37 | "jsx": true
38 | },
39 | "ecmaVersion": 12
40 | },
41 | "plugins": ["prettier", "react", "react-hooks"],
42 | "rules": {
43 | "react/jsx-uses-react": "error",
44 | "react/jsx-uses-vars": "error",
45 | "react/react-in-jsx-scope": "off",
46 | "no-undef": "off",
47 | "react/display-name": "off",
48 | "react/jsx-filename-extension": "off",
49 | "no-param-reassign": "off",
50 | "react/prop-types": 1,
51 | "react/require-default-props": "off",
52 | "react/no-array-index-key": "off",
53 | "react/jsx-props-no-spreading": "off",
54 | "react/forbid-prop-types": "off",
55 | "import/order": "off",
56 | "import/no-cycle": "off",
57 | "no-console": "off",
58 | "jsx-a11y/anchor-is-valid": "off",
59 | "prefer-destructuring": "off",
60 | "no-shadow": "off",
61 | "import/no-named-as-default": "off",
62 | "import/no-extraneous-dependencies": "off",
63 | "jsx-a11y/no-autofocus": "off",
64 | "no-restricted-imports": [
65 | "error",
66 | {
67 | "patterns": ["@mui/*/*/*", "!@mui/material/test-utils/*"]
68 | }
69 | ],
70 | "no-unused-vars": [
71 | "error",
72 | {
73 | "ignoreRestSiblings": false
74 | }
75 | ],
76 | "prettier/prettier": [
77 | "warn",
78 | {
79 | "bracketSpacing": true,
80 | "printWidth": 140,
81 | "singleQuote": true,
82 | "trailingComma": "none",
83 | "tabWidth": 2,
84 | "useTabs": false,
85 | "endOfLine": "auto"
86 | }
87 | ]
88 | }
89 | }
90 |
--------------------------------------------------------------------------------
/ui-mantis/.gitignore:
--------------------------------------------------------------------------------
1 | # Logs
2 | logs
3 | *.log
4 | npm-debug.log*
5 | yarn-debug.log*
6 | yarn-error.log*
7 | lerna-debug.log*
8 |
9 | # Diagnostic reports (https://nodejs.org/api/report.html)
10 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
11 |
12 | # Runtime data
13 | pids
14 | *.pid
15 | *.seed
16 | *.pid.lock
17 |
18 | # Directory for instrumented libs generated by jscoverage/JSCover
19 | lib-cov
20 |
21 | # Coverage directory used by tools like istanbul
22 | coverage
23 | *.lcov
24 |
25 | # nyc test coverage
26 | .nyc_output
27 |
28 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
29 | .grunt
30 |
31 | # Bower dependency directory (https://bower.io/)
32 | bower_components
33 |
34 | # node-waf configuration
35 | .lock-wscript
36 |
37 | # Compiled binary addons (https://nodejs.org/api/addons.html)
38 | build/Release
39 | build
40 |
41 | # Dependency directories
42 | node_modules/
43 | jspm_packages/
44 |
45 | # TypeScript v1 declaration files
46 | typings/
47 |
48 | # TypeScript cache
49 | *.tsbuildinfo
50 |
51 | # Optional npm cache directory
52 | .npm
53 |
54 | # Optional eslint cache
55 | .eslintcache
56 |
57 | # Microbundle cache
58 | .rpt2_cache/
59 | .rts2_cache_cjs/
60 | .rts2_cache_es/
61 | .rts2_cache_umd/
62 |
63 | # Optional REPL history
64 | .node_repl_history
65 |
66 | # Output of 'npm pack'
67 | *.tgz
68 |
69 | # Yarn Integrity file
70 | .yarn-integrity
71 |
72 | # dotenv environment variables file
73 | # .env
74 | .env.test
75 |
76 | # parcel-bundler cache (https://parceljs.org/)
77 | .cache
78 |
79 | # Next.js build output
80 | .next
81 |
82 | # Nuxt.js build / generate output
83 | .nuxt
84 | dist
85 |
86 | # Gatsby files
87 | .cache/
88 | # Comment in the public line in if your project uses Gatsby and *not* Next.js
89 | # https://nextjs.org/blog/next-9-1#public-directory-support
90 | # public
91 |
92 | # vuepress build output
93 | .vuepress/dist
94 |
95 | # Serverless directories
96 | .serverless/
97 |
98 | # FuseBox cache
99 | .fusebox/
100 |
101 | # DynamoDB Local files
102 | .dynamodb/
103 |
104 | # TernJS port file
105 | .tern-port
106 |
107 | # wincompare file
108 | .bak
--------------------------------------------------------------------------------
/ui-mantis/.prettierrc:
--------------------------------------------------------------------------------
1 | {
2 | "bracketSpacing": true,
3 | "printWidth": 140,
4 | "singleQuote": true,
5 | "trailingComma": "none",
6 | "tabWidth": 2,
7 | "useTabs": false
8 | }
9 |
--------------------------------------------------------------------------------
/ui-mantis/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM node:20-alpine
2 | WORKDIR /app
3 | COPY . .
4 | RUN yarn
5 | RUN yarn build
6 | EXPOSE 4000
7 | CMD [ "yarn", "preview" ]
--------------------------------------------------------------------------------
/ui-mantis/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2022 CodedThemes
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/ui-mantis/README.md:
--------------------------------------------------------------------------------
1 | # Mantis Free React Material UI Dashboard Template [](https://twitter.com/intent/tweet?text=Download%20Mantis%20React%20-%20The%20professional%20Material%20designed%20React%20Admin%20Dashboard%20Template%20&url=https://mantisdashboard.io&via=codedthemes&hashtags=reactjs,webdev,developers,javascript)
2 |
3 | [](https://opensource.org/licenses/MIT)
4 | [](https://github.com/codedthemes/mantis-free-react-admin-template/blob/main/LICENSE)
5 | [](https://github.com/codedthemes/mantis-free-react-admin-template/)
6 |
7 | This code provides a starter template to quickly setup a react (and Mantis) frontend ready for interaction with your NestJS server.
8 |
9 | It comes with prebuilt UI for logging in with major OAuth providers, managing your profile as a user, and managing all user profiles as an admin.
10 |
11 | Mantis is a free and open source React dashboard template made using the Material UI React component library with aim of flexibility and better customizability.
12 |
13 | ## Getting Started
14 |
15 | 1. Clone the repo
16 |
17 | ```
18 | git clone https://github.com/app-generator/api-server-nestjs.git
19 | ```
20 |
21 | 2. Navigate to Mantis UI folder
22 |
23 | ```
24 | cd ui-mantis/mantis-dashboard
25 | ```
26 |
27 | 3. Install packages
28 |
29 | ```
30 | npm install
31 | ```
32 |
33 | or
34 |
35 | ```
36 | yarn
37 | ```
38 |
39 | 4. Update `.env` file
40 |
41 | Enter your server URL in the `PUBLIC_URL` field.
42 |
43 | 5. Start the project
44 |
45 | Run `npm start` and navigate to the appropriate URL (usually localhost:3000).
46 |
--------------------------------------------------------------------------------
/ui-mantis/favicon.svg:
--------------------------------------------------------------------------------
1 |
17 |
--------------------------------------------------------------------------------
/ui-mantis/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 | Mantis React Admin Dashboard
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/ui-mantis/jsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "esnext",
4 | "module": "commonjs",
5 | "baseUrl": "src"
6 | },
7 | "include": ["src/**/*"],
8 | "exclude": ["node_modules"]
9 | }
10 |
--------------------------------------------------------------------------------
/ui-mantis/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "mantis-free-react-admin-template",
3 | "version": "1.3.0",
4 | "private": true,
5 | "homepage": "https://mantisdashboard.io/free",
6 | "author": {
7 | "name": "CodedThemes",
8 | "email": "codedthemes@gmail.com",
9 | "url": "https://codedthemes.com/"
10 | },
11 | "scripts": {
12 | "start": "vite",
13 | "build": "vite build",
14 | "preview": "vite preview",
15 | "lint": "eslint \"src/**/*.{js,jsx,ts,tsx}\"",
16 | "lint:fix": "eslint --fix \"src/**/*.{js,jsx,ts,tsx}\"",
17 | "prettier": "prettier --write \"src/**/*.{js,jsx,ts,tsx}\""
18 | },
19 | "dependencies": {
20 | "@ant-design/colors": "^7.0.2",
21 | "@ant-design/icons": "^5.3.1",
22 | "@emotion/cache": "^11.11.0",
23 | "@emotion/react": "^11.11.4",
24 | "@emotion/styled": "^11.11.0",
25 | "@fontsource/inter": "^5.0.17",
26 | "@fontsource/poppins": "^5.0.12",
27 | "@fontsource/public-sans": "^5.0.17",
28 | "@fontsource/roboto": "^5.0.12",
29 | "@mui/base": "^5.0.0-beta.38",
30 | "@mui/lab": "^5.0.0-alpha.167",
31 | "@mui/material": "^5.15.12",
32 | "@mui/system": "^5.15.12",
33 | "@svgr/webpack": "^8.1.0",
34 | "@vitejs/plugin-react": "^4.2.1",
35 | "apexcharts": "^3.49.0",
36 | "axios": "^1.7.9",
37 | "dotenv": "^16.4.7",
38 | "formik": "^2.4.5",
39 | "framer-motion": "^11.0.8",
40 | "lodash": "^4.17.21",
41 | "process": "^0.11.10",
42 | "prop-types": "^15.8.1",
43 | "react": "^18.2.0",
44 | "react-apexcharts": "^1.4.1",
45 | "react-copy-to-clipboard": "^5.1.0",
46 | "react-device-detect": "^2.2.3",
47 | "react-dom": "^18.2.0",
48 | "react-number-format": "^5.3.3",
49 | "react-router": "^6.22.3",
50 | "react-router-dom": "^6.22.3",
51 | "simplebar-react": "^3.2.4",
52 | "slick-carousel": "^1.8.1",
53 | "swr": "^2.2.5",
54 | "util": "^0.12.5",
55 | "vite": "^5.2.10",
56 | "vite-jsconfig-paths": "^2.0.1",
57 | "web-vitals": "^3.5.2",
58 | "yup": "^1.4.0"
59 | },
60 | "eslintConfig": {
61 | "extends": [
62 | "react-app",
63 | "react-app/jest"
64 | ]
65 | },
66 | "babel": {
67 | "presets": [
68 | "@babel/preset-react"
69 | ]
70 | },
71 | "browserslist": {
72 | "production": [
73 | ">0.2%",
74 | "not dead",
75 | "not op_mini all"
76 | ],
77 | "development": [
78 | "last 1 chrome version",
79 | "last 1 firefox version",
80 | "last 1 safari version"
81 | ]
82 | },
83 | "devDependencies": {
84 | "@babel/core": "^7.24.0",
85 | "@babel/eslint-parser": "^7.23.10",
86 | "@babel/plugin-proposal-private-property-in-object": "^7.21.11",
87 | "eslint": "^8.56.0",
88 | "eslint-config-prettier": "^9.1.0",
89 | "eslint-config-react-app": "^7.0.1",
90 | "eslint-plugin-flowtype": "^8.0.3",
91 | "eslint-plugin-import": "^2.29.1",
92 | "eslint-plugin-jsx-a11y": "^6.8.0",
93 | "eslint-plugin-prettier": "^5.1.3",
94 | "eslint-plugin-react": "^7.34.0",
95 | "eslint-plugin-react-hooks": "^4.6.0",
96 | "prettier": "^3.2.5",
97 | "react-error-overlay": "6.0.11"
98 | }
99 | }
100 |
--------------------------------------------------------------------------------
/ui-mantis/src/App.jsx:
--------------------------------------------------------------------------------
1 | import { RouterProvider } from 'react-router-dom';
2 |
3 | // project import
4 | import router from 'routes';
5 | import ThemeCustomization from 'themes';
6 |
7 | import ScrollTop from 'components/ScrollTop';
8 | import { AuthContextProvider } from 'contexts/authContext.jsx';
9 |
10 | // ==============================|| APP - THEME, ROUTER, LOCAL ||============================== //
11 |
12 | export default function App() {
13 | return (
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 | );
22 | }
23 |
--------------------------------------------------------------------------------
/ui-mantis/src/api/menu.js:
--------------------------------------------------------------------------------
1 | import useSWR, { mutate } from 'swr';
2 | import { useMemo } from 'react';
3 |
4 | const initialState = {
5 | openedItem: 'dashboard',
6 | openedComponent: 'buttons',
7 | openedHorizontalItem: null,
8 | isDashboardDrawerOpened: false,
9 | isComponentDrawerOpened: true
10 | };
11 |
12 | export const endpoints = {
13 | key: 'api/menu',
14 | master: 'master',
15 | dashboard: '/dashboard' // server URL
16 | };
17 |
18 | export function useGetMenuMaster() {
19 | const { data, isLoading } = useSWR(endpoints.key + endpoints.master, () => initialState, {
20 | revalidateIfStale: false,
21 | revalidateOnFocus: false,
22 | revalidateOnReconnect: false
23 | });
24 |
25 | const memoizedValue = useMemo(
26 | () => ({
27 | menuMaster: data,
28 | menuMasterLoading: isLoading
29 | }),
30 | [data, isLoading]
31 | );
32 |
33 | return memoizedValue;
34 | }
35 |
36 | export function handlerDrawerOpen(isDashboardDrawerOpened) {
37 | // to update local state based on key
38 |
39 | mutate(
40 | endpoints.key + endpoints.master,
41 | (currentMenuMaster) => {
42 | return { ...currentMenuMaster, isDashboardDrawerOpened };
43 | },
44 | false
45 | );
46 | }
47 |
48 | export function handlerActiveItem(openedItem) {
49 | // to update local state based on key
50 |
51 | mutate(
52 | endpoints.key + endpoints.master,
53 | (currentMenuMaster) => {
54 | return { ...currentMenuMaster, openedItem };
55 | },
56 | false
57 | );
58 | }
59 |
--------------------------------------------------------------------------------
/ui-mantis/src/assets/images/auth/AuthBackground.jsx:
--------------------------------------------------------------------------------
1 | // material-ui
2 | import { useTheme } from '@mui/material/styles';
3 | import Box from '@mui/material/Box';
4 |
5 | // ==============================|| AUTH BLUR BACK SVG ||============================== //
6 |
7 | export default function AuthBackground() {
8 | const theme = useTheme();
9 | return (
10 |
19 |
35 |
36 | );
37 | }
38 |
--------------------------------------------------------------------------------
/ui-mantis/src/assets/images/icons/facebook.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/ui-mantis/src/assets/images/icons/github.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/ui-mantis/src/assets/images/icons/google.svg:
--------------------------------------------------------------------------------
1 |
7 |
--------------------------------------------------------------------------------
/ui-mantis/src/assets/images/icons/twitter.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/ui-mantis/src/assets/images/users/avatar-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/app-generator/api-server-django/a6cc878ce93edd5e5cea0d5f4d7c39e22acffc8d/ui-mantis/src/assets/images/users/avatar-1.png
--------------------------------------------------------------------------------
/ui-mantis/src/assets/images/users/avatar-2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/app-generator/api-server-django/a6cc878ce93edd5e5cea0d5f4d7c39e22acffc8d/ui-mantis/src/assets/images/users/avatar-2.png
--------------------------------------------------------------------------------
/ui-mantis/src/assets/images/users/avatar-3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/app-generator/api-server-django/a6cc878ce93edd5e5cea0d5f4d7c39e22acffc8d/ui-mantis/src/assets/images/users/avatar-3.png
--------------------------------------------------------------------------------
/ui-mantis/src/assets/images/users/avatar-4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/app-generator/api-server-django/a6cc878ce93edd5e5cea0d5f4d7c39e22acffc8d/ui-mantis/src/assets/images/users/avatar-4.png
--------------------------------------------------------------------------------
/ui-mantis/src/assets/images/users/avatar-5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/app-generator/api-server-django/a6cc878ce93edd5e5cea0d5f4d7c39e22acffc8d/ui-mantis/src/assets/images/users/avatar-5.png
--------------------------------------------------------------------------------
/ui-mantis/src/assets/images/users/avatar-group.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/app-generator/api-server-django/a6cc878ce93edd5e5cea0d5f4d7c39e22acffc8d/ui-mantis/src/assets/images/users/avatar-group.png
--------------------------------------------------------------------------------
/ui-mantis/src/assets/third-party/apex-chart.css:
--------------------------------------------------------------------------------
1 | .apexcharts-legend-series .apexcharts-legend-marker {
2 | left: -4px !important;
3 | top: 2px !important;
4 | }
5 |
--------------------------------------------------------------------------------
/ui-mantis/src/components/@extended/AnimateButton.jsx:
--------------------------------------------------------------------------------
1 | import PropTypes from 'prop-types';
2 |
3 | // third-party
4 | import { motion, useCycle } from 'framer-motion';
5 |
6 | export default function AnimateButton({ children, type = 'scale', direction = 'right', offset = 10, scale = { hover: 1.05, tap: 0.954 } }) {
7 | let offset1;
8 | let offset2;
9 | switch (direction) {
10 | case 'up':
11 | case 'left':
12 | offset1 = offset;
13 | offset2 = 0;
14 | break;
15 | case 'right':
16 | case 'down':
17 | default:
18 | offset1 = 0;
19 | offset2 = offset;
20 | break;
21 | }
22 |
23 | const [x, cycleX] = useCycle(offset1, offset2);
24 | const [y, cycleY] = useCycle(offset1, offset2);
25 |
26 | switch (type) {
27 | case 'rotate':
28 | return (
29 |
38 | {children}
39 |
40 | );
41 | case 'slide':
42 | if (direction === 'up' || direction === 'down') {
43 | return (
44 | cycleY()} onHoverStart={() => cycleY()}>
45 | {children}
46 |
47 | );
48 | }
49 | return (
50 | cycleX()} onHoverStart={() => cycleX()}>
51 | {children}
52 |
53 | );
54 |
55 | case 'scale':
56 | default:
57 | if (typeof scale === 'number') {
58 | scale = {
59 | hover: scale,
60 | tap: scale
61 | };
62 | }
63 | return (
64 |
65 | {children}
66 |
67 | );
68 | }
69 | }
70 |
71 | AnimateButton.propTypes = {
72 | children: PropTypes.node,
73 | type: PropTypes.oneOf(['slide', 'scale', 'rotate']),
74 | direction: PropTypes.oneOf(['up', 'down', 'left', 'right']),
75 | offset: PropTypes.number,
76 | scale: PropTypes.object
77 | };
78 |
--------------------------------------------------------------------------------
/ui-mantis/src/components/@extended/Avatar.jsx:
--------------------------------------------------------------------------------
1 | import PropTypes from 'prop-types';
2 |
3 | // material-ui
4 | import { styled, useTheme } from '@mui/material/styles';
5 | import MuiAvatar from '@mui/material/Avatar';
6 |
7 | // project import
8 | import getColors from 'utils/getColors';
9 |
10 | function getColorStyle({ theme, color, type }) {
11 | const colors = getColors(theme, color);
12 | const { lighter, light, main, contrastText } = colors;
13 |
14 | switch (type) {
15 | case 'filled':
16 | return {
17 | color: contrastText,
18 | background: main
19 | };
20 | case 'outlined':
21 | return {
22 | color: main,
23 | border: '1px solid',
24 | borderColor: main,
25 | background: 'transparent'
26 | };
27 | case 'combined':
28 | return {
29 | color: main,
30 | border: '1px solid',
31 | borderColor: light,
32 | background: lighter
33 | };
34 | default:
35 | return {
36 | color: main,
37 | background: lighter
38 | };
39 | }
40 | }
41 |
42 | // ==============================|| AVATAR - SIZE STYLE ||============================== //
43 |
44 | function getSizeStyle(size) {
45 | switch (size) {
46 | case 'badge':
47 | return {
48 | border: '2px solid',
49 | fontSize: '0.675rem',
50 | width: 20,
51 | height: 20
52 | };
53 | case 'xs':
54 | return {
55 | fontSize: '0.75rem',
56 | width: 24,
57 | height: 24
58 | };
59 | case 'sm':
60 | return {
61 | fontSize: '0.875rem',
62 | width: 32,
63 | height: 32
64 | };
65 | case 'lg':
66 | return {
67 | fontSize: '1.2rem',
68 | width: 52,
69 | height: 52
70 | };
71 | case 'xl':
72 | return {
73 | fontSize: '1.5rem',
74 | width: 64,
75 | height: 64
76 | };
77 | case 'md':
78 | default:
79 | return {
80 | fontSize: '1rem',
81 | width: 40,
82 | height: 40
83 | };
84 | }
85 | }
86 |
87 | const AvatarStyle = styled(MuiAvatar, { shouldForwardProp: (prop) => prop !== 'color' && prop !== 'type' && prop !== 'size' })(
88 | ({ theme, color, type, size }) => ({
89 | ...getSizeStyle(size),
90 | ...getColorStyle({ theme, color, type }),
91 | ...(size === 'badge' && {
92 | borderColor: theme.palette.background.default
93 | })
94 | })
95 | );
96 |
97 | export default function Avatar({ children, color = 'primary', type, size = 'md', ...others }) {
98 | const theme = useTheme();
99 |
100 | return (
101 |
102 | {children}
103 |
104 | );
105 | }
106 |
107 | getColorStyle.propTypes = { theme: PropTypes.any, color: PropTypes.any, type: PropTypes.any };
108 |
109 | Avatar.propTypes = {
110 | children: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
111 | color: PropTypes.string,
112 | type: PropTypes.any,
113 | size: PropTypes.string,
114 | others: PropTypes.any
115 | };
116 |
--------------------------------------------------------------------------------
/ui-mantis/src/components/@extended/Breadcrumbs.jsx:
--------------------------------------------------------------------------------
1 | import PropTypes from 'prop-types';
2 | import { useEffect, useState } from 'react';
3 | import { Link, useLocation } from 'react-router-dom';
4 |
5 | // material-ui
6 | import Grid from '@mui/material/Grid';
7 | import Typography from '@mui/material/Typography';
8 | import MuiBreadcrumbs from '@mui/material/Breadcrumbs';
9 |
10 | // project import
11 | import MainCard from 'components/MainCard';
12 |
13 | export default function Breadcrumbs({ navigation, title, ...others }) {
14 | const location = useLocation();
15 | const [main, setMain] = useState();
16 | const [item, setItem] = useState();
17 |
18 | // set active item state
19 | const getCollapse = (menu) => {
20 | if (menu.children) {
21 | menu.children.filter((collapse) => {
22 | if (collapse.type && collapse.type === 'collapse') {
23 | getCollapse(collapse);
24 | } else if (collapse.type && collapse.type === 'item') {
25 | if (location.pathname === collapse.url) {
26 | setMain(menu);
27 | setItem(collapse);
28 | }
29 | }
30 | return false;
31 | });
32 | }
33 | };
34 |
35 | useEffect(() => {
36 | navigation?.items?.map((menu) => {
37 | if (menu.type && menu.type === 'group') {
38 | getCollapse(menu);
39 | }
40 | return false;
41 | });
42 | });
43 |
44 | // only used for component demo breadcrumbs
45 | if (location.pathname === '/breadcrumbs') {
46 | location.pathname = '/dashboard/analytics';
47 | }
48 |
49 | let mainContent;
50 | let itemContent;
51 | let breadcrumbContent = ;
52 | let itemTitle = '';
53 |
54 | // collapse item
55 | if (main && main.type === 'collapse') {
56 | mainContent = (
57 |
58 | {main.title}
59 |
60 | );
61 | }
62 |
63 | // items
64 | if (item && item.type === 'item') {
65 | itemTitle = item.title;
66 | itemContent = (
67 |
68 | {itemTitle}
69 |
70 | );
71 |
72 | // main
73 | if (item.breadcrumbs !== false) {
74 | breadcrumbContent = (
75 |
76 |
77 |
78 |
79 |
80 | Home
81 |
82 | {mainContent}
83 | {itemContent}
84 |
85 |
86 | {title && (
87 |
88 | {item.title}
89 |
90 | )}
91 |
92 |
93 | );
94 | }
95 | }
96 |
97 | return breadcrumbContent;
98 | }
99 |
100 | Breadcrumbs.propTypes = {
101 | card: PropTypes.bool,
102 | custom: PropTypes.bool,
103 | divider: PropTypes.bool,
104 | heading: PropTypes.string,
105 | icon: PropTypes.bool,
106 | icons: PropTypes.bool,
107 | links: PropTypes.array,
108 | maxItems: PropTypes.number,
109 | rightAlign: PropTypes.bool,
110 | separator: PropTypes.any,
111 | title: PropTypes.bool,
112 | titleBottom: PropTypes.bool,
113 | sx: PropTypes.any,
114 | others: PropTypes.any
115 | };
116 |
--------------------------------------------------------------------------------
/ui-mantis/src/components/@extended/Dot.jsx:
--------------------------------------------------------------------------------
1 | import PropTypes from 'prop-types';
2 | // material-ui
3 | import { useTheme } from '@mui/material/styles';
4 | import Box from '@mui/material/Box';
5 |
6 | // project import
7 | import getColors from 'utils/getColors';
8 |
9 | export default function Dot({ color, size, variant, sx }) {
10 | const theme = useTheme();
11 | const colors = getColors(theme, color || 'primary');
12 | const { main } = colors;
13 |
14 | return (
15 |
25 | );
26 | }
27 |
28 | Dot.propTypes = { color: PropTypes.any, size: PropTypes.number, variant: PropTypes.string, sx: PropTypes.any };
29 |
--------------------------------------------------------------------------------
/ui-mantis/src/components/@extended/Transitions.jsx:
--------------------------------------------------------------------------------
1 | import PropTypes from 'prop-types';
2 | import { forwardRef } from 'react';
3 |
4 | // material-ui
5 | import Collapse from '@mui/material/Collapse';
6 | import Fade from '@mui/material/Fade';
7 | import Grow from '@mui/material/Grow';
8 | import Slide from '@mui/material/Slide';
9 | import Zoom from '@mui/material/Zoom';
10 | import Box from '@mui/material/Box';
11 |
12 | function transitions({ children, position = 'top-left', type = 'grow', direction = 'up', ...others }, ref) {
13 | let positionSX = {
14 | transformOrigin: '0 0 0'
15 | };
16 |
17 | switch (position) {
18 | case 'top-right':
19 | positionSX = {
20 | transformOrigin: 'top right'
21 | };
22 | break;
23 | case 'top':
24 | positionSX = {
25 | transformOrigin: 'top'
26 | };
27 | break;
28 | case 'bottom-left':
29 | positionSX = {
30 | transformOrigin: 'bottom left'
31 | };
32 | break;
33 | case 'bottom-right':
34 | positionSX = {
35 | transformOrigin: 'bottom right'
36 | };
37 | break;
38 | case 'bottom':
39 | positionSX = {
40 | transformOrigin: 'bottom'
41 | };
42 | break;
43 | case 'top-left':
44 | default:
45 | positionSX = {
46 | transformOrigin: '0 0 0'
47 | };
48 | break;
49 | }
50 |
51 | return (
52 |
53 | {type === 'grow' && (
54 |
62 | {children}
63 |
64 | )}
65 |
66 | {type === 'collapse' && (
67 |
68 | {children}
69 |
70 | )}
71 |
72 | {type === 'fade' && (
73 |
81 | {children}
82 |
83 | )}
84 |
85 | {type === 'slide' && (
86 |
95 | {children}
96 |
97 | )}
98 |
99 | {type === 'zoom' && (
100 |
101 | {children}
102 |
103 | )}
104 |
105 | );
106 | }
107 |
108 | export default forwardRef(transitions);
109 |
110 | function popupTransition(props, ref) {
111 | return ;
112 | }
113 | export const PopupTransition = forwardRef(popupTransition);
114 |
115 | transitions.propTypes = {
116 | children: PropTypes.node,
117 | position: PropTypes.string,
118 | type: PropTypes.string,
119 | direction: PropTypes.oneOf(['up', 'right', 'left', 'down']),
120 | others: PropTypes.any
121 | };
122 |
--------------------------------------------------------------------------------
/ui-mantis/src/components/Loadable.jsx:
--------------------------------------------------------------------------------
1 | import { Suspense } from 'react';
2 |
3 | // project import
4 | import Loader from './Loader';
5 |
6 | // ==============================|| LOADABLE - LAZY LOADING ||============================== //
7 |
8 | const Loadable = (Component) => (props) => (
9 | }>
10 |
11 |
12 | );
13 |
14 | export default Loadable;
15 |
--------------------------------------------------------------------------------
/ui-mantis/src/components/Loader.jsx:
--------------------------------------------------------------------------------
1 | // material-ui
2 | import { styled } from '@mui/material/styles';
3 | import LinearProgress from '@mui/material/LinearProgress';
4 |
5 | // loader style
6 | const LoaderWrapper = styled('div')(({ theme }) => ({
7 | position: 'fixed',
8 | top: 0,
9 | left: 0,
10 | zIndex: 2001,
11 | width: '100%',
12 | '& > * + *': {
13 | marginTop: theme.spacing(2)
14 | }
15 | }));
16 |
17 | // ==============================|| Loader ||============================== //
18 |
19 | const Loader = () => (
20 |
21 |
22 |
23 | );
24 |
25 | export default Loader;
26 |
--------------------------------------------------------------------------------
/ui-mantis/src/components/MainCard.jsx:
--------------------------------------------------------------------------------
1 | import PropTypes from 'prop-types';
2 | import { forwardRef } from 'react';
3 |
4 | // material-ui
5 | import { useTheme } from '@mui/material/styles';
6 | import Card from '@mui/material/Card';
7 | import CardContent from '@mui/material/CardContent';
8 | import CardHeader from '@mui/material/CardHeader';
9 | import Divider from '@mui/material/Divider';
10 | import Typography from '@mui/material/Typography';
11 |
12 | // header style
13 | const headerSX = {
14 | p: 2.5,
15 | '& .MuiCardHeader-action': { m: '0px auto', alignSelf: 'center' }
16 | };
17 |
18 | function MainCard(
19 | {
20 | border = true,
21 | boxShadow,
22 | children,
23 | content = true,
24 | contentSX = {},
25 | darkTitle,
26 | elevation,
27 | secondary,
28 | shadow,
29 | sx = {},
30 | title,
31 | ...others
32 | },
33 | ref
34 | ) {
35 | const theme = useTheme();
36 | boxShadow = theme.palette.mode === 'dark' ? boxShadow || true : boxShadow;
37 |
38 | return (
39 |
60 | {/* card header and action */}
61 | {!darkTitle && title && }
62 | {darkTitle && title && {title}} action={secondary} />}
63 |
64 | {/* card content */}
65 | {content && {children}}
66 | {!content && children}
67 |
68 | );
69 | }
70 |
71 | export default forwardRef(MainCard);
72 |
73 | MainCard.propTypes = {
74 | border: PropTypes.bool,
75 | boxShadow: PropTypes.bool,
76 | children: PropTypes.node,
77 | subheader: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
78 | content: PropTypes.bool,
79 | contentSX: PropTypes.object,
80 | darkTitle: PropTypes.bool,
81 | divider: PropTypes.bool,
82 | elevation: PropTypes.number,
83 | secondary: PropTypes.any,
84 | shadow: PropTypes.string,
85 | sx: PropTypes.object,
86 | title: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
87 | modal: PropTypes.bool,
88 | others: PropTypes.any
89 | };
90 |
--------------------------------------------------------------------------------
/ui-mantis/src/components/ScrollTop.jsx:
--------------------------------------------------------------------------------
1 | import PropTypes from 'prop-types';
2 | import { useEffect } from 'react';
3 |
4 | // ==============================|| NAVIGATION - SCROLL TO TOP ||============================== //
5 |
6 | const ScrollTop = ({ children }) => {
7 | useEffect(() => {
8 | window.scrollTo({
9 | top: 0,
10 | left: 0,
11 | behavior: 'smooth'
12 | });
13 | }, []);
14 |
15 | return children || null;
16 | };
17 |
18 | ScrollTop.propTypes = {
19 | children: PropTypes.node
20 | };
21 |
22 | export default ScrollTop;
23 |
--------------------------------------------------------------------------------
/ui-mantis/src/components/cards/AuthFooter.jsx:
--------------------------------------------------------------------------------
1 | // material-ui
2 | import Container from '@mui/material/Container';
3 | import Link from '@mui/material/Link';
4 | import Typography from '@mui/material/Typography';
5 | import Stack from '@mui/material/Stack';
6 |
7 | // ==============================|| FOOTER - AUTHENTICATION ||============================== //
8 |
9 | export default function AuthFooter() {
10 | return (
11 |
12 |
18 |
19 | This site is protected by{' '}
20 |
21 | Privacy Policy
22 |
23 |
24 |
25 |
26 |
34 | Terms and Conditions
35 |
36 |
44 | Privacy Policy
45 |
46 |
54 | CA Privacy Notice
55 |
56 |
57 |
58 |
59 | );
60 | }
61 |
--------------------------------------------------------------------------------
/ui-mantis/src/components/cards/statistics/AnalyticEcommerce.jsx:
--------------------------------------------------------------------------------
1 | import PropTypes from 'prop-types';
2 |
3 | // material-ui
4 | import Chip from '@mui/material/Chip';
5 | import Grid from '@mui/material/Grid';
6 | import Stack from '@mui/material/Stack';
7 | import Typography from '@mui/material/Typography';
8 | import Box from '@mui/material/Box';
9 |
10 | // project import
11 | import MainCard from 'components/MainCard';
12 |
13 | // assets
14 | import RiseOutlined from '@ant-design/icons/RiseOutlined';
15 | import FallOutlined from '@ant-design/icons/FallOutlined';
16 |
17 | const iconSX = { fontSize: '0.75rem', color: 'inherit', marginLeft: 0, marginRight: 0 };
18 |
19 | export default function AnalyticEcommerce({ color = 'primary', title, count, percentage, isLoss, extra }) {
20 | return (
21 |
22 |
23 |
24 | {title}
25 |
26 |
27 |
28 |
29 | {count}
30 |
31 |
32 | {percentage && (
33 |
34 | : }
38 | label={`${percentage}%`}
39 | sx={{ ml: 1.25, pl: 1 }}
40 | size="small"
41 | />
42 |
43 | )}
44 |
45 |
46 |
47 |
48 | You made an extra{' '}
49 |
50 | {extra}
51 | {' '}
52 | this year
53 |
54 |
55 |
56 | );
57 | }
58 |
59 | AnalyticEcommerce.propTypes = {
60 | color: PropTypes.string,
61 | title: PropTypes.string,
62 | count: PropTypes.string,
63 | percentage: PropTypes.number,
64 | isLoss: PropTypes.bool,
65 | extra: PropTypes.string
66 | };
67 |
--------------------------------------------------------------------------------
/ui-mantis/src/components/logo/LogoMain.jsx:
--------------------------------------------------------------------------------
1 | // material-ui
2 | import { useTheme } from '@mui/material/styles';
3 |
4 | /**
5 | * if you want to use image instead of