├── react-ui ├── commit.sh ├── .gitattributes ├── .gitignore ├── .env ├── .env.example ├── public │ ├── favicon.ico │ ├── apple-icon.png │ ├── manifest.json │ └── index.html ├── src │ ├── assets │ │ ├── img │ │ │ ├── BgSignUp.png │ │ │ ├── people-image.png │ │ │ ├── signInImage.png │ │ │ ├── BackgroundCard1.png │ │ │ ├── ImageArchitect1.png │ │ │ ├── ImageArchitect2.png │ │ │ ├── ImageArchitect3.png │ │ │ ├── ProfileBackground.png │ │ │ ├── SidebarHelpImage.png │ │ │ └── avatars │ │ │ │ ├── avatar1.png │ │ │ │ ├── avatar10.png │ │ │ │ ├── avatar2.png │ │ │ │ ├── avatar3.png │ │ │ │ ├── avatar4.png │ │ │ │ ├── avatar5.png │ │ │ │ ├── avatar6.png │ │ │ │ ├── avatar7.png │ │ │ │ ├── avatar8.png │ │ │ │ └── avatar9.png │ │ └── svg │ │ │ ├── settings.svg │ │ │ ├── mastercard-icon.svg │ │ │ ├── person.svg │ │ │ ├── watch.svg │ │ │ ├── search.svg │ │ │ ├── account-circle.svg │ │ │ ├── credit.svg │ │ │ ├── document.svg │ │ │ ├── cart.svg │ │ │ ├── profile.svg │ │ │ ├── person-auth.svg │ │ │ ├── build.svg │ │ │ ├── paypal.svg │ │ │ ├── key.svg │ │ │ ├── notifications.svg │ │ │ ├── wallet.svg │ │ │ ├── help.svg │ │ │ ├── box-3d.svg │ │ │ ├── atlassian-logo.svg │ │ │ ├── stats.svg │ │ │ ├── home.svg │ │ │ ├── cube.svg │ │ │ ├── spotify-logo.svg │ │ │ ├── person-circle-auth.svg │ │ │ ├── globe.svg │ │ │ ├── rocket.svg │ │ │ ├── jira-logo.svg │ │ │ ├── invision-logo.svg │ │ │ ├── visa.svg │ │ │ ├── slack-logo.svg │ │ │ ├── adobexd-logo.svg │ │ │ ├── logo-white.svg │ │ │ ├── logo.svg │ │ │ └── logo-colored.svg │ ├── theme │ │ ├── additions │ │ │ ├── card │ │ │ │ ├── CardBody.js │ │ │ │ ├── CardHeader.js │ │ │ │ └── Card.js │ │ │ └── layout │ │ │ │ ├── PanelContainer.js │ │ │ │ ├── PanelContent.js │ │ │ │ └── MainPanel.js │ │ ├── foundations │ │ │ ├── text.js │ │ │ └── breakpoints.js │ │ ├── components │ │ │ ├── drawer.js │ │ │ ├── link.js │ │ │ ├── badge.js │ │ │ └── button.js │ │ ├── styles.js │ │ └── theme.js │ ├── config │ │ └── constant.js │ ├── components │ │ ├── Card │ │ │ ├── Card.js │ │ │ ├── CardBody.js │ │ │ └── CardHeader.js │ │ ├── Icons │ │ │ └── IconBox.js │ │ ├── Layout │ │ │ ├── MainPanel.js │ │ │ ├── PanelContent.js │ │ │ └── PanelContainer.js │ │ ├── Separator │ │ │ └── Separator.js │ │ ├── RTLProvider │ │ │ └── RTLProvider.js │ │ ├── Charts │ │ │ ├── LineChart.js │ │ │ └── BarChart.js │ │ ├── Menu │ │ │ └── ItemContent.js │ │ ├── Tables │ │ │ ├── InvoicesRow.js │ │ │ ├── TimelineRow.js │ │ │ ├── TransactionRow.js │ │ │ ├── TablesProjectRow.js │ │ │ ├── DashboardTableRow.js │ │ │ ├── TablesTableRow.js │ │ │ └── BillingRow.js │ │ ├── FixedPlugin │ │ │ └── FixedPlugin.js │ │ ├── Navbars │ │ │ └── SearchBar │ │ │ │ └── SearchBar.js │ │ ├── Sidebar │ │ │ ├── index.js │ │ │ └── SidebarHelp.js │ │ └── Footer │ │ │ └── Footer.js │ ├── api │ │ ├── auth.js │ │ └── index.js │ ├── auth-context │ │ └── auth.context.js │ ├── ProtectedRoute.js │ ├── views │ │ └── Dashboard │ │ │ ├── Tables │ │ │ ├── index.js │ │ │ └── components │ │ │ │ ├── Projects.js │ │ │ │ └── Authors.js │ │ │ ├── Dashboard │ │ │ ├── components │ │ │ │ ├── ChartStatistics.js │ │ │ │ ├── SalesOverview.js │ │ │ │ ├── OrdersOverview.js │ │ │ │ ├── MiniStatistics.js │ │ │ │ ├── Projects.js │ │ │ │ ├── ActiveUsers.js │ │ │ │ ├── WorkWithTheRockets.js │ │ │ │ └── BuiltByDevelopers.js │ │ │ └── index.js │ │ │ ├── Billing │ │ │ ├── components │ │ │ │ ├── BillingInformation.js │ │ │ │ ├── Invoices.js │ │ │ │ ├── PaymentStatistics.js │ │ │ │ ├── CreditCard.js │ │ │ │ ├── Transactions.js │ │ │ │ └── PaymentMethod.js │ │ │ └── index.js │ │ │ ├── Profile │ │ │ ├── components │ │ │ │ ├── ProjectCard.js │ │ │ │ ├── PlatformSettings.js │ │ │ │ ├── Projects.js │ │ │ │ └── ProfileInformation.js │ │ │ └── index.js │ │ │ └── RTL │ │ │ └── index.js │ ├── index.js │ ├── routes.js │ ├── layouts │ │ ├── Auth.js │ │ └── RTL.js │ └── variables │ │ └── charts.js ├── jsconfig.json ├── deployer.json ├── .gitpod.yml ├── CHANGELOG.md ├── package.json └── gulpfile.js ├── api-server-django ├── core │ ├── __init__.py │ ├── urls.py │ ├── asgi.py │ ├── wsgi.py │ └── test_runner.py ├── api │ ├── user │ │ ├── migrations │ │ │ ├── __init__.py │ │ │ ├── 0002_user_is_staff.py │ │ │ ├── 0003_alter_user_username.py │ │ │ └── 0001_initial.py │ │ ├── __init__.py │ │ ├── apps.py │ │ ├── serializers.py │ │ ├── tests.py │ │ ├── viewsets.py │ │ └── models.py │ ├── authentication │ │ ├── migrations │ │ │ ├── __init__.py │ │ │ └── 0001_initial.py │ │ ├── models │ │ │ ├── __init__.py │ │ │ └── active_session.py │ │ ├── __init__.py │ │ ├── serializers │ │ │ ├── __init__.py │ │ │ ├── register.py │ │ │ └── login.py │ │ ├── viewsets │ │ │ ├── __init__.py │ │ │ ├── active_session.py │ │ │ ├── login.py │ │ │ ├── logout.py │ │ │ └── register.py │ │ ├── apps.py │ │ ├── backends.py │ │ └── tests.py │ ├── __init__.py │ ├── fixtures │ │ ├── __init__.py │ │ └── user.py │ ├── apps.py │ └── routers.py ├── .dockerignore ├── requirements.txt ├── env.sample ├── build.sh ├── gunicorn-cfg.py ├── nginx │ └── appseed-app.conf ├── Dockerfile ├── docker-compose.yml ├── package.json ├── manage.py ├── CHANGELOG.md ├── LICENSE.md └── .gitignore ├── CHANGELOG.md └── LICENSE.md /react-ui/commit.sh: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /api-server-django/core/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /api-server-django/api/user/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /api-server-django/api/authentication/migrations/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /api-server-django/.dockerignore: -------------------------------------------------------------------------------- 1 | env 2 | .dockerignore 3 | Dockerfile 4 | venv -------------------------------------------------------------------------------- /api-server-django/api/__init__.py: -------------------------------------------------------------------------------- 1 | default_app_config = "api.apps.CoreConfig" 2 | -------------------------------------------------------------------------------- /api-server-django/api/user/__init__.py: -------------------------------------------------------------------------------- 1 | default_app_config = "api.user.apps.UserConfig" 2 | -------------------------------------------------------------------------------- /react-ui/.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /react-ui/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | yarn.lock 3 | package-lock.json 4 | build 5 | .DS_Store 6 | -------------------------------------------------------------------------------- /api-server-django/api/authentication/models/__init__.py: -------------------------------------------------------------------------------- 1 | from .active_session import ActiveSession 2 | -------------------------------------------------------------------------------- /api-server-django/api/fixtures/__init__.py: -------------------------------------------------------------------------------- 1 | def run_fixtures(): 2 | import api.fixtures.user 3 | -------------------------------------------------------------------------------- /react-ui/.env: -------------------------------------------------------------------------------- 1 | GENERATE_SOURCEMAP=false 2 | REACT_APP_BACKEND_SERVER='http://127.0.0.1:5000/api/' 3 | -------------------------------------------------------------------------------- /react-ui/.env.example: -------------------------------------------------------------------------------- 1 | GENERATE_SOURCEMAP=false 2 | REACT_APP_BACKEND_SERVER=http://127.0.0.1:5000/api/ 3 | -------------------------------------------------------------------------------- /api-server-django/api/authentication/__init__.py: -------------------------------------------------------------------------------- 1 | default_app_config = "api.authentication.apps.AuthenticationConfig" 2 | -------------------------------------------------------------------------------- /react-ui/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Incredidev9285/Django-React-Dashboard/HEAD/react-ui/public/favicon.ico -------------------------------------------------------------------------------- /react-ui/public/apple-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Incredidev9285/Django-React-Dashboard/HEAD/react-ui/public/apple-icon.png -------------------------------------------------------------------------------- /api-server-django/api/authentication/serializers/__init__.py: -------------------------------------------------------------------------------- 1 | from .register import RegisterSerializer 2 | from .login import LoginSerializer 3 | -------------------------------------------------------------------------------- /react-ui/src/assets/img/BgSignUp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Incredidev9285/Django-React-Dashboard/HEAD/react-ui/src/assets/img/BgSignUp.png -------------------------------------------------------------------------------- /react-ui/jsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "baseUrl": "src", 4 | "paths": { 5 | "*": ["src/*"] 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /react-ui/src/assets/img/people-image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Incredidev9285/Django-React-Dashboard/HEAD/react-ui/src/assets/img/people-image.png -------------------------------------------------------------------------------- /react-ui/src/assets/img/signInImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Incredidev9285/Django-React-Dashboard/HEAD/react-ui/src/assets/img/signInImage.png -------------------------------------------------------------------------------- /react-ui/src/assets/img/BackgroundCard1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Incredidev9285/Django-React-Dashboard/HEAD/react-ui/src/assets/img/BackgroundCard1.png -------------------------------------------------------------------------------- /react-ui/src/assets/img/ImageArchitect1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Incredidev9285/Django-React-Dashboard/HEAD/react-ui/src/assets/img/ImageArchitect1.png -------------------------------------------------------------------------------- /react-ui/src/assets/img/ImageArchitect2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Incredidev9285/Django-React-Dashboard/HEAD/react-ui/src/assets/img/ImageArchitect2.png -------------------------------------------------------------------------------- /react-ui/src/assets/img/ImageArchitect3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Incredidev9285/Django-React-Dashboard/HEAD/react-ui/src/assets/img/ImageArchitect3.png -------------------------------------------------------------------------------- /react-ui/src/assets/img/ProfileBackground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Incredidev9285/Django-React-Dashboard/HEAD/react-ui/src/assets/img/ProfileBackground.png -------------------------------------------------------------------------------- /react-ui/src/assets/img/SidebarHelpImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Incredidev9285/Django-React-Dashboard/HEAD/react-ui/src/assets/img/SidebarHelpImage.png -------------------------------------------------------------------------------- /react-ui/src/assets/img/avatars/avatar1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Incredidev9285/Django-React-Dashboard/HEAD/react-ui/src/assets/img/avatars/avatar1.png -------------------------------------------------------------------------------- /react-ui/src/assets/img/avatars/avatar10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Incredidev9285/Django-React-Dashboard/HEAD/react-ui/src/assets/img/avatars/avatar10.png -------------------------------------------------------------------------------- /react-ui/src/assets/img/avatars/avatar2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Incredidev9285/Django-React-Dashboard/HEAD/react-ui/src/assets/img/avatars/avatar2.png -------------------------------------------------------------------------------- /react-ui/src/assets/img/avatars/avatar3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Incredidev9285/Django-React-Dashboard/HEAD/react-ui/src/assets/img/avatars/avatar3.png -------------------------------------------------------------------------------- /react-ui/src/assets/img/avatars/avatar4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Incredidev9285/Django-React-Dashboard/HEAD/react-ui/src/assets/img/avatars/avatar4.png -------------------------------------------------------------------------------- /react-ui/src/assets/img/avatars/avatar5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Incredidev9285/Django-React-Dashboard/HEAD/react-ui/src/assets/img/avatars/avatar5.png -------------------------------------------------------------------------------- /react-ui/src/assets/img/avatars/avatar6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Incredidev9285/Django-React-Dashboard/HEAD/react-ui/src/assets/img/avatars/avatar6.png -------------------------------------------------------------------------------- /react-ui/src/assets/img/avatars/avatar7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Incredidev9285/Django-React-Dashboard/HEAD/react-ui/src/assets/img/avatars/avatar7.png -------------------------------------------------------------------------------- /react-ui/src/assets/img/avatars/avatar8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Incredidev9285/Django-React-Dashboard/HEAD/react-ui/src/assets/img/avatars/avatar8.png -------------------------------------------------------------------------------- /react-ui/src/assets/img/avatars/avatar9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Incredidev9285/Django-React-Dashboard/HEAD/react-ui/src/assets/img/avatars/avatar9.png -------------------------------------------------------------------------------- /api-server-django/core/urls.py: -------------------------------------------------------------------------------- 1 | from django.urls import path, include 2 | 3 | urlpatterns = [ 4 | path("api/users/", include(("api.routers", "api"), namespace="api")), 5 | ] 6 | -------------------------------------------------------------------------------- /api-server-django/requirements.txt: -------------------------------------------------------------------------------- 1 | Django==3.2.13 2 | djangorestframework==3.13.1 3 | PyJWT==2.4.0 4 | django-cors-headers==3.13.0 5 | gunicorn==20.1.0 6 | django-environ==0.8.1 7 | -------------------------------------------------------------------------------- /react-ui/src/assets/svg/settings.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /api-server-django/env.sample: -------------------------------------------------------------------------------- 1 | SECRET_KEY=STRONG_KEY_HERE 2 | DEBUG=True 3 | DJANGO_ALLOWED_HOSTS=localhost 127.0.0.1 [::1] 4 | DB_ENGINE=django.db.backends.sqlite3 5 | DATABASE=db.sqlite3 6 | -------------------------------------------------------------------------------- /api-server-django/build.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # exit on error 3 | set -o errexit 4 | 5 | pip install --upgrade pip 6 | pip install -r requirements.txt 7 | 8 | python manage.py migrate 9 | -------------------------------------------------------------------------------- /api-server-django/api/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class CoreConfig(AppConfig): 5 | default_auto_field = "django.db.models.BigAutoField" 6 | name = "api" 7 | label = "api" 8 | -------------------------------------------------------------------------------- /api-server-django/api/fixtures/user.py: -------------------------------------------------------------------------------- 1 | from api.user.models import User 2 | 3 | user_data = {"username": "admin", "password": "12345678", "email": "teast@admin.com"} 4 | 5 | User.objects.create_user(**user_data) 6 | -------------------------------------------------------------------------------- /api-server-django/api/authentication/viewsets/__init__.py: -------------------------------------------------------------------------------- 1 | from .register import RegisterViewSet 2 | from .login import LoginViewSet 3 | from .active_session import ActiveSessionViewSet 4 | from .logout import LogoutViewSet 5 | -------------------------------------------------------------------------------- /api-server-django/api/user/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class UserConfig(AppConfig): 5 | default_auto_field = "django.db.models.BigAutoField" 6 | name = "api.user" 7 | label = "api_user" 8 | -------------------------------------------------------------------------------- /react-ui/src/theme/additions/card/CardBody.js: -------------------------------------------------------------------------------- 1 | const CardBody = { 2 | baseStyle: { 3 | display: "flex", 4 | width: "100%", 5 | }, 6 | }; 7 | 8 | export const CardBodyComponent = { 9 | components: { 10 | CardBody, 11 | }, 12 | }; 13 | -------------------------------------------------------------------------------- /api-server-django/api/authentication/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class AuthenticationConfig(AppConfig): 5 | default_auto_field = "django.db.models.BigAutoField" 6 | name = "api.authentication" 7 | label = "api_authentication" 8 | -------------------------------------------------------------------------------- /react-ui/deployer.json: -------------------------------------------------------------------------------- 1 | { 2 | "api-server":"https://api-server-nodejs.appseed.us/api/", 3 | "name":"react-purity-dashboard", 4 | "framework": "react", 5 | "type": "static", 6 | "build": { 7 | "npm": "v14.0.0" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /react-ui/src/theme/additions/card/CardHeader.js: -------------------------------------------------------------------------------- 1 | const CardHeader = { 2 | baseStyle: { 3 | display: "flex", 4 | width: "100%" 5 | }, 6 | }; 7 | 8 | export const CardHeaderComponent = { 9 | components: { 10 | CardHeader, 11 | }, 12 | }; 13 | -------------------------------------------------------------------------------- /api-server-django/gunicorn-cfg.py: -------------------------------------------------------------------------------- 1 | # -*- encoding: utf-8 -*- 2 | """ 3 | Copyright (c) 2019 - present AppSeed.us 4 | """ 5 | 6 | bind = '0.0.0.0:5005' 7 | workers = 1 8 | accesslog = '-' 9 | loglevel = 'debug' 10 | capture_output = True 11 | enable_stdio_inheritance = True 12 | -------------------------------------------------------------------------------- /react-ui/src/assets/svg/mastercard-icon.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /react-ui/src/config/constant.js: -------------------------------------------------------------------------------- 1 | let BACKEND_SERVER = null; 2 | if (process.env.REACT_APP_BACKEND_SERVER) { 3 | BACKEND_SERVER = process.env.REACT_APP_BACKEND_SERVER; 4 | } else { 5 | BACKEND_SERVER = "http://localhost:5000/"; 6 | } 7 | 8 | export const API_SERVER = BACKEND_SERVER; 9 | -------------------------------------------------------------------------------- /react-ui/src/theme/additions/layout/PanelContainer.js: -------------------------------------------------------------------------------- 1 | const PanelContainer = { 2 | baseStyle: { 3 | p: "30px 15px", 4 | minHeight: "calc(100vh - 123px)", 5 | }, 6 | }; 7 | 8 | export const PanelContainerComponent = { 9 | components: { 10 | PanelContainer, 11 | }, 12 | }; 13 | -------------------------------------------------------------------------------- /react-ui/src/theme/additions/layout/PanelContent.js: -------------------------------------------------------------------------------- 1 | const PanelContent = { 2 | baseStyle: { 3 | ms: "auto", 4 | me: "auto", 5 | ps: "15px", 6 | pe: "15px", 7 | }, 8 | }; 9 | 10 | export const PanelContentComponent = { 11 | components: { 12 | PanelContent, 13 | }, 14 | }; 15 | -------------------------------------------------------------------------------- /api-server-django/api/authentication/models/active_session.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | 3 | 4 | class ActiveSession(models.Model): 5 | user = models.ForeignKey("api_user.User", on_delete=models.CASCADE) 6 | token = models.CharField(max_length=255) 7 | date = models.DateTimeField(auto_now_add=True) 8 | -------------------------------------------------------------------------------- /react-ui/src/theme/foundations/text.js: -------------------------------------------------------------------------------- 1 | export const buttonStyles = { 2 | components: { 3 | Button: { 4 | // 3. We can add a new visual variant 5 | variants: { 6 | "with-shadow": { 7 | boxShadow: "0 0 2px 2px #efdfde", 8 | }, 9 | }, 10 | }, 11 | }, 12 | }; 13 | -------------------------------------------------------------------------------- /react-ui/src/assets/svg/person.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /react-ui/src/theme/foundations/breakpoints.js: -------------------------------------------------------------------------------- 1 | // 1. Import the utilities 2 | import { createBreakpoints } from "@chakra-ui/theme-tools"; 3 | // 2. Update the breakpoints as key-value pairs 4 | export const breakpoints = createBreakpoints({ 5 | sm: "320px", 6 | md: "768px", 7 | lg: "960px", 8 | xl: "1200px", 9 | }); 10 | -------------------------------------------------------------------------------- /react-ui/src/assets/svg/watch.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /react-ui/.gitpod.yml: -------------------------------------------------------------------------------- 1 | # This configuration file was automatically generated by Gitpod. 2 | # Please adjust to your needs (see https://www.gitpod.io/docs/config-gitpod-file) 3 | # and commit this file to your remote git repository to share the goodness with others. 4 | 5 | tasks: 6 | - init: npm install && npm run build 7 | command: npm run start 8 | 9 | 10 | -------------------------------------------------------------------------------- /api-server-django/nginx/appseed-app.conf: -------------------------------------------------------------------------------- 1 | upstream webapp { 2 | server appseed_app:5005; 3 | } 4 | 5 | server { 6 | listen 5000; 7 | server_name localhost; 8 | 9 | location / { 10 | proxy_pass http://webapp; 11 | proxy_set_header Host $host; 12 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /react-ui/src/theme/components/drawer.js: -------------------------------------------------------------------------------- 1 | export const drawerStyles = { 2 | components: { 3 | Drawer: { 4 | // 3. We can add a new visual variant 5 | variants: { 6 | "with-shadow": { 7 | placement: "right", 8 | boxShadow: "0 0 2px 2px #efdfde", 9 | bgColor: "red", 10 | }, 11 | }, 12 | }, 13 | }, 14 | }; 15 | -------------------------------------------------------------------------------- /api-server-django/api/user/serializers.py: -------------------------------------------------------------------------------- 1 | from api.user.models import User 2 | from rest_framework import serializers 3 | 4 | 5 | class UserSerializer(serializers.ModelSerializer): 6 | date = serializers.DateTimeField(read_only=True) 7 | 8 | class Meta: 9 | model = User 10 | fields = ["id", "username", "email", "date"] 11 | read_only_field = ["id"] 12 | -------------------------------------------------------------------------------- /react-ui/src/assets/svg/search.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /react-ui/src/theme/components/link.js: -------------------------------------------------------------------------------- 1 | export const linkStyles = { 2 | components: { 3 | Link: { 4 | // 3. We can add a new visual variant 5 | decoration: "none", 6 | baseStyle: { 7 | _hover: { 8 | textDecoration: "none", 9 | }, 10 | _focus: { 11 | boxShadow: "none", 12 | }, 13 | }, 14 | }, 15 | }, 16 | }; 17 | -------------------------------------------------------------------------------- /react-ui/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "React App", 3 | "name": "Create React App Sample", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | } 10 | ], 11 | "start_url": "./index.html", 12 | "display": "standalone", 13 | "theme_color": "#000000", 14 | "background_color": "#ffffff" 15 | } 16 | -------------------------------------------------------------------------------- /react-ui/src/assets/svg/account-circle.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /react-ui/src/components/Card/Card.js: -------------------------------------------------------------------------------- 1 | import { Box, useStyleConfig } from "@chakra-ui/react"; 2 | function Card(props) { 3 | const { variant, children, ...rest } = props; 4 | const styles = useStyleConfig("Card", { variant }); 5 | // Pass the computed styles into the `__css` prop 6 | return ( 7 | 8 | {children} 9 | 10 | ); 11 | } 12 | 13 | export default Card; 14 | -------------------------------------------------------------------------------- /react-ui/src/components/Icons/IconBox.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { Flex } from "@chakra-ui/react"; 3 | 4 | export default function IconBox(props) { 5 | const { children, ...rest } = props; 6 | 7 | return ( 8 | 14 | {children} 15 | 16 | ); 17 | } 18 | -------------------------------------------------------------------------------- /react-ui/src/components/Card/CardBody.js: -------------------------------------------------------------------------------- 1 | import { Box, useStyleConfig } from "@chakra-ui/react"; 2 | function CardBody(props) { 3 | const { variant, children, ...rest } = props; 4 | const styles = useStyleConfig("CardBody", { variant }); 5 | // Pass the computed styles into the `__css` prop 6 | return ( 7 | 8 | {children} 9 | 10 | ); 11 | } 12 | 13 | export default CardBody; 14 | -------------------------------------------------------------------------------- /react-ui/src/theme/styles.js: -------------------------------------------------------------------------------- 1 | import { mode } from '@chakra-ui/theme-tools'; 2 | 3 | export const globalStyles = { 4 | colors: { 5 | gray: { 6 | 700: '#1f2733' 7 | } 8 | }, 9 | styles: { 10 | global: (props) => ({ 11 | body: { 12 | bg: mode('gray.50', 'gray.800')(props), 13 | fontFamily: "'Roboto', sans-serif" 14 | }, 15 | html: { 16 | fontFamily: "'Roboto', sans-serif" 17 | } 18 | }) 19 | } 20 | }; 21 | -------------------------------------------------------------------------------- /react-ui/src/components/Card/CardHeader.js: -------------------------------------------------------------------------------- 1 | import { Box, useStyleConfig } from "@chakra-ui/react"; 2 | function CardHeader(props) { 3 | const { variant, children, ...rest } = props; 4 | const styles = useStyleConfig("CardHeader", { variant }); 5 | // Pass the computed styles into the `__css` prop 6 | return ( 7 | 8 | {children} 9 | 10 | ); 11 | } 12 | 13 | export default CardHeader; 14 | -------------------------------------------------------------------------------- /react-ui/src/components/Layout/MainPanel.js: -------------------------------------------------------------------------------- 1 | import { Box, useStyleConfig } from "@chakra-ui/react"; 2 | function MainPanel(props) { 3 | const { variant, children, ...rest } = props; 4 | const styles = useStyleConfig("MainPanel", { variant }); 5 | // Pass the computed styles into the `__css` prop 6 | return ( 7 | 8 | {children} 9 | 10 | ); 11 | } 12 | 13 | export default MainPanel; 14 | -------------------------------------------------------------------------------- /react-ui/src/assets/svg/credit.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /react-ui/src/components/Layout/PanelContent.js: -------------------------------------------------------------------------------- 1 | import { Box, useStyleConfig } from "@chakra-ui/react"; 2 | function PanelContent(props) { 3 | const { variant, children, ...rest } = props; 4 | const styles = useStyleConfig("PanelContent", { variant }); 5 | // Pass the computed styles into the `__css` prop 6 | return ( 7 | 8 | {children} 9 | 10 | ); 11 | } 12 | 13 | export default PanelContent; 14 | -------------------------------------------------------------------------------- /react-ui/src/components/Layout/PanelContainer.js: -------------------------------------------------------------------------------- 1 | import { Box, useStyleConfig } from "@chakra-ui/react"; 2 | function PanelContainer(props) { 3 | const { variant, children, ...rest } = props; 4 | const styles = useStyleConfig("PanelContainer", { variant }); 5 | // Pass the computed styles into the `__css` prop 6 | return ( 7 | 8 | {children} 9 | 10 | ); 11 | } 12 | 13 | export default PanelContainer; 14 | -------------------------------------------------------------------------------- /react-ui/src/theme/components/badge.js: -------------------------------------------------------------------------------- 1 | import { baseStyle } from "@chakra-ui/react"; 2 | 3 | export const badgeStyles = { 4 | components: { 5 | Badge: { 6 | sizes: { 7 | md: { 8 | width: "65px", 9 | height: "25px" 10 | } 11 | }, 12 | baseStyle: { 13 | textTransform: "capitalize" 14 | } 15 | 16 | } 17 | } 18 | } -------------------------------------------------------------------------------- /react-ui/src/components/Separator/Separator.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { Flex } from "@chakra-ui/react"; 3 | 4 | export function Separator(props) { 5 | const { variant, children, ...rest } = props; 6 | return ( 7 | 13 | {children} 14 | 15 | ); 16 | } 17 | -------------------------------------------------------------------------------- /api-server-django/core/asgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | ASGI config for core project. 3 | 4 | It exposes the ASGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/3.2/howto/deployment/asgi/ 8 | """ 9 | 10 | import os 11 | 12 | from django.core.asgi import get_asgi_application 13 | 14 | os.environ.setdefault("DJANGO_SETTINGS_MODULE", "core.settings") 15 | 16 | application = get_asgi_application() 17 | -------------------------------------------------------------------------------- /api-server-django/core/wsgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | WSGI config for core project. 3 | 4 | It exposes the WSGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/3.2/howto/deployment/wsgi/ 8 | """ 9 | 10 | import os 11 | 12 | from django.core.wsgi import get_wsgi_application 13 | 14 | os.environ.setdefault("DJANGO_SETTINGS_MODULE", "core.settings") 15 | 16 | application = get_wsgi_application() 17 | -------------------------------------------------------------------------------- /react-ui/src/assets/svg/document.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /react-ui/src/api/auth.js: -------------------------------------------------------------------------------- 1 | import axios from "./index"; 2 | 3 | class AuthApi { 4 | static Login = (data) => { 5 | return axios.post(`${base}/login`, data); 6 | }; 7 | 8 | static Register = (data) => { 9 | return axios.post(`${base}/register`, data); 10 | }; 11 | 12 | static Logout = (data) => { 13 | return axios.post(`${base}/logout`, data, { headers: { Authorization: `${data.token}` } }); 14 | }; 15 | } 16 | 17 | let base = "users"; 18 | 19 | export default AuthApi; 20 | -------------------------------------------------------------------------------- /api-server-django/api/user/migrations/0002_user_is_staff.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 4.0.1 on 2022-05-27 12:34 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('api_user', '0001_initial'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AddField( 14 | model_name='user', 15 | name='is_staff', 16 | field=models.BooleanField(default=False), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /api-server-django/api/authentication/viewsets/active_session.py: -------------------------------------------------------------------------------- 1 | from rest_framework import viewsets, mixins, status 2 | from rest_framework.permissions import IsAuthenticated 3 | from rest_framework.response import Response 4 | 5 | 6 | class ActiveSessionViewSet(viewsets.GenericViewSet, mixins.CreateModelMixin): 7 | http_method_names = ["post"] 8 | permission_classes = (IsAuthenticated,) 9 | 10 | def create(self, request, *args, **kwargs): 11 | return Response({"success": True}, status.HTTP_200_OK) 12 | -------------------------------------------------------------------------------- /react-ui/src/assets/svg/cart.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /api-server-django/api/user/migrations/0003_alter_user_username.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.2.13 on 2022-06-07 22:44 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('api_user', '0002_user_is_staff'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AlterField( 14 | model_name='user', 15 | name='username', 16 | field=models.CharField(db_index=True, max_length=255, unique=True), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /react-ui/src/assets/svg/profile.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /api-server-django/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM python:3.9 2 | 3 | # set environment variables 4 | ENV PYTHONDONTWRITEBYTECODE 1 5 | ENV PYTHONUNBUFFERED 1 6 | 7 | COPY requirements.txt . 8 | 9 | # install python dependencies 10 | RUN pip install --upgrade pip 11 | RUN pip install --no-cache-dir -r requirements.txt 12 | 13 | COPY env.sample .env 14 | 15 | COPY . . 16 | 17 | # running migrations 18 | RUN python manage.py makemigrations 19 | RUN python manage.py migrate 20 | 21 | # gunicorn 22 | CMD ["gunicorn", "--config", "gunicorn-cfg.py", "core.wsgi"] 23 | 24 | -------------------------------------------------------------------------------- /react-ui/src/assets/svg/person-auth.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /react-ui/src/components/RTLProvider/RTLProvider.js: -------------------------------------------------------------------------------- 1 | import { CacheProvider } from "@emotion/react"; 2 | import createCache from "@emotion/cache"; 3 | import rtl from "stylis-plugin-rtl"; 4 | // NB: A unique `key` is important for it to work! 5 | const options = { 6 | rtl: { key: "css-ar", stylisPlugins: [rtl] }, 7 | ltr: { key: "css-en" }, 8 | }; 9 | export function RtlProvider({ children }) { 10 | const dir = document.documentElement.dir == "ar" ? "rtl" : "ltr"; 11 | const cache = createCache(options[dir]); 12 | return ; 13 | } 14 | -------------------------------------------------------------------------------- /react-ui/src/assets/svg/build.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /react-ui/src/api/index.js: -------------------------------------------------------------------------------- 1 | import Axios from "axios"; 2 | import { API_SERVER } from "../config/constant"; 3 | 4 | const axios = Axios.create({ 5 | baseURL: `${API_SERVER}`, 6 | headers: { "Content-Type": "application/json" }, 7 | }); 8 | 9 | axios.interceptors.request.use( 10 | (config) => { 11 | return Promise.resolve(config); 12 | }, 13 | (error) => Promise.reject(error) 14 | ); 15 | 16 | axios.interceptors.response.use( 17 | (response) => Promise.resolve(response), 18 | (error) => { 19 | return Promise.reject(error); 20 | } 21 | ); 22 | 23 | export default axios; 24 | -------------------------------------------------------------------------------- /api-server-django/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3.8' 2 | services: 3 | appseed-app: 4 | container_name: appseed_app 5 | restart: always 6 | build: . 7 | networks: 8 | - db_network 9 | - web_network 10 | nginx: 11 | container_name: nginx 12 | restart: always 13 | image: "nginx:latest" 14 | ports: 15 | - "5000:5000" 16 | volumes: 17 | - ./nginx:/etc/nginx/conf.d 18 | networks: 19 | - web_network 20 | depends_on: 21 | - appseed-app 22 | networks: 23 | db_network: 24 | driver: bridge 25 | web_network: 26 | driver: bridge 27 | -------------------------------------------------------------------------------- /react-ui/src/assets/svg/paypal.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /react-ui/src/auth-context/auth.context.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import PropTypes from "prop-types"; 3 | 4 | const AuthContext = React.createContext(null); 5 | 6 | export const AuthProvider = ({ userData, children }) => { 7 | let [user, setUser] = React.useState(userData); 8 | user = typeof user === "string" ? JSON.parse(user) : user; 9 | 10 | return {children}; 11 | }; 12 | 13 | AuthProvider.propTypes = { 14 | userData: PropTypes.any, 15 | children: PropTypes.any, 16 | }; 17 | 18 | export const useAuth = () => React.useContext(AuthContext); 19 | -------------------------------------------------------------------------------- /react-ui/src/assets/svg/key.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /react-ui/src/assets/svg/notifications.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 3 | ## [1.0.1] 2023-02-13 4 | ### Changes 5 | 6 | - Regenerate Codebase: `Django` & `React` 7 | - [React Generator - Purity Design](https://appseed.us/generator/react/purity-dashboard/) - `free tool` 8 | - Update DOCS (readme) 9 | - [React Django Purity - How to Generate](https://www.youtube.com/watch?v=VLWwuzvia9w) - `video presentation` 10 | 11 | ## [1.0.0] 2021-11-17 12 | ### Initial Release 13 | 14 | - UI: [React Purity Dashboard](https://github.com/app-generator/react-purity-dashboard) **v1.0.3** 15 | - Backend Version: [Django API Server](https://github.com/app-generator/api-server-django) **v1.0.0** 16 | 17 | -------------------------------------------------------------------------------- /api-server-django/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "api-server-django", 3 | "version": "1.0.1", 4 | "description": "Open-source API Server", 5 | "scripts": {}, 6 | "repository": { 7 | "type": "git", 8 | "url": "https://github.com/app-generator/api-server-django" 9 | }, 10 | "bugs": { 11 | "url": "https://github.com/app-generator/api-server-django/issues", 12 | "email": "support@appseed.us" 13 | }, 14 | "author": "AppSeed App Generator (https://appseed.us)", 15 | "engines": { 16 | "node": ">=10.0.0" 17 | }, 18 | "dependencies": {}, 19 | "devDependencies": {} 20 | } -------------------------------------------------------------------------------- /react-ui/src/assets/svg/wallet.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /react-ui/src/assets/svg/help.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /react-ui/src/assets/svg/box-3d.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /react-ui/src/assets/svg/atlassian-logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /react-ui/src/theme/additions/card/Card.js: -------------------------------------------------------------------------------- 1 | const Card = { 2 | baseStyle: { 3 | p: "22px", 4 | display: "flex", 5 | flexDirection: "column", 6 | width: "100%", 7 | position: "relative", 8 | minWidth: "0px", 9 | wordWrap: "break-word", 10 | backgroundClip: "border-box", 11 | }, 12 | variants: { 13 | panel: (props) => ({ 14 | bg: props.colorMode === "dark" ? "gray.700" : "white", 15 | width: "100%", 16 | boxShadow: "0px 3.5px 5.5px rgba(0, 0, 0, 0.02)", 17 | borderRadius: "15px", 18 | }), 19 | }, 20 | defaultProps: { 21 | variant: "panel", 22 | }, 23 | }; 24 | 25 | export const CardComponent = { 26 | components: { 27 | Card, 28 | }, 29 | }; 30 | -------------------------------------------------------------------------------- /api-server-django/api/authentication/viewsets/login.py: -------------------------------------------------------------------------------- 1 | from rest_framework import viewsets, mixins 2 | from rest_framework.response import Response 3 | from rest_framework import status 4 | from rest_framework.permissions import AllowAny 5 | 6 | from api.authentication.serializers import LoginSerializer 7 | 8 | 9 | class LoginViewSet(viewsets.GenericViewSet, mixins.CreateModelMixin): 10 | permission_classes = (AllowAny,) 11 | serializer_class = LoginSerializer 12 | 13 | def create(self, request, *args, **kwargs): 14 | serializer = self.get_serializer(data=request.data) 15 | 16 | serializer.is_valid(raise_exception=True) 17 | 18 | return Response(serializer.validated_data, status=status.HTTP_200_OK) 19 | -------------------------------------------------------------------------------- /react-ui/src/assets/svg/stats.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /api-server-django/api/authentication/viewsets/logout.py: -------------------------------------------------------------------------------- 1 | from rest_framework import viewsets, mixins 2 | from rest_framework.response import Response 3 | from rest_framework import status 4 | from rest_framework.permissions import IsAuthenticated 5 | 6 | from api.authentication.models import ActiveSession 7 | 8 | 9 | class LogoutViewSet(viewsets.GenericViewSet, mixins.CreateModelMixin): 10 | permission_classes = (IsAuthenticated,) 11 | 12 | def create(self, request, *args, **kwargs): 13 | user = request.user 14 | 15 | session = ActiveSession.objects.get(user=user) 16 | session.delete() 17 | 18 | return Response( 19 | {"success": True, "msg": "Token revoked"}, status=status.HTTP_200_OK 20 | ) 21 | -------------------------------------------------------------------------------- /api-server-django/api/routers.py: -------------------------------------------------------------------------------- 1 | from api.authentication.viewsets import ( 2 | RegisterViewSet, 3 | LoginViewSet, 4 | ActiveSessionViewSet, 5 | LogoutViewSet, 6 | ) 7 | from rest_framework import routers 8 | from api.user.viewsets import UserViewSet 9 | 10 | router = routers.SimpleRouter(trailing_slash=False) 11 | 12 | router.register(r"edit", UserViewSet, basename="user-edit") 13 | 14 | router.register(r"register", RegisterViewSet, basename="register") 15 | 16 | router.register(r"login", LoginViewSet, basename="login") 17 | 18 | router.register(r"checkSession", ActiveSessionViewSet, basename="check-session") 19 | 20 | router.register(r"logout", LogoutViewSet, basename="logout") 21 | 22 | urlpatterns = [ 23 | *router.urls, 24 | ] 25 | -------------------------------------------------------------------------------- /react-ui/src/assets/svg/home.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /api-server-django/manage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | """Django's command-line utility for administrative tasks.""" 3 | import os 4 | import sys 5 | 6 | 7 | def main(): 8 | """Run administrative tasks.""" 9 | os.environ.setdefault("DJANGO_SETTINGS_MODULE", "core.settings") 10 | try: 11 | from django.core.management import execute_from_command_line 12 | except ImportError as exc: 13 | raise ImportError( 14 | "Couldn't import Django. Are you sure it's installed and " 15 | "available on your PYTHONPATH environment variable? Did you " 16 | "forget to activate a virtual environment?" 17 | ) from exc 18 | execute_from_command_line(sys.argv) 19 | 20 | 21 | if __name__ == "__main__": 22 | main() 23 | -------------------------------------------------------------------------------- /react-ui/src/theme/additions/layout/MainPanel.js: -------------------------------------------------------------------------------- 1 | const MainPanel = { 2 | baseStyle: { 3 | float: "right", 4 | maxWidth: "100%", 5 | overflow: "auto", 6 | position: "relative", 7 | maxHeight: "100%", 8 | transition: "all 0.33s cubic-bezier(0.685, 0.0473, 0.346, 1)", 9 | transitionDuration: ".2s, .2s, .35s", 10 | transitionProperty: "top, bottom, width", 11 | transitionTimingFunction: "linear, linear, ease", 12 | }, 13 | variants: { 14 | main: (props) => ({ 15 | float: "right", 16 | }), 17 | rtl: (props) => ({ 18 | float: "left", 19 | }), 20 | }, 21 | defaultProps: { 22 | variant: "main", 23 | }, 24 | }; 25 | 26 | export const MainPanelComponent = { 27 | components: { 28 | MainPanel, 29 | }, 30 | }; 31 | -------------------------------------------------------------------------------- /react-ui/src/assets/svg/cube.svg: -------------------------------------------------------------------------------- 1 | Cube -------------------------------------------------------------------------------- /react-ui/src/ProtectedRoute.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { useAuth } from './auth-context/auth.context'; 3 | import { useHistory, Outlet } from 'react-router-dom'; 4 | import SweetAlert from "react-bootstrap-sweetalert"; 5 | import { Route } from "react-router-dom"; 6 | 7 | export const ProtectedRoute = ({ ...rest }) => { 8 | const history = useHistory(); 9 | let { user } = useAuth(); 10 | return (<> 11 | {(!user || !user.token || user.token === "") ? ( 12 | history.psuh("/auth/signin")} 15 | onConfirm={() => history.push("/auth/signin")} 16 | confirmBtnCssClass={"px-5"} 17 | /> 18 | ) : ( 19 | 20 | )} 21 | ); 22 | }; 23 | -------------------------------------------------------------------------------- /react-ui/src/assets/svg/spotify-logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /react-ui/src/views/Dashboard/Tables/index.js: -------------------------------------------------------------------------------- 1 | // Chakra imports 2 | import { Flex } from "@chakra-ui/react"; 3 | import React from "react"; 4 | import Authors from "./components/Authors"; 5 | import Projects from "./components/Projects"; 6 | import { tablesTableData, dashboardTableData } from "variables/general"; 7 | 8 | function Tables() { 9 | return ( 10 | 11 | 16 | 21 | 22 | ); 23 | } 24 | 25 | export default Tables; 26 | -------------------------------------------------------------------------------- /react-ui/src/components/Charts/LineChart.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import ReactApexChart from "react-apexcharts"; 3 | import { lineChartData, lineChartOptions } from "variables/charts"; 4 | 5 | class LineChart extends React.Component { 6 | constructor(props) { 7 | super(props); 8 | 9 | this.state = { 10 | chartData: [], 11 | chartOptions: {}, 12 | }; 13 | } 14 | 15 | componentDidMount() { 16 | this.setState({ 17 | chartData: lineChartData, 18 | chartOptions: lineChartOptions, 19 | }); 20 | } 21 | 22 | render() { 23 | return ( 24 | 31 | ); 32 | } 33 | } 34 | 35 | export default LineChart; 36 | -------------------------------------------------------------------------------- /react-ui/src/assets/svg/person-circle-auth.svg: -------------------------------------------------------------------------------- 1 | Person Circle -------------------------------------------------------------------------------- /react-ui/src/assets/svg/globe.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /react-ui/src/assets/svg/rocket.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /api-server-django/api/authentication/viewsets/register.py: -------------------------------------------------------------------------------- 1 | from rest_framework import viewsets, status 2 | from rest_framework.response import Response 3 | from rest_framework.permissions import AllowAny 4 | 5 | from api.authentication.serializers import RegisterSerializer 6 | 7 | 8 | class RegisterViewSet(viewsets.ModelViewSet): 9 | http_method_names = ["post"] 10 | permission_classes = (AllowAny,) 11 | serializer_class = RegisterSerializer 12 | 13 | def create(self, request, *args, **kwargs): 14 | serializer = self.get_serializer(data=request.data) 15 | 16 | serializer.is_valid(raise_exception=True) 17 | user = serializer.save() 18 | 19 | return Response( 20 | { 21 | "success": True, 22 | "userID": user.id, 23 | "msg": "The user was successfully registered", 24 | }, 25 | status=status.HTTP_201_CREATED, 26 | ) 27 | -------------------------------------------------------------------------------- /api-server-django/core/test_runner.py: -------------------------------------------------------------------------------- 1 | from importlib import import_module 2 | 3 | from django.conf import settings 4 | from django.db import connections 5 | from django.test.runner import DiscoverRunner 6 | 7 | 8 | class CoreTestRunner(DiscoverRunner): 9 | def setup_test_environment(self, **kwargs): 10 | """We set the TESTING setting to True. By default, it's on False.""" 11 | super().setup_test_environment(**kwargs) 12 | settings.TESTING = True 13 | 14 | def setup_databases(self, **kwargs): 15 | """We set the database""" 16 | kwargs["aliases"] = connections 17 | r = super().setup_databases(**kwargs) 18 | self.load_fixtures() 19 | return r 20 | 21 | @classmethod 22 | def load_fixtures(cls): 23 | try: 24 | module = import_module(f"api.fixtures") 25 | getattr(module, "run_fixtures")() 26 | except ImportError: 27 | return 28 | -------------------------------------------------------------------------------- /react-ui/src/theme/components/button.js: -------------------------------------------------------------------------------- 1 | export const buttonStyles = { 2 | components: { 3 | Button: { 4 | variants: { 5 | "no-hover": { 6 | _hover: { 7 | boxShadow: "none", 8 | }, 9 | }, 10 | "transparent-with-icon": { 11 | bg: "transparent", 12 | fontWeight: "bold", 13 | borderRadius: "inherit", 14 | cursor: "pointer", 15 | _hover: "none", 16 | _active: { 17 | bg: "transparent", 18 | transform: "none", 19 | borderColor: "transparent", 20 | }, 21 | _focus: { 22 | boxShadow: "none", 23 | }, 24 | _hover: { 25 | boxShadow: "none", 26 | }, 27 | }, 28 | }, 29 | baseStyle: { 30 | borderRadius: "15px", 31 | _focus: { 32 | boxShadow: "none", 33 | }, 34 | }, 35 | }, 36 | }, 37 | }; 38 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | # MIT License 2 | 3 | Copyright (c) 2019 - present [AppSeed](http://appseed.us/) 4 | 5 |
6 | 7 | ## Licensing Information 8 | 9 |
10 | 11 | | Item | - | 12 | | ---------------------------------- | --- | 13 | | License Type | MIT | 14 | | Use for print | **YES** | 15 | | Create single personal website/app | **YES** | 16 | | Create single website/app for client | **YES** | 17 | | Create multiple website/apps for clients | **YES** | 18 | | Create multiple SaaS applications | **YES** | 19 | | End-product paying users | **YES** | 20 | | Product sale | **YES** | 21 | | Remove footer credits | **YES** | 22 | | --- | --- | 23 | | Remove copyright mentions from source code | NO | 24 | | Production deployment assistance | NO | 25 | | Create HTML/CSS template for sale | NO | 26 | | Create Theme/Template for CMS for sale | NO | 27 | | Separate sale of our UI Elements | NO | 28 | 29 |
30 | 31 | --- 32 | For more information regarding licensing, contact the AppSeed Service < *support@appseed.us* > 33 | -------------------------------------------------------------------------------- /api-server-django/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 3 | ## [1.0.4] 2022-11-05 4 | ### Improvements 5 | 6 | - Updated for Deploy on RENDER using [Python Deployer](https://github.com/app-generator/deploy-automation-render) 7 | - `python.exe .\deployer.py django https://github.com/app-generator/api-server-django` 8 | - The new API is usable via `https://api-server-django-.onrender.com/api/` 9 | 10 | ## [1.0.3] 2022-10-03 11 | ### Improvements 12 | 13 | - Fix Docker Scripts 14 | 15 | ## [1.0.2] 2022-06-07 16 | ### Improvements 17 | 18 | - Update Docker Scripts 19 | - App served now by Gunicorn 20 | - Update Dependencies 21 | 22 | ## [1.0.1] 2022-01-28 23 | ### Improvements 24 | 25 | - Dependencies update (all packages) 26 | - `Django==4.0.1` 27 | 28 | ## [1.0.0] 2021-07-20 29 | ### First stable version 30 | 31 | > Features: 32 | 33 | - API: 34 | - Sign UP: `/api/users/register` 35 | - Sign IN: `/api/users/login` 36 | - Logout: `/api/users/logout` 37 | - Check Session: `/api/users/checkSession` 38 | - Edit User: `/api/users/edit` 39 | - Docker 40 | -------------------------------------------------------------------------------- /react-ui/src/components/Charts/BarChart.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from "react"; 2 | import Card from "components/Card/Card"; 3 | import Chart from "react-apexcharts"; 4 | import { barChartData, barChartOptions } from "variables/charts"; 5 | 6 | class BarChart extends Component { 7 | constructor(props) { 8 | super(props); 9 | this.state = { 10 | chartData: [], 11 | chartOptions: {}, 12 | }; 13 | } 14 | 15 | componentDidMount() { 16 | this.setState({ 17 | chartData: barChartData, 18 | chartOptions: barChartOptions, 19 | }); 20 | } 21 | 22 | render() { 23 | return ( 24 | 31 | 38 | 39 | ); 40 | } 41 | } 42 | 43 | export default BarChart; 44 | -------------------------------------------------------------------------------- /react-ui/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 3 | ## [v1.0.7] 2022-12-03 4 | ### Changes 5 | 6 | - UI/UX Changes 7 | - Minor Fixes 8 | 9 | ## [v1.0.6] 2022-12-03 10 | ### Changes 11 | 12 | - Bump UI: `v2.0.3` 13 | - Updates for [LIVE Deployer](https://appseed.us/go-live/) 14 | 15 | ## [v1.0.5] 2022-11-08 16 | ### Improvements 17 | 18 | - Save Compat matrix in `package.json` 19 | - `build` node 20 | - Yarn, NPM 21 | - NodeJS versions 22 | 23 | ## [1.0.4] 2022-11-05 24 | ### Improvements 25 | 26 | - Added `env.sample` 27 | - `API_URL` can be specified in `env` (optional) 28 | - data used in `src/config.js` 29 | - Added `compatibility matrix` for Node, yarn & NPM 30 | - Testing tool: [Render API Wrapper](https://github.com/app-generator/deploy-automation-render) 31 | 32 | ## [1.0.3] 2021-11-16 33 | ### Improvements 34 | 35 | - Added Docker Support 36 | - Fixes: 37 | - Logout over Flask API Server 38 | 39 | ## [1.0.2] 2021-10-13 40 | ### Improvements 41 | 42 | - Added Usable JWT Authentication Flow 43 | - Login/Logout/Register 44 | 45 | ## [1.0.1] 2021-10-09 46 | ### Initial Import 47 | 48 | - Added RTL Page 49 | - Bug Fixing 50 | - Added Chakra UI - Base Framework 51 | -------------------------------------------------------------------------------- /api-server-django/api/user/tests.py: -------------------------------------------------------------------------------- 1 | from django.urls import reverse 2 | from rest_framework.test import APITestCase 3 | from rest_framework import status 4 | 5 | 6 | class UserViewSetTest(APITestCase): 7 | base_edit_url = reverse("api:user-edit-list") 8 | base_url_login = reverse("api:login-list") 9 | 10 | data_login = {"password": "12345678", "email": "teast@admin.com"} 11 | 12 | def test_edit(self): 13 | 14 | # Login to retrieve token 15 | 16 | response = self.client.post(f"{self.base_url_login}", data=self.data_login) 17 | response_data = response.json() 18 | 19 | token = response_data["token"] 20 | user_id = response_data["user"]["_id"] 21 | 22 | self.client.credentials(HTTP_AUTHORIZATION=token) 23 | 24 | # Edit user 25 | 26 | data = { 27 | "email": "new@admin.com", 28 | "userID": user_id, 29 | } 30 | 31 | response = self.client.post(f"{self.base_edit_url}", data=data) 32 | self.assertEqual(response.status_code, status.HTTP_200_OK) 33 | 34 | response_data = response.json() 35 | 36 | self.assertEqual(response_data["success"], True) 37 | -------------------------------------------------------------------------------- /react-ui/src/views/Dashboard/Dashboard/components/ChartStatistics.js: -------------------------------------------------------------------------------- 1 | import { Flex, Progress, Text, useColorModeValue } from "@chakra-ui/react"; 2 | import IconBox from "components/Icons/IconBox"; 3 | import React from "react"; 4 | 5 | const ChartStatistics = ({ title, amount, icon, percentage }) => { 6 | const iconTeal = useColorModeValue("teal.300", "teal.300"); 7 | const iconBoxInside = useColorModeValue("white", "white"); 8 | const textColor = useColorModeValue("gray.700", "white"); 9 | const overlayRef = React.useRef(); 10 | return ( 11 | 12 | 13 | 14 | {icon} 15 | 16 | 17 | {title} 18 | 19 | 20 | 21 | {amount} 22 | 23 | 29 | 30 | ); 31 | }; 32 | 33 | export default ChartStatistics; 34 | -------------------------------------------------------------------------------- /react-ui/src/assets/svg/jira-logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /react-ui/src/components/Menu/ItemContent.js: -------------------------------------------------------------------------------- 1 | // chakra imports 2 | import { Avatar, Flex, Text, useColorModeValue } from "@chakra-ui/react"; 3 | import { ClockIcon } from "components/Icons/Icons"; 4 | import PropTypes from "prop-types"; 5 | import React from "react"; 6 | 7 | export function ItemContent(props) { 8 | const navbarIcon = useColorModeValue("gray.500", "gray.200"); 9 | const notificationColor = useColorModeValue("gray.700", "white"); 10 | const spacing = " "; 11 | return ( 12 | <> 13 | 19 | 20 | 21 | 22 | {props.boldInfo} 23 | {spacing} 24 | 25 | {props.info} 26 | 27 | 28 | 29 | 30 | {props.time} 31 | 32 | 33 | 34 | 35 | ); 36 | } 37 | -------------------------------------------------------------------------------- /react-ui/src/assets/svg/invision-logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /react-ui/src/assets/svg/visa.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /api-server-django/api/authentication/serializers/register.py: -------------------------------------------------------------------------------- 1 | from rest_framework import serializers 2 | from rest_framework.exceptions import ValidationError 3 | from django.core.exceptions import ObjectDoesNotExist 4 | from api.user.models import User 5 | 6 | 7 | class RegisterSerializer(serializers.ModelSerializer): 8 | password = serializers.CharField(min_length=4, max_length=128, write_only=True) 9 | username = serializers.CharField(max_length=255, required=True) 10 | email = serializers.EmailField(required=True) 11 | 12 | class Meta: 13 | model = User 14 | fields = ["id", "username", "password", "email", "is_active", "date"] 15 | 16 | def validate_username(self, value): 17 | try: 18 | User.objects.get(username=value) 19 | except ObjectDoesNotExist: 20 | return value 21 | raise ValidationError({"success": False, "msg": "Username already taken."}) 22 | 23 | def validate_email(self, value): 24 | try: 25 | User.objects.get(email=value) 26 | except ObjectDoesNotExist: 27 | return value 28 | raise ValidationError({"success": False, "msg": "Email already taken."}) 29 | 30 | def create(self, validated_data): 31 | 32 | return User.objects.create_user(**validated_data) 33 | -------------------------------------------------------------------------------- /react-ui/src/views/Dashboard/Dashboard/components/SalesOverview.js: -------------------------------------------------------------------------------- 1 | // Chakra imports 2 | import { Box, Flex, Text, useColorModeValue } from "@chakra-ui/react"; 3 | // Custom components 4 | import Card from "components/Card/Card.js"; 5 | import CardHeader from "components/Card/CardHeader.js"; 6 | import React from "react"; 7 | 8 | const SalesOverview = ({ title, percentage, chart }) => { 9 | const textColor = useColorModeValue("gray.700", "white"); 10 | return ( 11 | 12 | 13 | 14 | 15 | {title} 16 | 17 | 18 | 0 ? "green.400" : "red.400"} 21 | fontWeight='bold'> 22 | {`${percentage}%`} more 23 | {" "} 24 | in 2021 25 | 26 | 27 | 28 | 29 | {chart} 30 | 31 | 32 | ); 33 | }; 34 | 35 | export default SalesOverview; 36 | -------------------------------------------------------------------------------- /api-server-django/LICENSE.md: -------------------------------------------------------------------------------- 1 | # MIT License 2 | 3 | Copyright (c) 2019 - present [AppSeed](http://appseed.us/) 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 | 23 |
24 | 25 | --- 26 | For more information regarding licensing, contact the AppSeed Service < *support@appseed.us* > -------------------------------------------------------------------------------- /react-ui/src/components/Tables/InvoicesRow.js: -------------------------------------------------------------------------------- 1 | import { 2 | Box, 3 | Button, 4 | Flex, 5 | Icon, 6 | Spacer, 7 | Text, 8 | useColorModeValue, 9 | } from "@chakra-ui/react"; 10 | import React from "react"; 11 | 12 | function InvoicesRow(props) { 13 | const textColor = useColorModeValue("gray.700", "white"); 14 | const { date, code, price, format, logo } = props; 15 | 16 | return ( 17 | 18 | 19 | 20 | {date} 21 | 22 | 23 | {code} 24 | 25 | 26 | 27 | 28 | 29 | {price} 30 | 31 | 32 | 40 | 41 | ); 42 | } 43 | 44 | export default InvoicesRow; 45 | -------------------------------------------------------------------------------- /api-server-django/api/authentication/migrations/0001_initial.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.2.5 on 2021-07-15 11:29 2 | 3 | from django.conf import settings 4 | from django.db import migrations, models 5 | import django.db.models.deletion 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | initial = True 11 | 12 | dependencies = [ 13 | migrations.swappable_dependency(settings.AUTH_USER_MODEL), 14 | ] 15 | 16 | operations = [ 17 | migrations.CreateModel( 18 | name="ActiveSession", 19 | fields=[ 20 | ( 21 | "id", 22 | models.BigAutoField( 23 | auto_created=True, 24 | primary_key=True, 25 | serialize=False, 26 | verbose_name="ID", 27 | ), 28 | ), 29 | ("token", models.CharField(max_length=255)), 30 | ("date", models.DateTimeField(auto_now_add=True)), 31 | ( 32 | "user", 33 | models.ForeignKey( 34 | on_delete=django.db.models.deletion.CASCADE, 35 | to=settings.AUTH_USER_MODEL, 36 | ), 37 | ), 38 | ], 39 | ), 40 | ] 41 | -------------------------------------------------------------------------------- /react-ui/src/assets/svg/slack-logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /react-ui/src/views/Dashboard/Billing/components/BillingInformation.js: -------------------------------------------------------------------------------- 1 | // Chakra imports 2 | import { Flex, Text, useColorModeValue } from "@chakra-ui/react"; 3 | // Custom components 4 | import Card from "components/Card/Card.js"; 5 | import CardBody from "components/Card/CardBody.js"; 6 | import CardHeader from "components/Card/CardHeader.js"; 7 | import BillingRow from "components/Tables/BillingRow"; 8 | import React from "react"; 9 | 10 | const BillingInformation = ({ title, data }) => { 11 | const textColor = useColorModeValue("gray.700", "white"); 12 | return ( 13 | 14 | 15 | 16 | 17 | {title} 18 | 19 | 20 | 21 | 22 | {data.map((row) => { 23 | return ( 24 | 30 | ); 31 | })} 32 | 33 | 34 | 35 | 36 | ); 37 | }; 38 | 39 | export default BillingInformation; 40 | -------------------------------------------------------------------------------- /react-ui/src/theme/theme.js: -------------------------------------------------------------------------------- 1 | import { extendTheme } from '@chakra-ui/react'; 2 | import { globalStyles } from './styles'; 3 | import { breakpoints } from './foundations/breakpoints'; 4 | import { buttonStyles } from './components/button'; 5 | import { badgeStyles } from './components/badge'; 6 | import { linkStyles } from './components/link'; 7 | import { drawerStyles } from './components/drawer'; 8 | import { CardComponent } from './additions/card/Card'; 9 | import { CardBodyComponent } from './additions/card/CardBody'; 10 | import { CardHeaderComponent } from './additions/card/CardHeader'; 11 | import { MainPanelComponent } from './additions/layout/MainPanel'; 12 | import { PanelContentComponent } from './additions/layout/PanelContent'; 13 | import { PanelContainerComponent } from './additions/layout/PanelContainer'; 14 | // import { mode } from "@chakra-ui/theme-tools"; 15 | export default extendTheme( 16 | { breakpoints }, // Breakpoints 17 | globalStyles, 18 | buttonStyles, // Button styles 19 | badgeStyles, // Badge styles 20 | linkStyles, // Link styles 21 | drawerStyles, // Sidebar variant for Chakra's drawer 22 | CardComponent, // Card component 23 | CardBodyComponent, // Card Body component 24 | CardHeaderComponent, // Card Header component 25 | MainPanelComponent, // Main Panel component 26 | PanelContentComponent, // Panel Content component 27 | PanelContainerComponent // Panel Container component 28 | ); 29 | -------------------------------------------------------------------------------- /react-ui/src/components/Tables/TimelineRow.js: -------------------------------------------------------------------------------- 1 | import { Box, Flex, Icon, Text, useColorModeValue } from "@chakra-ui/react"; 2 | import React from "react"; 3 | 4 | function TimelineRow(props) { 5 | const { logo, title, date, color, index, arrLength } = props; 6 | const textColor = useColorModeValue("gray.700", "white.300"); 7 | const bgIconColor = useColorModeValue("white.300", "gray.700"); 8 | 9 | return ( 10 | 11 | 12 | 24 | 29 | 30 | 31 | 32 | {title} 33 | 34 | 35 | {date} 36 | 37 | 38 | 39 | ); 40 | } 41 | 42 | export default TimelineRow; 43 | -------------------------------------------------------------------------------- /react-ui/src/components/FixedPlugin/FixedPlugin.js: -------------------------------------------------------------------------------- 1 | // Chakra Imports 2 | import { Button, useColorModeValue } from "@chakra-ui/react"; 3 | // Custom Icons 4 | import { SettingsIcon } from "components/Icons/Icons"; 5 | import PropTypes from "prop-types"; 6 | import React from "react"; 7 | 8 | export default function FixedPlugin(props) { 9 | const { secondary, onChange, onSwitch, fixed, ...rest } = props; 10 | // Chakra Color Mode 11 | let navbarIcon = useColorModeValue("gray.500", "gray.200"); 12 | let bgButton = useColorModeValue("white", "gray.600"); 13 | let fixedDisplay = "flex"; 14 | if (props.secondary) { 15 | fixedDisplay = "none"; 16 | } 17 | 18 | const settingsRef = React.useRef(); 19 | return ( 20 | <> 21 | 42 | 43 | ); 44 | } 45 | 46 | FixedPlugin.propTypes = { 47 | fixed: PropTypes.bool, 48 | onChange: PropTypes.func, 49 | onSwitch: PropTypes.func, 50 | }; 51 | -------------------------------------------------------------------------------- /react-ui/src/index.js: -------------------------------------------------------------------------------- 1 | /*! 2 | 3 | ========================================================= 4 | * Purity UI Dashboard - v1.0.1 5 | ========================================================= 6 | 7 | * Product Page: https://www.creative-tim.com/product/purity-ui-dashboard 8 | * Copyright 2021 Creative Tim (https://www.creative-tim.com) 9 | * Licensed under MIT (https://github.com/creativetimofficial/purity-ui-dashboard/blob/master/LICENSE.md) 10 | 11 | * Design by Creative Tim & Coded by Simmmple 12 | 13 | ========================================================= 14 | 15 | * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 16 | 17 | */ 18 | import React from "react"; 19 | import ReactDOM from "react-dom"; 20 | import { HashRouter, Route, Switch, Redirect } from "react-router-dom"; 21 | 22 | import { AuthProvider } from "./auth-context/auth.context"; 23 | 24 | import AuthLayout from "layouts/Auth.js"; 25 | import AdminLayout from "layouts/Admin.js"; 26 | import RTLLayout from "layouts/RTL.js"; 27 | 28 | let user = localStorage.getItem("user"); 29 | user = JSON.parse(user); 30 | 31 | ReactDOM.render( 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | , 42 | document.getElementById("root") 43 | ); 44 | -------------------------------------------------------------------------------- /react-ui/src/components/Navbars/SearchBar/SearchBar.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { 3 | IconButton, 4 | Input, 5 | InputGroup, 6 | InputLeftElement, 7 | useColorModeValue, 8 | } from "@chakra-ui/react"; 9 | import { SearchIcon } from "@chakra-ui/icons"; 10 | export function SearchBar(props) { 11 | // Pass the computed styles into the `__css` prop 12 | const { variant, children, ...rest } = props; 13 | // Chakra Color Mode 14 | const mainTeal = useColorModeValue("teal.300", "teal.300"); 15 | const searchIconColor = useColorModeValue("gray.700", "gray.200"); 16 | const inputBg = useColorModeValue("white", "gray.800"); 17 | return ( 18 | 29 | } 44 | > 45 | } 46 | /> 47 | 53 | 54 | ); 55 | } 56 | -------------------------------------------------------------------------------- /api-server-django/api/user/viewsets.py: -------------------------------------------------------------------------------- 1 | from api.user.serializers import UserSerializer 2 | from api.user.models import User 3 | from rest_framework import viewsets, status 4 | from rest_framework.permissions import IsAuthenticated 5 | from rest_framework.response import Response 6 | from rest_framework.exceptions import ValidationError 7 | from rest_framework import mixins 8 | 9 | 10 | class UserViewSet( 11 | viewsets.GenericViewSet, mixins.CreateModelMixin, mixins.UpdateModelMixin 12 | ): 13 | serializer_class = UserSerializer 14 | permission_classes = (IsAuthenticated,) 15 | 16 | error_message = {"success": False, "msg": "Error updating user"} 17 | 18 | def update(self, request, *args, **kwargs): 19 | partial = kwargs.pop("partial", True) 20 | instance = User.objects.get(id=request.data.get("userID")) 21 | serializer = self.get_serializer(instance, data=request.data, partial=partial) 22 | serializer.is_valid(raise_exception=True) 23 | self.perform_update(serializer) 24 | 25 | if getattr(instance, "_prefetched_objects_cache", None): 26 | instance._prefetched_objects_cache = {} 27 | 28 | return Response(serializer.data) 29 | 30 | def create(self, request, *args, **kwargs): 31 | user_id = request.data.get("userID") 32 | 33 | if not user_id: 34 | raise ValidationError(self.error_message) 35 | 36 | if self.request.user.pk != int(user_id) and not self.request.user.is_superuser: 37 | raise ValidationError(self.error_message) 38 | 39 | self.update(request) 40 | 41 | return Response({"success": True}, status.HTTP_200_OK) 42 | -------------------------------------------------------------------------------- /api-server-django/api/authentication/backends.py: -------------------------------------------------------------------------------- 1 | import jwt 2 | 3 | from rest_framework import authentication, exceptions 4 | from django.conf import settings 5 | 6 | from api.user.models import User 7 | from api.authentication.models import ActiveSession 8 | 9 | 10 | class ActiveSessionAuthentication(authentication.BaseAuthentication): 11 | 12 | auth_error_message = {"success": False, "msg": "User is not logged on."} 13 | 14 | def authenticate(self, request): 15 | 16 | request.user = None 17 | 18 | auth_header = authentication.get_authorization_header(request) 19 | 20 | if not auth_header: 21 | return None 22 | 23 | token = auth_header.decode("utf-8") 24 | 25 | return self._authenticate_credentials(token) 26 | 27 | def _authenticate_credentials(self, token): 28 | 29 | try: 30 | jwt.decode(token, settings.SECRET_KEY, algorithms=["HS256"]) 31 | except: 32 | raise exceptions.AuthenticationFailed(self.auth_error_message) 33 | 34 | try: 35 | active_session = ActiveSession.objects.get(token=token) 36 | except: 37 | raise exceptions.AuthenticationFailed(self.auth_error_message) 38 | 39 | try: 40 | user = active_session.user 41 | except User.DoesNotExist: 42 | msg = {"success": False, "msg": "No user matching this token was found."} 43 | raise exceptions.AuthenticationFailed(msg) 44 | 45 | if not user.is_active: 46 | msg = {"success": False, "msg": "This user has been deactivated."} 47 | raise exceptions.AuthenticationFailed(msg) 48 | 49 | return (user, token) 50 | -------------------------------------------------------------------------------- /react-ui/src/components/Sidebar/index.js: -------------------------------------------------------------------------------- 1 | /*eslint-disable*/ 2 | // chakra imports 3 | import { 4 | Box, useColorModeValue 5 | } from "@chakra-ui/react"; 6 | import React from "react"; 7 | import SidebarContent from "./SidebarContent"; 8 | 9 | // FUNCTIONS 10 | 11 | function Sidebar(props) { 12 | // to check for active links and opened collapses 13 | const mainPanel = React.useRef(); 14 | let variantChange = "0.2s linear"; 15 | 16 | const { logoText, routes, sidebarVariant } = props; 17 | 18 | // BRAND 19 | // Chakra Color Mode 20 | let sidebarBg = "none"; 21 | let sidebarRadius = "0px"; 22 | let sidebarMargins = "0px"; 23 | if (sidebarVariant === "opaque") { 24 | sidebarBg = useColorModeValue("white", "gray.700"); 25 | sidebarRadius = "16px"; 26 | sidebarMargins = "16px 0px 16px 16px"; 27 | } 28 | 29 | // SIDEBAR 30 | return ( 31 | 32 | 33 | 50 | 55 | 56 | 57 | 58 | ); 59 | } 60 | 61 | 62 | 63 | 64 | export default Sidebar; 65 | -------------------------------------------------------------------------------- /react-ui/src/views/Dashboard/Billing/components/Invoices.js: -------------------------------------------------------------------------------- 1 | // Chakra imports 2 | import { Button, Flex, Text, useColorModeValue } from "@chakra-ui/react"; 3 | // Custom components 4 | import Card from "components/Card/Card.js"; 5 | import CardBody from "components/Card/CardBody.js"; 6 | import CardHeader from "components/Card/CardHeader.js"; 7 | import InvoicesRow from "components/Tables/InvoicesRow"; 8 | import React from "react"; 9 | 10 | const Invoices = ({ title, data }) => { 11 | const textColor = useColorModeValue("gray.700", "white"); 12 | 13 | return ( 14 | 18 | 19 | 20 | 21 | {title} 22 | 23 | 32 | 33 | 34 | 35 | 36 | {data.map((row) => { 37 | return ( 38 | 45 | ); 46 | })} 47 | 48 | 49 | 50 | ); 51 | }; 52 | 53 | export default Invoices; 54 | -------------------------------------------------------------------------------- /react-ui/src/views/Dashboard/Dashboard/components/OrdersOverview.js: -------------------------------------------------------------------------------- 1 | // Chakra imports 2 | import { Flex, Text, useColorModeValue } from "@chakra-ui/react"; 3 | // Custom components 4 | import Card from "components/Card/Card.js"; 5 | import CardBody from "components/Card/CardBody.js"; 6 | import CardHeader from "components/Card/CardHeader.js"; 7 | import TimelineRow from "components/Tables/TimelineRow"; 8 | import React from "react"; 9 | 10 | const OrdersOverview = ({ title, amount, data }) => { 11 | const textColor = useColorModeValue("gray.700", "white"); 12 | 13 | return ( 14 | 15 | 16 | 17 | 18 | {title} 19 | 20 | 21 | 22 | {`${amount}%`} 23 | {" "} 24 | this month. 25 | 26 | 27 | 28 | 29 | 30 | {data.map((row, index, arr) => { 31 | return ( 32 | 41 | ); 42 | })} 43 | 44 | 45 | 46 | ); 47 | }; 48 | 49 | export default OrdersOverview; 50 | -------------------------------------------------------------------------------- /react-ui/src/components/Sidebar/SidebarHelp.js: -------------------------------------------------------------------------------- 1 | import { QuestionIcon } from "@chakra-ui/icons"; 2 | import { Button, Flex, Link, Text } from "@chakra-ui/react"; 3 | import SidebarHelpImage from "assets/img/SidebarHelpImage.png"; 4 | import IconBox from "components/Icons/IconBox"; 5 | import React from "react"; 6 | 7 | export function SidebarHelp(props) { 8 | // Pass the computed styles into the `__css` prop 9 | const { children, ...rest } = props; 10 | return ( 11 | 22 | 23 | 24 | 25 | 26 | Need help? 27 | 28 | 29 | Please check our docs 30 | 31 | 35 | 53 | 54 | 55 | ); 56 | } 57 | -------------------------------------------------------------------------------- /react-ui/src/views/Dashboard/Billing/components/PaymentStatistics.js: -------------------------------------------------------------------------------- 1 | // Chakra imports 2 | import { Flex, Text, useColorModeValue } from "@chakra-ui/react"; 3 | // Custom components 4 | import Card from "components/Card/Card.js"; 5 | import CardBody from "components/Card/CardBody.js"; 6 | import IconBox from "components/Icons/IconBox"; 7 | import { Separator } from "components/Separator/Separator"; 8 | import React from "react"; 9 | 10 | const PaymentStatistics = ({ icon, title, description, amount }) => { 11 | const iconTeal = useColorModeValue("teal.300", "teal.300"); 12 | const textColor = useColorModeValue("gray.700", "white"); 13 | 14 | return ( 15 | 16 | 17 | 18 | 19 | {icon} 20 | 21 | 28 | 29 | {title} 30 | 31 | 36 | {description} 37 | 38 | 39 | 40 | 41 | {`%${amount}`} 42 | 43 | 44 | 45 | 46 | ); 47 | }; 48 | 49 | export default PaymentStatistics; 50 | -------------------------------------------------------------------------------- /react-ui/src/components/Tables/TransactionRow.js: -------------------------------------------------------------------------------- 1 | import { Box, Flex, Icon, Text, useColorModeValue } from "@chakra-ui/react"; 2 | import React from "react"; 3 | 4 | function TransactionRow(props) { 5 | const textColor = useColorModeValue("gray.700", "white"); 6 | const { name, date, logo, price } = props; 7 | 8 | return ( 9 | 10 | 11 | 28 | 29 | 30 | 31 | 36 | {name} 37 | 38 | 43 | {date} 44 | 45 | 46 | 47 | 56 | 57 | {price} 58 | 59 | 60 | 61 | ); 62 | } 63 | 64 | export default TransactionRow; 65 | -------------------------------------------------------------------------------- /react-ui/src/views/Dashboard/Dashboard/components/MiniStatistics.js: -------------------------------------------------------------------------------- 1 | // Chakra imports 2 | import { 3 | Flex, 4 | Stat, 5 | StatHelpText, 6 | StatLabel, 7 | StatNumber, 8 | useColorModeValue, 9 | } from "@chakra-ui/react"; 10 | // Custom components 11 | import Card from "components/Card/Card.js"; 12 | import CardBody from "components/Card/CardBody.js"; 13 | import IconBox from "components/Icons/IconBox"; 14 | import React from "react"; 15 | 16 | const MiniStatistics = ({ title, amount, percentage, icon }) => { 17 | const iconTeal = useColorModeValue("teal.300", "teal.300"); 18 | const textColor = useColorModeValue("gray.700", "white"); 19 | 20 | return ( 21 | 22 | 23 | 24 | 25 | 30 | {title} 31 | 32 | 33 | 34 | {amount} 35 | 36 | 0 ? "green.400" : "red.400"} 41 | fontWeight='bold' 42 | ps='3px' 43 | fontSize='md'> 44 | {percentage > 0 ? `+${percentage}%` : `${percentage}%`} 45 | 46 | 47 | 48 | 49 | {icon} 50 | 51 | 52 | 53 | 54 | ); 55 | }; 56 | 57 | export default MiniStatistics; 58 | -------------------------------------------------------------------------------- /react-ui/src/assets/svg/adobexd-logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /react-ui/src/views/Dashboard/Profile/components/ProjectCard.js: -------------------------------------------------------------------------------- 1 | // Chakra imports 2 | import { 3 | Avatar, 4 | AvatarGroup, 5 | Box, 6 | Button, 7 | Flex, 8 | Image, 9 | Text, 10 | useColorModeValue, 11 | } from "@chakra-ui/react"; 12 | import React from "react"; 13 | 14 | const ProjectCard = ({ image, name, category, avatars, description }) => { 15 | // Chakra color mode 16 | const textColor = useColorModeValue("gray.700", "white"); 17 | 18 | return ( 19 | 20 | 21 | 22 | 29 | 30 | 31 | 32 | {name} 33 | 34 | 35 | {category} 36 | 37 | 38 | {description} 39 | 40 | 41 | 50 | 51 | {avatars.map((el, idx) => { 52 | return ; 53 | })} 54 | 55 | 56 | 57 | 58 | ); 59 | }; 60 | 61 | export default ProjectCard; 62 | -------------------------------------------------------------------------------- /react-ui/src/components/Tables/TablesProjectRow.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { 3 | Tr, 4 | Td, 5 | Flex, 6 | Text, 7 | Progress, 8 | Icon, 9 | Button, 10 | useColorModeValue, 11 | } from "@chakra-ui/react"; 12 | import { FaEllipsisV } from "react-icons/fa"; 13 | 14 | function DashboardTableRow(props) { 15 | const { logo, name, status, budget, progression } = props; 16 | const textColor = useColorModeValue("gray.700", "white"); 17 | return ( 18 | 19 | 20 | 21 | 22 | 28 | {name} 29 | 30 | 31 | 32 | 33 | 34 | {budget} 35 | 36 | 37 | 38 | 39 | {status} 40 | 41 | 42 | 43 | 44 | {`${progression}%`} 50 | 56 | 57 | 58 | 59 | 62 | 63 | 64 | ); 65 | } 66 | 67 | export default DashboardTableRow; 68 | -------------------------------------------------------------------------------- /react-ui/src/views/Dashboard/Tables/components/Projects.js: -------------------------------------------------------------------------------- 1 | // Chakra imports 2 | import { 3 | Flex, 4 | Table, 5 | Tbody, 6 | Text, 7 | Th, 8 | Thead, 9 | Tr, 10 | useColorModeValue, 11 | } from "@chakra-ui/react"; 12 | // Custom components 13 | import Card from "components/Card/Card.js"; 14 | import CardBody from "components/Card/CardBody.js"; 15 | import CardHeader from "components/Card/CardHeader.js"; 16 | import TablesProjectRow from "components/Tables/TablesProjectRow"; 17 | import React from "react"; 18 | 19 | const Projects = ({ title, captions, data }) => { 20 | const textColor = useColorModeValue("gray.700", "white"); 21 | return ( 22 | 23 | 24 | 25 | 26 | {title} 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | {captions.map((caption, idx) => { 35 | return ( 36 | 39 | ); 40 | })} 41 | 42 | 43 | 44 | {data.map((row) => { 45 | return ( 46 | 54 | ); 55 | })} 56 | 57 |
37 | {caption} 38 |
58 |
59 |
60 | ); 61 | }; 62 | 63 | export default Projects; 64 | -------------------------------------------------------------------------------- /api-server-django/api/user/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | 3 | from django.contrib.auth.models import ( 4 | AbstractBaseUser, 5 | BaseUserManager, 6 | PermissionsMixin, 7 | ) 8 | 9 | 10 | class UserManager(BaseUserManager): 11 | def create_user(self, username, email, password=None, **kwargs): 12 | """Create and return a `User` with an email, username and password.""" 13 | if username is None: 14 | raise TypeError("Users must have a username.") 15 | if email is None: 16 | raise TypeError("Users must have an email.") 17 | 18 | user = self.model(username=username, email=self.normalize_email(email)) 19 | user.set_password(password) 20 | user.save(using=self._db) 21 | 22 | return user 23 | 24 | def create_superuser(self, username, email, password): 25 | """ 26 | Create and return a `User` with superuser (admin) permissions. 27 | """ 28 | if password is None: 29 | raise TypeError("Superusers must have a password.") 30 | if email is None: 31 | raise TypeError("Superusers must have an email.") 32 | if username is None: 33 | raise TypeError("Superusers must have an username.") 34 | 35 | user = self.create_user(username, email, password) 36 | user.is_superuser = True 37 | user.is_staff = True 38 | user.save(using=self._db) 39 | 40 | return user 41 | 42 | 43 | class User(AbstractBaseUser, PermissionsMixin): 44 | username = models.CharField(db_index=True, max_length=255, unique=True) 45 | email = models.EmailField(db_index=True, unique=True) 46 | is_active = models.BooleanField(default=True) 47 | is_staff = models.BooleanField(default=False) 48 | date = models.DateTimeField(auto_now_add=True) 49 | 50 | USERNAME_FIELD = "email" 51 | REQUIRED_FIELDS = ["username"] 52 | 53 | objects = UserManager() 54 | 55 | def __str__(self): 56 | return f"{self.email}" 57 | -------------------------------------------------------------------------------- /react-ui/src/views/Dashboard/Tables/components/Authors.js: -------------------------------------------------------------------------------- 1 | // Chakra imports 2 | import { 3 | Table, 4 | Tbody, 5 | Text, 6 | Th, 7 | Thead, 8 | Tr, 9 | useColorModeValue, 10 | } from "@chakra-ui/react"; 11 | // Custom components 12 | import Card from "components/Card/Card.js"; 13 | import CardBody from "components/Card/CardBody.js"; 14 | import CardHeader from "components/Card/CardHeader.js"; 15 | import TablesTableRow from "components/Tables/TablesTableRow"; 16 | import React from "react"; 17 | 18 | const Authors = ({ title, captions, data }) => { 19 | const textColor = useColorModeValue("gray.700", "white"); 20 | return ( 21 | 22 | 23 | 24 | {title} 25 | 26 | 27 | 28 | 29 | 30 | 31 | {captions.map((caption, idx) => { 32 | return ( 33 | 36 | ); 37 | })} 38 | 39 | 40 | 41 | {data.map((row) => { 42 | return ( 43 | 53 | ); 54 | })} 55 | 56 |
34 | {caption} 35 |
57 |
58 |
59 | ); 60 | }; 61 | 62 | export default Authors; 63 | -------------------------------------------------------------------------------- /react-ui/src/components/Tables/DashboardTableRow.js: -------------------------------------------------------------------------------- 1 | import { 2 | Avatar, 3 | AvatarGroup, 4 | Flex, 5 | Icon, 6 | Progress, 7 | Td, 8 | Text, 9 | Tr, 10 | useColorModeValue, 11 | } from "@chakra-ui/react"; 12 | import React from "react"; 13 | 14 | function DashboardTableRow(props) { 15 | const { logo, name, members, budget, progression } = props; 16 | const textColor = useColorModeValue("gray.700", "white"); 17 | return ( 18 | 19 | 20 | 21 | 22 | 28 | {name} 29 | 30 | 31 | 32 | 33 | 34 | 35 | {members.map((member) => { 36 | return ( 37 | 43 | ); 44 | })} 45 | 46 | 47 | 48 | 49 | {budget} 50 | 51 | 52 | 53 | 54 | {`${progression}%`} 60 | 66 | 67 | 68 | 69 | ); 70 | } 71 | 72 | export default DashboardTableRow; 73 | -------------------------------------------------------------------------------- /react-ui/src/views/Dashboard/Billing/components/CreditCard.js: -------------------------------------------------------------------------------- 1 | // Chakra imports 2 | import { Box, Flex, Spacer, Text } from "@chakra-ui/react"; 3 | // Custom components 4 | import Card from "components/Card/Card.js"; 5 | import CardBody from "components/Card/CardBody.js"; 6 | import React from "react"; 7 | 8 | const CreditCard = ({ 9 | backgroundImage, 10 | title, 11 | icon, 12 | number, 13 | validity, 14 | cvv, 15 | }) => { 16 | return ( 17 | 25 | 26 | 32 | 33 | 34 | {title} 35 | 36 | {icon} 37 | 38 | 39 | 40 | 41 | 42 | {number} 43 | 44 | 45 | 46 | 47 | {validity.name} 48 | 49 | {validity.date} 50 | 51 | 52 | 53 | {cvv.name} 54 | 55 | {cvv.code} 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | ); 64 | }; 65 | 66 | export default CreditCard; 67 | -------------------------------------------------------------------------------- /react-ui/src/assets/svg/logo-white.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /api-server-django/api/authentication/serializers/login.py: -------------------------------------------------------------------------------- 1 | import jwt 2 | from rest_framework import serializers, exceptions 3 | from django.contrib.auth import authenticate 4 | from datetime import datetime, timedelta 5 | from django.conf import settings 6 | from django.core.exceptions import ObjectDoesNotExist 7 | 8 | from api.authentication.models import ActiveSession 9 | 10 | 11 | def _generate_jwt_token(user): 12 | token = jwt.encode( 13 | {"id": user.pk, "exp": datetime.utcnow() + timedelta(days=7)}, 14 | settings.SECRET_KEY, 15 | ) 16 | 17 | return token 18 | 19 | 20 | class LoginSerializer(serializers.Serializer): 21 | email = serializers.CharField(max_length=255) 22 | username = serializers.CharField(max_length=255, read_only=True) 23 | password = serializers.CharField(max_length=128, write_only=True) 24 | 25 | def validate(self, data): 26 | email = data.get("email", None) 27 | password = data.get("password", None) 28 | 29 | if email is None: 30 | raise exceptions.ValidationError( 31 | {"success": False, "msg": "Email is required to login"} 32 | ) 33 | if password is None: 34 | raise exceptions.ValidationError( 35 | {"success": False, "msg": "Password is required to log in."} 36 | ) 37 | user = authenticate(username=email, password=password) 38 | 39 | if user is None: 40 | raise exceptions.AuthenticationFailed({"success": False, "msg": "Wrong credentials"}) 41 | 42 | if not user.is_active: 43 | raise exceptions.ValidationError( 44 | {"success": False, "msg": "User is not active"} 45 | ) 46 | 47 | try: 48 | session = ActiveSession.objects.get(user=user) 49 | if not session.token: 50 | raise ValueError 51 | 52 | jwt.decode(session.token, settings.SECRET_KEY, algorithms=["HS256"]) 53 | 54 | except (ObjectDoesNotExist, ValueError, jwt.ExpiredSignatureError): 55 | session = ActiveSession.objects.create( 56 | user=user, token=_generate_jwt_token(user) 57 | ) 58 | 59 | return { 60 | "success": True, 61 | "token": session.token, 62 | "user": {"_id": user.pk, "username": user.username, "email": user.email}, 63 | } 64 | -------------------------------------------------------------------------------- /react-ui/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "purity-dashboard-react", 3 | "version": "2.0.2", 4 | "private": true, 5 | "dependencies": { 6 | "@chakra-ui/icons": "^1.1.5", 7 | "@chakra-ui/react": "1.8.8", 8 | "@chakra-ui/system": "^1.12.1", 9 | "@chakra-ui/theme-tools": "^1.3.6", 10 | "@emotion/cache": "^11.7.1", 11 | "@emotion/react": "^11.8.1", 12 | "@emotion/styled": "^11.8.1", 13 | "@fontsource/open-sans": "^4.5.0", 14 | "@fontsource/raleway": "^4.5.0", 15 | "@fontsource/roboto": "^4.5.8", 16 | "apexcharts": "^3.27.3", 17 | "axios": "^1.2.0", 18 | "classnames": "2.3.1", 19 | "framer-motion": "^4.1.17", 20 | "match-sorter": "6.3.0", 21 | "moment": "2.29.1", 22 | "node-sass": "7.0.1", 23 | "nouislider": "15.0.0", 24 | "react": "16.14.0", 25 | "react-apexcharts": "^1.3.9", 26 | "react-big-calendar": "0.33.2", 27 | "react-bootstrap-sweetalert": "^5.2.0", 28 | "react-datetime": "3.1.1", 29 | "react-dom": "16.14.0", 30 | "react-github-btn": "^1.2.1", 31 | "react-icons": "^4.2.0", 32 | "react-jvectormap": "0.0.16", 33 | "react-router-dom": "5.2.1", 34 | "react-scripts": "5.0.0", 35 | "react-swipeable-views": "0.14.0", 36 | "react-table": "7.7.0", 37 | "react-tagsinput": "3.19.0", 38 | "stylis": "^4.0.13", 39 | "stylis-plugin-rtl": "^2.1.1" 40 | }, 41 | "resolutions": { 42 | "react-error-overlay": "6.0.11" 43 | }, 44 | "scripts": { 45 | "start": "react-scripts start", 46 | "build": "react-scripts build && gulp licenses", 47 | "test": "react-scripts test --env=jsdom", 48 | "eject": "react-scripts eject", 49 | "deploy": "npm run build", 50 | "lint:check": "eslint . --ext=js,jsx; exit 0", 51 | "lint:fix": "eslint . --ext=js,jsx --fix; exit 0", 52 | "install:clean": "rm -rf node_modules/ && rm -rf package-lock.json && npm install && npm start" 53 | }, 54 | "optionalDependencies": { 55 | "@babel/core": "7.14.0", 56 | "typescript": "4.2.4" 57 | }, 58 | "devDependencies": { 59 | "@babel/plugin-transform-react-jsx-source": "^7.14.5", 60 | "eslint-config-prettier": "8.3.0", 61 | "eslint-plugin-prettier": "3.4.0", 62 | "gulp": "4.0.2", 63 | "gulp-append-prepend": "1.0.9", 64 | "prettier": "2.2.1" 65 | }, 66 | "browserslist": { 67 | "production": [ 68 | "cover 99.8%", 69 | "not dead", 70 | "not OperaMini all" 71 | ], 72 | "development": [ 73 | "cover 99.8%", 74 | "not dead", 75 | "not OperaMini all" 76 | ] 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /react-ui/src/components/Tables/TablesTableRow.js: -------------------------------------------------------------------------------- 1 | import { 2 | Avatar, 3 | Badge, 4 | Button, 5 | Flex, 6 | Td, 7 | Text, 8 | Tr, 9 | useColorModeValue, 10 | } from "@chakra-ui/react"; 11 | import React from "react"; 12 | 13 | function TablesTableRow(props) { 14 | const { logo, name, email, subdomain, domain, status, date } = props; 15 | const textColor = useColorModeValue("gray.700", "white"); 16 | const bgStatus = useColorModeValue("gray.400", "#1a202c"); 17 | const colorStatus = useColorModeValue("white", "gray.400"); 18 | 19 | return ( 20 | 21 | 22 | 23 | 24 | 25 | 31 | {name} 32 | 33 | 34 | {email} 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | {domain} 44 | 45 | 46 | {subdomain} 47 | 48 | 49 | 50 | 51 | 58 | {status} 59 | 60 | 61 | 62 | 63 | {date} 64 | 65 | 66 | 67 | 77 | 78 | 79 | ); 80 | } 81 | 82 | export default TablesTableRow; 83 | -------------------------------------------------------------------------------- /react-ui/src/views/Dashboard/Dashboard/components/Projects.js: -------------------------------------------------------------------------------- 1 | // Chakra imports 2 | import { 3 | Flex, 4 | Icon, 5 | Table, 6 | Tbody, 7 | Text, 8 | Th, 9 | Thead, 10 | Tr, 11 | useColorModeValue, 12 | } from "@chakra-ui/react"; 13 | // Custom components 14 | import Card from "components/Card/Card.js"; 15 | import CardHeader from "components/Card/CardHeader.js"; 16 | import DashboardTableRow from "components/Tables/DashboardTableRow"; 17 | import React from "react"; 18 | import { IoCheckmarkDoneCircleSharp } from "react-icons/io5"; 19 | 20 | const Projects = ({ title, amount, captions, data }) => { 21 | const textColor = useColorModeValue("gray.700", "white"); 22 | 23 | return ( 24 | 25 | 26 | 27 | 28 | {title} 29 | 30 | 31 | 38 | 39 | 40 | {amount} done 41 | {" "} 42 | this month. 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | {captions.map((caption, idx) => { 51 | return ( 52 | 55 | ); 56 | })} 57 | 58 | 59 | 60 | {data.map((row) => { 61 | return ( 62 | 70 | ); 71 | })} 72 | 73 |
53 | {caption} 54 |
74 |
75 | ); 76 | }; 77 | 78 | export default Projects; 79 | -------------------------------------------------------------------------------- /react-ui/src/routes.js: -------------------------------------------------------------------------------- 1 | // import 2 | import Dashboard from "views/Dashboard/Dashboard"; 3 | import Tables from "views/Dashboard/Tables"; 4 | import Billing from "views/Dashboard/Billing"; 5 | import RTLPage from "views/Dashboard/RTL"; 6 | import Profile from "views/Dashboard/Profile"; 7 | import SignIn from "views/Auth/SignIn.js"; 8 | import SignUp from "views/Auth/SignUp.js"; 9 | 10 | import { 11 | HomeIcon, 12 | StatsIcon, 13 | CreditIcon, 14 | PersonIcon, 15 | DocumentIcon, 16 | RocketIcon, 17 | SupportIcon, 18 | } from "components/Icons/Icons"; 19 | 20 | var dashRoutes = [ 21 | { 22 | path: "/dashboard", 23 | name: "Dashboard", 24 | rtlName: "لوحة القيادة", 25 | icon: , 26 | component: Dashboard, 27 | layout: "/admin", 28 | protected: true, 29 | }, 30 | { 31 | path: "/tables", 32 | name: "Tables", 33 | rtlName: "لوحة القيادة", 34 | icon: , 35 | component: Tables, 36 | layout: "/admin", 37 | protected: true, 38 | }, 39 | { 40 | path: "/billing", 41 | name: "Billing", 42 | rtlName: "لوحة القيادة", 43 | icon: , 44 | component: Billing, 45 | layout: "/admin", 46 | protected: true, 47 | }, 48 | { 49 | path: "/rtl-support-page", 50 | name: "RTL", 51 | rtlName: "آرتيإل", 52 | icon: , 53 | component: RTLPage, 54 | layout: "/rtl", 55 | }, 56 | { 57 | name: "ACCOUNT PAGES", 58 | category: "account", 59 | rtlName: "صفحات", 60 | state: "pageCollapse", 61 | views: [ 62 | { 63 | path: "/profile", 64 | name: "Profile", 65 | rtlName: "لوحة القيادة", 66 | icon: , 67 | secondaryNavbar: true, 68 | component: Profile, 69 | layout: "/admin", 70 | protected: true, 71 | }, 72 | { 73 | path: "/signin", 74 | name: "Sign In", 75 | rtlName: "لوحة القيادة", 76 | icon: , 77 | component: SignIn, 78 | layout: "/auth", 79 | }, 80 | { 81 | path: "/signup", 82 | name: "Sign Up", 83 | rtlName: "لوحة القيادة", 84 | icon: , 85 | secondaryNavbar: true, 86 | component: SignUp, 87 | layout: "/auth", 88 | }, 89 | ], 90 | }, 91 | ]; 92 | export default dashRoutes; 93 | -------------------------------------------------------------------------------- /api-server-django/api/authentication/tests.py: -------------------------------------------------------------------------------- 1 | from django.urls import reverse 2 | from rest_framework.test import APITestCase 3 | from rest_framework import status 4 | 5 | 6 | class AuthenticationTest(APITestCase): 7 | base_url_register = reverse("api:register-list") 8 | base_url_login = reverse("api:login-list") 9 | base_url_logout = reverse("api:logout-list") 10 | base_url_check_session = reverse("api:check-session-list") 11 | 12 | data_register = {"username": "test", "password": "pass", "email": "test@appseed.us"} 13 | 14 | data_login = {"password": "12345678", "email": "teast@admin.com"} 15 | 16 | def test_register(self): 17 | response = self.client.post( 18 | f"{self.base_url_register}", data=self.data_register 19 | ) 20 | self.assertEqual(response.status_code, status.HTTP_201_CREATED) 21 | response_data = response.json() 22 | self.assertEqual(response_data["success"], True) 23 | 24 | def test_login(self): 25 | response = self.client.post(f"{self.base_url_login}", data=self.data_login) 26 | self.assertEqual(response.status_code, status.HTTP_200_OK) 27 | response_data = response.json() 28 | self.assertEqual(response_data["success"], True) 29 | 30 | def test_logout(self): 31 | # Login to retrieve token 32 | 33 | response = self.client.post(f"{self.base_url_login}", data=self.data_login) 34 | response_data = response.json() 35 | 36 | token = response_data["token"] 37 | 38 | self.client.credentials(HTTP_AUTHORIZATION=token) 39 | 40 | # Logout 41 | 42 | response = self.client.post(f"{self.base_url_logout}", data={"token": token}) 43 | self.assertEqual(response.status_code, status.HTTP_200_OK) 44 | response_data = response.json() 45 | self.assertEqual(response_data["success"], True) 46 | 47 | def test_check_session(self): 48 | # Login to retrieve token 49 | 50 | response = self.client.post(f"{self.base_url_login}", data=self.data_login) 51 | response_data = response.json() 52 | 53 | token = response_data["token"] 54 | 55 | self.client.credentials(HTTP_AUTHORIZATION=token) 56 | 57 | # Check session 58 | response = self.client.post(f"{self.base_url_check_session}") 59 | self.assertEqual(response.status_code, status.HTTP_200_OK) 60 | 61 | response_data = response.json() 62 | self.assertEqual(response_data["success"], True) 63 | -------------------------------------------------------------------------------- /api-server-django/.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | build/ 12 | develop-eggs/ 13 | dist/ 14 | downloads/ 15 | eggs/ 16 | .eggs/ 17 | lib/ 18 | lib64/ 19 | parts/ 20 | sdist/ 21 | var/ 22 | wheels/ 23 | pip-wheel-metadata/ 24 | share/python-wheels/ 25 | *.egg-info/ 26 | .installed.cfg 27 | *.egg 28 | MANIFEST 29 | 30 | # PyInstaller 31 | # Usually these files are written by a python script from a template 32 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 33 | *.manifest 34 | *.spec 35 | 36 | # Installer logs 37 | pip-log.txt 38 | pip-delete-this-directory.txt 39 | 40 | # Unit test / coverage reports 41 | htmlcov/ 42 | .tox/ 43 | .nox/ 44 | .coverage 45 | .coverage.* 46 | .cache 47 | nosetests.xml 48 | coverage.xml 49 | *.cover 50 | *.py,cover 51 | .hypothesis/ 52 | .pytest_cache/ 53 | 54 | # Translations 55 | *.mo 56 | *.pot 57 | 58 | # Django stuff: 59 | *.log 60 | local_settings.py 61 | db.sqlite3 62 | db.sqlite3-journal 63 | 64 | # Flask stuff: 65 | instance/ 66 | .webassets-cache 67 | 68 | # Scrapy stuff: 69 | .scrapy 70 | 71 | # Sphinx documentation 72 | docs/_build/ 73 | 74 | # PyBuilder 75 | target/ 76 | 77 | # Jupyter Notebook 78 | .ipynb_checkpoints 79 | 80 | # IPython 81 | profile_default/ 82 | ipython_config.py 83 | 84 | # pyenv 85 | .python-version 86 | 87 | # pipenv 88 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. 89 | # However, in case of collaboration, if having platform-specific dependencies or dependencies 90 | # having no cross-platform support, pipenv may install dependencies that don't work, or not 91 | # install all needed dependencies. 92 | #Pipfile.lock 93 | 94 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow 95 | __pypackages__/ 96 | 97 | # Celery stuff 98 | celerybeat-schedule 99 | celerybeat.pid 100 | 101 | # SageMath parsed files 102 | *.sage.py 103 | 104 | # Environments 105 | .env 106 | .venv 107 | env/ 108 | venv/ 109 | ENV/ 110 | env.bak/ 111 | venv.bak/ 112 | 113 | # Spyder project settings 114 | .spyderproject 115 | .spyproject 116 | 117 | # Rope project settings 118 | .ropeproject 119 | 120 | # mkdocs documentation 121 | /site 122 | 123 | # mypy 124 | .mypy_cache/ 125 | .dmypy.json 126 | dmypy.json 127 | 128 | # Pyre type checker 129 | .pyre/ 130 | .env__ 131 | -------------------------------------------------------------------------------- /react-ui/src/views/Dashboard/Dashboard/components/ActiveUsers.js: -------------------------------------------------------------------------------- 1 | // Chakra imports 2 | import { Flex, SimpleGrid, Text, useColorModeValue } from "@chakra-ui/react"; 3 | // Custom components 4 | import Card from "components/Card/Card.js"; 5 | import CardBody from "components/Card/CardBody.js"; 6 | // Custom icons 7 | import { 8 | CartIcon, 9 | RocketIcon, 10 | StatsIcon, 11 | WalletIcon, 12 | } from "components/Icons/Icons.js"; 13 | import React from "react"; 14 | import ChartStatistics from "./ChartStatistics"; 15 | 16 | const ActiveUsers = ({ title, percentage, chart }) => { 17 | const iconBoxInside = useColorModeValue("white", "white"); 18 | const textColor = useColorModeValue("gray.700", "white"); 19 | return ( 20 | 21 | 22 | 23 | {chart} 24 | 25 | 26 | {title} 27 | 28 | 29 | 0 ? "green.400" : "red.400"} 32 | fontWeight='bold'> 33 | {percentage > 0 ? `+${percentage}%` : `-${percentage}%`} 34 | {" "} 35 | than last week 36 | 37 | 38 | 39 | } 44 | /> 45 | } 50 | /> 51 | } 56 | /> 57 | } 62 | /> 63 | 64 | 65 | 66 | 67 | ); 68 | }; 69 | 70 | export default ActiveUsers; 71 | -------------------------------------------------------------------------------- /react-ui/src/components/Tables/BillingRow.js: -------------------------------------------------------------------------------- 1 | import { 2 | Box, 3 | Button, 4 | Flex, 5 | Icon, 6 | Text, 7 | useColorModeValue, 8 | } from "@chakra-ui/react"; 9 | import React from "react"; 10 | import { FaPencilAlt, FaTrashAlt } from "react-icons/fa"; 11 | 12 | function BillingRow(props) { 13 | const textColor = useColorModeValue("gray.700", "white"); 14 | const bgColor = useColorModeValue("#F8F9FA", "gray.800"); 15 | const nameColor = useColorModeValue("gray.500", "white"); 16 | const { name, company, email, number } = props; 17 | 18 | return ( 19 | 20 | 21 | 22 | 23 | {name} 24 | 25 | 26 | Company Name:{" "} 27 | 28 | {company} 29 | 30 | 31 | 32 | Email Address:{" "} 33 | 34 | {email} 35 | 36 | 37 | 38 | VAT Number:{" "} 39 | 40 | {number} 41 | 42 | 43 | 44 | 49 | 62 | 70 | 71 | 72 | 73 | ); 74 | } 75 | 76 | export default BillingRow; 77 | -------------------------------------------------------------------------------- /react-ui/src/views/Dashboard/Profile/index.js: -------------------------------------------------------------------------------- 1 | // Chakra imports 2 | import { Flex, Grid, useColorModeValue } from "@chakra-ui/react"; 3 | import avatar4 from "assets/img/avatars/avatar4.png"; 4 | import ProfileBgImage from "assets/img/ProfileBackground.png"; 5 | import React from "react"; 6 | import { FaCube, FaPenFancy } from "react-icons/fa"; 7 | import { IoDocumentsSharp } from "react-icons/io5"; 8 | import Conversations from "./components/Conversations"; 9 | import Header from "./components/Header"; 10 | import PlatformSettings from "./components/PlatformSettings"; 11 | import ProfileInformation from "./components/ProfileInformation"; 12 | import Projects from "./components/Projects"; 13 | 14 | function Profile() { 15 | // Chakra color mode 16 | const textColor = useColorModeValue("gray.700", "white"); 17 | const bgProfile = useColorModeValue( 18 | "hsla(0,0%,100%,.8)", 19 | "linear-gradient(112.83deg, rgba(255, 255, 255, 0.21) 0%, rgba(255, 255, 255, 0) 110.84%)" 20 | ); 21 | 22 | return ( 23 | 24 |
, 34 | }, 35 | { 36 | name: "TEAMS", 37 | icon: , 38 | }, 39 | { 40 | name: "PROJECTS", 41 | icon: , 42 | }, 43 | ]} 44 | /> 45 | 46 | 51 | 61 | 62 | 63 | 64 | 65 | ); 66 | } 67 | 68 | export default Profile; 69 | -------------------------------------------------------------------------------- /react-ui/src/views/Dashboard/Dashboard/components/WorkWithTheRockets.js: -------------------------------------------------------------------------------- 1 | // Chakra imports 2 | import { 3 | Box, 4 | Button, 5 | Flex, 6 | Icon, 7 | Portal, 8 | Spacer, 9 | Text, 10 | } from "@chakra-ui/react"; 11 | // Custom components 12 | import Card from "components/Card/Card.js"; 13 | import CardBody from "components/Card/CardBody.js"; 14 | import React from "react"; 15 | // react icons 16 | import { BsArrowRight } from "react-icons/bs"; 17 | 18 | const WorkWithTheRockets = ({ title, description, backgroundImage }) => { 19 | const overlayRef = React.useRef(); 20 | return ( 21 | 22 | 32 | 39 | 40 | 45 | 46 | {title} 47 | 48 | 49 | {description} 50 | 51 | 52 | 53 | 73 | 74 | 75 | 76 | 77 | 78 | ); 79 | }; 80 | 81 | export default WorkWithTheRockets; 82 | -------------------------------------------------------------------------------- /react-ui/src/views/Dashboard/Dashboard/components/BuiltByDevelopers.js: -------------------------------------------------------------------------------- 1 | // Chakra imports 2 | import { 3 | Button, 4 | Flex, 5 | Icon, 6 | Spacer, 7 | Text, 8 | useColorModeValue, 9 | } from "@chakra-ui/react"; 10 | // Custom components 11 | import Card from "components/Card/Card.js"; 12 | import CardBody from "components/Card/CardBody.js"; 13 | import React from "react"; 14 | // react icons 15 | import { BsArrowRight } from "react-icons/bs"; 16 | 17 | const BuiltByDevelopers = ({ title, name, description, image }) => { 18 | const textColor = useColorModeValue("gray.700", "white"); 19 | 20 | return ( 21 | 22 | 23 | 24 | 29 | 30 | {title} 31 | 32 | 33 | {name} 34 | 35 | 36 | {description} 37 | 38 | 39 | 40 | 67 | 68 | 69 | 70 | 77 | {image} 78 | 79 | 80 | 81 | 82 | ); 83 | }; 84 | 85 | export default BuiltByDevelopers; 86 | -------------------------------------------------------------------------------- /react-ui/src/views/Dashboard/Profile/components/PlatformSettings.js: -------------------------------------------------------------------------------- 1 | // Chakra imports 2 | import { Flex, Switch, Text, useColorModeValue } from "@chakra-ui/react"; 3 | // Custom components 4 | import Card from "components/Card/Card"; 5 | import CardBody from "components/Card/CardBody"; 6 | import CardHeader from "components/Card/CardHeader"; 7 | import React from "react"; 8 | 9 | const PlatformSettings = ({ title, subtitle1, subtitle2 }) => { 10 | // Chakra color mode 11 | const textColor = useColorModeValue("gray.700", "white"); 12 | return ( 13 | 14 | 15 | 16 | {title} 17 | 18 | 19 | 20 | 21 | 22 | {subtitle1} 23 | 24 | 25 | 26 | 27 | Email me when someone follows me 28 | 29 | 30 | 31 | 32 | 33 | Email me when someone answers on my post 34 | 35 | 36 | 37 | 38 | 39 | Email me when someone mentions me 40 | 41 | 42 | 47 | {subtitle2} 48 | 49 | 50 | 51 | 52 | New launches and projects 53 | 54 | 55 | 56 | 57 | 58 | Monthly product changes 59 | 60 | 61 | 62 | 63 | 64 | Subscribe to newsletter 65 | 66 | 67 | 68 | 69 | 70 | ); 71 | }; 72 | 73 | export default PlatformSettings; 74 | -------------------------------------------------------------------------------- /react-ui/src/views/Dashboard/Billing/components/Transactions.js: -------------------------------------------------------------------------------- 1 | // Chakra imports 2 | import { Flex, Icon, Text, useColorModeValue } from "@chakra-ui/react"; 3 | // Custom components 4 | import Card from "components/Card/Card.js"; 5 | import CardBody from "components/Card/CardBody.js"; 6 | import CardHeader from "components/Card/CardHeader.js"; 7 | import TransactionRow from "components/Tables/TransactionRow"; 8 | import React from "react"; 9 | import { FaRegCalendarAlt } from "react-icons/fa"; 10 | 11 | const Transactions = ({ 12 | title, 13 | date, 14 | newestTransactions, 15 | olderTransactions, 16 | }) => { 17 | // Chakra color mode 18 | const textColor = useColorModeValue("gray.700", "white"); 19 | 20 | return ( 21 | 22 | 23 | 24 | 30 | 34 | {title} 35 | 36 | 37 | 42 | 43 | {date} 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 56 | NEWEST 57 | 58 | {newestTransactions.map((row) => { 59 | return ( 60 | 66 | ); 67 | })} 68 | 73 | OLDER 74 | 75 | {olderTransactions.map((row) => { 76 | return ( 77 | 83 | ); 84 | })} 85 | 86 | 87 | 88 | ); 89 | }; 90 | 91 | export default Transactions; 92 | -------------------------------------------------------------------------------- /api-server-django/api/user/migrations/0001_initial.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.2.5 on 2021-07-15 11:20 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | initial = True 9 | 10 | dependencies = [ 11 | ("auth", "0012_alter_user_first_name_max_length"), 12 | ] 13 | 14 | operations = [ 15 | migrations.CreateModel( 16 | name="User", 17 | fields=[ 18 | ( 19 | "id", 20 | models.BigAutoField( 21 | auto_created=True, 22 | primary_key=True, 23 | serialize=False, 24 | verbose_name="ID", 25 | ), 26 | ), 27 | ("password", models.CharField(max_length=128, verbose_name="password")), 28 | ( 29 | "last_login", 30 | models.DateTimeField( 31 | blank=True, null=True, verbose_name="last login" 32 | ), 33 | ), 34 | ( 35 | "is_superuser", 36 | models.BooleanField( 37 | default=False, 38 | help_text="Designates that this user has all permissions without explicitly assigning them.", 39 | verbose_name="superuser status", 40 | ), 41 | ), 42 | ("username", models.CharField(db_index=True, max_length=255)), 43 | ( 44 | "email", 45 | models.EmailField(db_index=True, max_length=254, unique=True), 46 | ), 47 | ("is_active", models.BooleanField(default=True)), 48 | ("date", models.DateTimeField(auto_now_add=True)), 49 | ( 50 | "groups", 51 | models.ManyToManyField( 52 | blank=True, 53 | help_text="The groups this user belongs to. A user will get all permissions granted to each of their groups.", 54 | related_name="user_set", 55 | related_query_name="user", 56 | to="auth.Group", 57 | verbose_name="groups", 58 | ), 59 | ), 60 | ( 61 | "user_permissions", 62 | models.ManyToManyField( 63 | blank=True, 64 | help_text="Specific permissions for this user.", 65 | related_name="user_set", 66 | related_query_name="user", 67 | to="auth.Permission", 68 | verbose_name="user permissions", 69 | ), 70 | ), 71 | ], 72 | options={ 73 | "abstract": False, 74 | }, 75 | ), 76 | ] 77 | -------------------------------------------------------------------------------- /react-ui/src/components/Footer/Footer.js: -------------------------------------------------------------------------------- 1 | /*eslint-disable*/ 2 | import React from "react"; 3 | import { Flex, Link, List, ListItem, Text } from "@chakra-ui/react"; 4 | import PropTypes from "prop-types"; 5 | 6 | export default function Footer(props) { 7 | // const linkTeal = useColorModeValue("teal.400", "red.200");= 8 | return ( 9 | 22 | 30 | © 31 | 37 | {document.documentElement.dir === "rtl" 38 | ? " توقيت الإبداعية" 39 | : "Creative Tim "} 40 | 41 | & 42 | 48 | {document.documentElement.dir === "rtl" ? "سيممبل " : " Simmmple"} 49 | 50 | {document.documentElement.dir === "rtl" 51 | ? "للحصول على ويب أفضل" 52 | : " for a better web"} 53 | 54 | 55 | 61 | 62 | {document.documentElement.dir === "rtl" 63 | ? "توقيت الإبداعية" 64 | : "Creative Tim"} 65 | 66 | 67 | 73 | 74 | {document.documentElement.dir === "rtl" ? "سيممبل" : "Simmmple"} 75 | 76 | 77 | 83 | 88 | {document.documentElement.dir === "rtl" ? "مدونة" : "Blog"} 89 | 90 | 91 | 92 | 97 | {document.documentElement.dir === "rtl" ? "رخصة" : "License"} 98 | 99 | 100 | 101 | 102 | ); 103 | } 104 | -------------------------------------------------------------------------------- /react-ui/gulpfile.js: -------------------------------------------------------------------------------- 1 | const gulp = require("gulp"); 2 | const gap = require("gulp-append-prepend"); 3 | 4 | gulp.task("licenses", async function () { 5 | // this is to add Creative Tim licenses in the production mode for the minified js 6 | gulp 7 | .src("build/static/js/*chunk.js", { base: "./" }) 8 | .pipe( 9 | gap.prependText(`/*! 10 | 11 | ========================================================= 12 | * Purity UI Dashboard - v1.0.1 13 | ========================================================= 14 | 15 | * Product Page: https://www.creative-tim.com/product/purity-ui-dashboard 16 | * Copyright 2021 Creative Tim (https://www.creative-tim.com) 17 | * Licensed under MIT (https://github.com/creativetimofficial/purity-ui-dashboard/blob/master/LICENSE.md) 18 | 19 | * Design by Creative Tim & Coded by Simmmple 20 | 21 | ========================================================= 22 | 23 | * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 24 | 25 | */`) 26 | ) 27 | .pipe(gulp.dest("./", { overwrite: true })); 28 | 29 | // this is to add Creative Tim licenses in the production mode for the minified html 30 | gulp 31 | .src("build/index.html", { base: "./" }) 32 | .pipe( 33 | gap.prependText(``) 52 | ) 53 | .pipe(gulp.dest("./", { overwrite: true })); 54 | 55 | // this is to add Creative Tim licenses in the production mode for the minified css 56 | gulp 57 | .src("build/static/css/*chunk.css", { base: "./" }) 58 | .pipe( 59 | gap.prependText(`/*! 60 | 61 | ========================================================= 62 | * Purity UI Dashboard - v1.0.1 63 | ========================================================= 64 | 65 | * Product Page: https://www.creative-tim.com/product/purity-ui-dashboard 66 | * Copyright 2021 Creative Tim (https://www.creative-tim.com) 67 | * Licensed under MIT (https://github.com/creativetimofficial/purity-ui-dashboard/blob/master/LICENSE.md) 68 | 69 | * Design by Creative Tim & Coded by Simmmple 70 | 71 | ========================================================= 72 | 73 | * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 74 | 75 | */`) 76 | ) 77 | .pipe(gulp.dest("./", { overwrite: true })); 78 | return; 79 | }); 80 | -------------------------------------------------------------------------------- /react-ui/src/layouts/Auth.js: -------------------------------------------------------------------------------- 1 | // chakra imports 2 | import { Box, ChakraProvider, Portal } from '@chakra-ui/react'; 3 | import Footer from 'components/Footer/Footer.js'; 4 | // core components 5 | import AuthNavbar from 'components/Navbars/AuthNavbar.js'; 6 | import React from 'react'; 7 | import { Redirect, Route, Switch } from 'react-router-dom'; 8 | import routes from 'routes.js'; 9 | import '@fontsource/roboto/400.css'; 10 | import '@fontsource/roboto/500.css'; 11 | import '@fontsource/roboto/700.css'; 12 | import theme from 'theme/theme.js'; 13 | 14 | export default function Pages(props) { 15 | const { ...rest } = props; 16 | // ref for the wrapper div 17 | const wrapper = React.createRef(); 18 | React.useEffect(() => { 19 | document.body.style.overflow = 'unset'; 20 | // Specify how to clean up after this effect: 21 | return function cleanup() {}; 22 | }); 23 | const getActiveRoute = (routes) => { 24 | let activeRoute = 'Default Brand Text'; 25 | for (let i = 0; i < routes.length; i++) { 26 | if (routes[i].collapse) { 27 | let collapseActiveRoute = getActiveRoute(routes[i].views); 28 | if (collapseActiveRoute !== activeRoute) { 29 | return collapseActiveRoute; 30 | } 31 | } else if (routes[i].category) { 32 | let categoryActiveRoute = getActiveRoute(routes[i].views); 33 | if (categoryActiveRoute !== activeRoute) { 34 | return categoryActiveRoute; 35 | } 36 | } else { 37 | if (window.location.href.indexOf(routes[i].layout + routes[i].path) !== -1) { 38 | return routes[i].name; 39 | } 40 | } 41 | } 42 | return activeRoute; 43 | }; 44 | const getActiveNavbar = (routes) => { 45 | let activeNavbar = false; 46 | for (let i = 0; i < routes.length; i++) { 47 | if (routes[i].category) { 48 | let categoryActiveNavbar = getActiveNavbar(routes[i].views); 49 | if (categoryActiveNavbar !== activeNavbar) { 50 | return categoryActiveNavbar; 51 | } 52 | } else { 53 | if (window.location.href.indexOf(routes[i].layout + routes[i].path) !== -1) { 54 | if (routes[i].secondaryNavbar) { 55 | return routes[i].secondaryNavbar; 56 | } 57 | } 58 | } 59 | } 60 | return activeNavbar; 61 | }; 62 | const getRoutes = (routes) => { 63 | return routes.map((prop, key) => { 64 | if (prop.collapse) { 65 | return getRoutes(prop.views); 66 | } 67 | if (prop.category === 'account') { 68 | return getRoutes(prop.views); 69 | } 70 | if (prop.layout === '/auth') { 71 | return ; 72 | } else { 73 | return null; 74 | } 75 | }); 76 | }; 77 | const navRef = React.useRef(); 78 | document.documentElement.dir = 'ltr'; 79 | return ( 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | {getRoutes(routes)} 89 | 90 | 91 | 92 | 93 | 94 |