Loading...
;
+ }
+
+ if (error) {
+ console.log(error);
+ redirect("/")
+ }
+
+ return (
+ <>
+ Loading...
;
+ if (!userData) return
-
+ useEffect(() => {
+ const isDarkMode = document.documentElement.classList.contains("dark");
+ setDarkMode(isDarkMode);
+ }, []);
+
+ const toggleDarkMode = () => {
+ setDarkMode((prevDarkMode) => {
+ const newDarkMode = !prevDarkMode;
+ if (newDarkMode) {
+ document.documentElement.classList.add("dark");
+ localStorage.setItem("darkMode", "true");
+ } else {
+ document.documentElement.classList.remove("dark");
+ localStorage.setItem("darkMode", "false");
+ }
+
+ window.location.reload();
+ return newDarkMode;
+ });
+ };
+
+ return (
+
+
+
+ );
+};
-export { SideBar }
\ No newline at end of file
+export { SideBar };
diff --git a/src/components/ui/theme-provider.tsx b/src/components/ui/theme-provider.tsx
new file mode 100644
index 0000000..7ee3d9c
--- /dev/null
+++ b/src/components/ui/theme-provider.tsx
@@ -0,0 +1,35 @@
+"use client";
+import { Moon, Sun } from "lucide-react";
+import { useEffect, useState } from "react";
+
+export default function ThemeProvider({ children }: { children: React.ReactNode }) {
+ const [isDarkMode, setIsDarkMode] = useState(false);
+
+ useEffect(() => {
+ const mode = localStorage.getItem("darkMode");
+ if (mode === "true") {
+ document.documentElement.classList.add("dark");
+ setIsDarkMode(true);
+ } else {
+ document.documentElement.classList.remove("dark");
+ setIsDarkMode(false);
+ }
+ }, []);
+
+ const toggleDarkMode = () => {
+ const newDarkMode = !isDarkMode;
+ localStorage.setItem("darkMode", newDarkMode ? "true" : "false");
+ if (newDarkMode) {
+ document.documentElement.classList.add("dark");
+ } else {
+ document.documentElement.classList.remove("dark");
+ }
+ setIsDarkMode(newDarkMode);
+ };
+
+ return (
+ <>
+ {children}
+ >
+ );
+}
diff --git a/src/constants/index.jsx b/src/constants/index.jsx
new file mode 100644
index 0000000..780a2ca
--- /dev/null
+++ b/src/constants/index.jsx
@@ -0,0 +1,154 @@
+import { Lock } from "lucide-react";
+import { Scan } from "lucide-react";
+import { AreaChart } from "lucide-react";
+import { Bell } from "lucide-react";
+import { History } from "lucide-react";
+import { BarChart } from "lucide-react";
+
+export const navItems = [
+ { label: "Features", href: "#" },
+ { label: "Workflow", href: "#" },
+ { label: "Testimonials", href: "#" },
+];
+
+export const testimonials = [
+ {
+ user: "Markus Schmidt",
+ company: "TechGuard Inc.",
+ text: "Secure-CI has been integral in maintaining the security of our codebase. Their automated scanning and detailed reports help us identify and fix vulnerabilities swiftly.",
+ },
+ {
+ user: "Sophie Li",
+ company: "ByteSec Solutions",
+ text: "We've seen a significant improvement in our code security since implementing Secure-CI. Their tools make it easy to collaborate on security issues and ensure our projects stay protected.",
+ },
+ {
+ user: "Alexandra Lopez",
+ company: "CyberDefend Labs",
+ text: "Secure-CI's commitment to security is exceptional. Their continuous monitoring and real-time alerts have been invaluable in safeguarding our applications against threats.",
+ },
+ {
+ user: "Chris Taylor",
+ company: "CodeShield Technologies",
+ text: "Choosing Secure-CI was one of the best decisions we made for our development team. Their comprehensive security checks and historical tracking keep us proactive in managing vulnerabilities.",
+ },
+ ];
+
+export const features = [
+ {
+ icon:
,
+ text: "Automated Code Scanning",
+ description:
+ "Ensure your code is free from vulnerabilities with automated scans on every push.",
+ },
+ {
+ icon:
,
+ text: "Comprehensive Reports",
+ description:
+ "Receive detailed reports on detected issues, helping you understand and fix vulnerabilities quickly.",
+ },
+ {
+ icon:
,
+ text: "Real-Time Alerts",
+ description:
+ "Get instant notifications about security issues in your code directly in your workflow.",
+ },
+ {
+ icon:
,
+ text: "Secure Authentication",
+ description:
+ "Connect securely to GitHub with OAuth, ensuring your repositories are protected.",
+ },
+ {
+ icon:
,
+ text: "Security History Tracking",
+ description:
+ "Keep a detailed record of past security issues and their resolutions to track progress and maintain accountability.",
+ },
+ {
+ icon:
,
+ text: "Analytics Dashboard",
+ description:
+ "Track and monitor your project's security status over time with an integrated analytics dashboard.",
+ },
+ ];
+
+export const checklistItems = [
+ {
+ title: "Effortless Code Merging",
+ description:
+ "Easily merge code changes with built-in checks to ensure security and quality.",
+ },
+ {
+ title: "Worry-Free Code Reviews",
+ description:
+ "Review code confidently knowing that potential vulnerabilities are flagged for you.",
+ },
+ {
+ title: "Consistent Security Checks",
+ description:
+ "Perform regular security checks to identify and fix vulnerabilities promptly.",
+ },
+ {
+ title: "Quick Sharing and Collaboration",
+ description:
+ "Share analysis reports and collaborate with your team in minutes.",
+ },
+];
+
+export const pricingOptions = [
+ {
+ title: "Free",
+ price: "$0",
+ features: [
+ "Private board sharing",
+ "5 Gb Storage",
+ "Web Analytics",
+ "Private Mode",
+ ],
+ },
+ {
+ title: "Pro",
+ price: "$10",
+ features: [
+ "Private board sharing",
+ "10 Gb Storage",
+ "Web Analytics (Advance)",
+ "Private Mode",
+ ],
+ },
+ {
+ title: "Enterprise",
+ price: "$200",
+ features: [
+ "Private board sharing",
+ "Unlimited Storage",
+ "High Performance Network",
+ "Private Mode",
+ ],
+ },
+];
+
+export const resourcesLinks = [
+ { href: "#", text: "Getting Started" },
+ { href: "#", text: "Documentation" },
+ { href: "#", text: "Tutorials" },
+ { href: "/api-doc", text: "API Documentation" },
+ { href: "#", text: "Community Forums" },
+];
+
+export const platformLinks = [
+ { href: "#", text: "Features" },
+ { href: "#", text: "Supported Devices" },
+ { href: "#", text: "System Requirements" },
+ { href: "#", text: "Downloads" },
+ { href: "#", text: "Release Notes" },
+];
+
+export const communityLinks = [
+ { href: "#", text: "Events" },
+ { href: "#", text: "Meetups" },
+ { href: "#", text: "Conferences" },
+ { href: "#", text: "Hackathons" },
+ { href: "#", text: "Jobs" },
+];
\ No newline at end of file
diff --git a/src/lib/swagger.ts b/src/lib/swagger.ts
new file mode 100644
index 0000000..4286b99
--- /dev/null
+++ b/src/lib/swagger.ts
@@ -0,0 +1,25 @@
+import { createSwaggerSpec } from "next-swagger-doc";
+
+export const getApiDocs = async () => {
+ const spec = createSwaggerSpec({
+ apiFolder: "src/app/api",
+ definition: {
+ openapi: "3.0.0",
+ info: {
+ title: "Next Swagger API Documentation for Secure CI",
+ version: "1.0",
+ },
+ components: {
+ securitySchemes: {
+ BearerAuth: {
+ type: "http",
+ scheme: "bearer",
+ bearerFormat: "JWT",
+ },
+ },
+ },
+ security: [],
+ },
+ });
+ return spec;
+};
\ No newline at end of file
diff --git a/src/middleware.ts b/src/middleware.ts
new file mode 100644
index 0000000..96e2f50
--- /dev/null
+++ b/src/middleware.ts
@@ -0,0 +1,25 @@
+import { NextRequest, NextResponse } from 'next/server';
+import { getServerSession } from 'next-auth';
+import { authOptions } from './app/api/auth/[...nextauth]/route';
+
+export async function middleware(req: NextRequest) {
+ try {
+
+ const session = true;//await getServerSession({ req, ...authOptions });
+
+ if (!session) {
+ return NextResponse.json({ message: 'Unauthorized' }, { status: 401 });
+ }
+
+ return NextResponse.next();
+ } catch (error) {
+
+ return NextResponse.json({ message: 'Internal Server Error' }, { status: 500 });
+ }
+}
+
+export const config = {
+ matcher: [
+ '/api/:path((?!auth).*)',
+ ],
+};
\ No newline at end of file
diff --git a/tailwind.config.ts b/tailwind.config.ts
index 84287e8..cec4214 100644
--- a/tailwind.config.ts
+++ b/tailwind.config.ts
@@ -24,6 +24,11 @@ const config = {
ring: "hsl(var(--ring))",
background: "hsl(var(--background))",
foreground: "hsl(var(--foreground))",
+ 'dark-background': 'rgba(25, 25, 25, 0.83)',
+ 'plan-background': 'rgba(255, 3, 41, 0.37)',
+ 'collab-background': 'rgba(3, 137, 255, 0.37)',
+ 'private-background': 'rgba(255, 3, 179, 0.28)',
+ 'followers-background': 'rgba(3, 255, 58, 0.24)',
primary: {
DEFAULT: "hsl(var(--primary))",
foreground: "hsl(var(--primary-foreground))",
diff --git a/tsconfig.json b/tsconfig.json
index 7b28589..90dd9e3 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -12,6 +12,7 @@
"isolatedModules": true,
"jsx": "preserve",
"incremental": true,
+ "typeRoots": ["./types", "./node_modules/@types"],
"plugins": [
{
"name": "next"
@@ -21,6 +22,6 @@
"@/*": ["./src/*"]
}
},
- "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
+ "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts", "src/app/docs/page.jsx", "components/Workflow.jsx", "components/ThemeContext.jsx", "src/app/api/auth/[...nextauth]/route.js", "src/constants/index.jsx", "src/components/charts/github-contributions.jsx", "src/components/charts/github-contributions.js"],
"exclude": ["node_modules"]
}
diff --git a/types/next-auth-d.ts b/types/next-auth-d.ts
new file mode 100644
index 0000000..fa42fa5
--- /dev/null
+++ b/types/next-auth-d.ts
@@ -0,0 +1,23 @@
+// types/next-auth.d.ts
+import NextAuth from "next-auth";
+import { JWT } from "next-auth/jwt";
+
+declare module "next-auth" {
+ interface Session {
+ accessToken: string;
+ user: {
+ id: string;
+ }
+ }
+
+ interface User {
+ id: string;
+ }
+}
+
+declare module "next-auth/jwt" {
+ interface JWT {
+ accessToken: string;
+ id: string;
+ }
+}