├── jest.setup.ts ├── .eslintrc.json ├── .husky └── pre-commit ├── src ├── app │ ├── favicon.ico │ ├── trend │ │ └── page.tsx │ ├── page.tsx │ ├── globals.css │ ├── api │ │ └── user │ │ │ ├── logout │ │ │ └── route.ts │ │ │ ├── giveBlogs │ │ │ └── route.ts │ │ │ ├── getBlogs │ │ │ └── route.ts │ │ │ ├── getlikes │ │ │ └── route.ts │ │ │ ├── getComments │ │ │ └── route.ts │ │ │ ├── postComment │ │ │ └── route.ts │ │ │ ├── getBio │ │ │ └── route.ts │ │ │ ├── verifyEmail │ │ │ ├── route.ts │ │ │ └── [email] │ │ │ │ └── route.ts │ │ │ ├── contact │ │ │ └── route.ts │ │ │ ├── blog │ │ │ └── route.ts │ │ │ ├── profile │ │ │ └── route.ts │ │ │ ├── postlike │ │ │ └── route.ts │ │ │ ├── report │ │ │ └── route.ts │ │ │ ├── Bio │ │ │ └── route.ts │ │ │ ├── signin │ │ │ └── route.ts │ │ │ ├── forgetpassword │ │ │ └── route.ts │ │ │ ├── email │ │ │ └── route.ts │ │ │ └── login │ │ │ └── route.ts │ ├── page.test.tsx │ ├── layout.tsx │ ├── forgetPassword │ │ └── page.tsx │ ├── Blogs │ │ └── [...slug] │ │ │ └── page.tsx │ ├── bio │ │ └── page.tsx │ ├── signup │ │ └── page.tsx │ ├── login │ │ └── page.tsx │ ├── addBlog │ │ └── page.tsx │ ├── about │ │ └── page.tsx │ ├── contact │ │ └── page.tsx │ └── profile │ │ └── page.tsx ├── utils │ ├── cn.ts │ └── sendMail.ts ├── models │ ├── likeModel.js │ ├── newLetterModel.js │ ├── profileModel.js │ ├── reportModel.js │ ├── oAuthModel.js │ ├── commentModel.js │ ├── contactModel.js │ ├── userModel.js │ ├── userBio.js │ └── blogModel.js ├── db │ ├── dockerfile │ └── dbConnect.ts ├── components │ ├── component │ │ ├── Hero.test.tsx │ │ ├── Hero.tsx │ │ ├── warningBanner.tsx │ │ ├── Faq.tsx │ │ ├── Report.tsx │ │ ├── ScamList.tsx │ │ ├── Cta.tsx │ │ ├── Footer.tsx │ │ ├── BlogLayout.tsx │ │ ├── NavBar.tsx │ │ └── Feature.tsx │ └── ui │ │ └── sparkles.tsx ├── context │ └── useAuthStore.ts ├── middleware.ts ├── data │ └── faqData.json └── api │ └── sendEmail.ts ├── postcss.config.js ├── .prettierrc ├── .prettierignore ├── .dockerignore ├── turbo.json ├── Dockerfile ├── next.config.mjs ├── .github ├── workflows │ └── deploy.yml └── ISSUE_TEMPLATE │ └── issue_form.yml ├── tailwind.config.ts ├── public ├── vercel.svg └── next.svg ├── .gitignore ├── jest.config.ts ├── tsconfig.json ├── contribution.md ├── Add FAQ Section to Documentation. ├── package.json ├── CODE_OF_CONDUCT.md └── README.md /jest.setup.ts: -------------------------------------------------------------------------------- 1 | import '@testing-library/jest-dom'; 2 | -------------------------------------------------------------------------------- /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "next/core-web-vitals" 3 | } 4 | -------------------------------------------------------------------------------- /.husky/pre-commit: -------------------------------------------------------------------------------- 1 | npm run test && npm run format && npm run check && npm run lint && npm run build -------------------------------------------------------------------------------- /src/app/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lets-code-with-us/scamwebsiteV1/HEAD/src/app/favicon.ico -------------------------------------------------------------------------------- /postcss.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: { 3 | tailwindcss: {}, 4 | autoprefixer: {}, 5 | }, 6 | }; 7 | -------------------------------------------------------------------------------- /src/utils/cn.ts: -------------------------------------------------------------------------------- 1 | import { ClassValue, clsx } from 'clsx'; 2 | import { twMerge } from 'tailwind-merge'; 3 | 4 | export function cn(...inputs: ClassValue[]) { 5 | return twMerge(clsx(inputs)); 6 | } 7 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "semi": true, 3 | "singleQuote": true, 4 | "tabWidth": 2, 5 | "trailingComma": "es5", 6 | "printWidth": 80, 7 | "bracketSpacing": true, 8 | "jsxBracketSameLine": false 9 | } 10 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | # Ignore artifacts: 2 | build 3 | coverage 4 | 5 | # Ignore all HTML files: 6 | **/*.html 7 | 8 | **/.git 9 | **/.svn 10 | **/.hg 11 | **/node_modules 12 | 13 | 14 | **/.git 15 | **/.svn 16 | **/.hg -------------------------------------------------------------------------------- /.dockerignore: -------------------------------------------------------------------------------- 1 | # Ignore all files and directories starting with a dot 2 | .* 3 | 4 | # Ignore specific files 5 | README.md 6 | LICENSE 7 | 8 | # Ignore directories 9 | node_modules/ 10 | dist/ 11 | .env 12 | .sample.env 13 | .env* 14 | -------------------------------------------------------------------------------- /src/app/trend/page.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { BlogPage } from '@/components/component/BlogLayout'; 3 | function page() { 4 | return ( 5 |
6 | 7 |
8 | ); 9 | } 10 | 11 | export default page; 12 | -------------------------------------------------------------------------------- /src/models/likeModel.js: -------------------------------------------------------------------------------- 1 | import mongoose from 'mongoose'; 2 | 3 | const likeSchema = new mongoose.Schema({ 4 | User: { 5 | type: mongoose.Types.ObjectId, 6 | ref: 'User', 7 | }, 8 | BlogLike: { 9 | type: mongoose.Types.ObjectId, 10 | ref: 'Blogs', 11 | }, 12 | }); 13 | 14 | export const Like = mongoose.models.Like || mongoose.model('Like', likeSchema); 15 | -------------------------------------------------------------------------------- /turbo.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://turbo.build/schema.json", 3 | "tasks": { 4 | "build": { 5 | "dependsOn": ["^build"], 6 | "outputs": [".next/**", "!.next/cache/**"] 7 | }, 8 | "check-types": { 9 | "dependsOn": ["^check-types"] 10 | }, 11 | "dev": { 12 | "persistent": true, 13 | "cache": false 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/models/newLetterModel.js: -------------------------------------------------------------------------------- 1 | import mongoose from 'mongoose'; 2 | 3 | // newsletter model 4 | 5 | const NewletterScheme = new mongoose.Schema({ 6 | email: { 7 | type: String, 8 | required: true, 9 | index: true, 10 | unique: true, 11 | }, 12 | }); 13 | 14 | const Newletter = 15 | mongoose.models.Newletter || mongoose.model('Newletter', NewletterScheme); 16 | 17 | export default Newletter; 18 | -------------------------------------------------------------------------------- /src/db/dockerfile: -------------------------------------------------------------------------------- 1 | # Use the official MongoDB image as the base image 2 | FROM mongo:latest 3 | 4 | # Set the working directory inside the container 5 | WORKDIR /data 6 | 7 | # Copy the MongoDB configuration file to the container 8 | COPY mongod.conf /etc/mongod.conf 9 | 10 | # Expose the default MongoDB port 11 | EXPOSE 27017 12 | 13 | # Start the MongoDB server 14 | CMD ["mongod", "--config", "/etc/mongod.conf"] 15 | -------------------------------------------------------------------------------- /src/models/profileModel.js: -------------------------------------------------------------------------------- 1 | import mongoose from 'mongoose'; 2 | 3 | const profileModel = new mongoose.Schema({ 4 | username: { 5 | type: String, 6 | required: true, 7 | }, 8 | profileimg: { 9 | type: String, 10 | }, 11 | bio: { 12 | type: mongoose.Types.ObjectId, 13 | ref: 'Bio', 14 | }, 15 | }); 16 | 17 | export const Profile = 18 | mongoose.models.Profile || mongoose.model('Profile', profileModel); 19 | -------------------------------------------------------------------------------- /src/components/component/Hero.test.tsx: -------------------------------------------------------------------------------- 1 | /** 2 | * @jest-environment jsdom 3 | */ 4 | import { render, screen } from '@testing-library/react'; 5 | import { SparklesPreview } from '@/components/component/Hero'; 6 | 7 | describe('SparklesPreview component', () => { 8 | it('renders the SparklesPreview element correctly', () => { 9 | render(); 10 | expect(screen.getByText('Scam Alert')).toBeInTheDocument(); 11 | }); 12 | }); 13 | -------------------------------------------------------------------------------- /src/db/dbConnect.ts: -------------------------------------------------------------------------------- 1 | import mongoose from 'mongoose'; 2 | export async function dbConnect() { 3 | try { 4 | mongoose.connect(process.env.MONGO_URI!); 5 | const connection = mongoose.connection; 6 | connection.on('connected', () => { 7 | console.log('Database connected'); 8 | }); 9 | connection.on('error', (err) => { 10 | console.log('error: ', err); 11 | }); 12 | } catch (error: any) { 13 | console.log(error); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/models/reportModel.js: -------------------------------------------------------------------------------- 1 | import mongoose from 'mongoose'; 2 | 3 | const reportSchema = new mongoose.Schema({ 4 | user: { 5 | type: mongoose.Types.ObjectId, 6 | ref: 'User', 7 | }, 8 | blogId: { 9 | type: mongoose.Types.ObjectId, 10 | ref: 'Blogs', 11 | }, 12 | comment: { 13 | type: String, 14 | require: true, 15 | }, 16 | }); 17 | 18 | export const Report = 19 | mongoose.models.Report || mongoose.model('Report', reportSchema); 20 | -------------------------------------------------------------------------------- /src/models/oAuthModel.js: -------------------------------------------------------------------------------- 1 | import mongoose from 'mongoose'; 2 | 3 | const OauthSchema = new mongoose.Schema({ 4 | username: { 5 | type: String, 6 | unique: true, 7 | required: true, 8 | }, 9 | email: { 10 | type: String, 11 | required: true, 12 | unique: true, 13 | }, 14 | avator: { 15 | type: String, 16 | required: true, 17 | unique: true, 18 | }, 19 | }); 20 | 21 | export const Auth = mongoose.models.Auth || mongoose.model('Auth', OauthSchema); 22 | -------------------------------------------------------------------------------- /src/app/page.tsx: -------------------------------------------------------------------------------- 1 | import { SparklesPreview } from '@/components/component/Hero'; 2 | import Cta from '@/components/component/Cta'; 3 | import Feature from '@/components/component/Feature'; 4 | import ScamList from '@/components/component/ScamList'; 5 | 6 | export default function Home() { 7 | return ( 8 |
9 |
10 | 11 | 12 |
13 | 14 | 15 |
16 |
17 | ); 18 | } 19 | -------------------------------------------------------------------------------- /src/models/commentModel.js: -------------------------------------------------------------------------------- 1 | import mongoose from 'mongoose'; 2 | 3 | const commentModel = new mongoose.Schema({ 4 | User: { 5 | type: mongoose.Types.ObjectId, 6 | ref: 'User', 7 | required: true, 8 | }, 9 | blogId: { 10 | type: mongoose.Types.ObjectId, 11 | ref: 'Blog', 12 | required: true, 13 | }, 14 | comment: { 15 | type: String, 16 | required: true, 17 | }, 18 | }); 19 | 20 | export const Comment = 21 | mongoose.models.Comment || mongoose.model('Comment', commentModel); 22 | -------------------------------------------------------------------------------- /src/app/globals.css: -------------------------------------------------------------------------------- 1 | @tailwind base; 2 | @tailwind components; 3 | @tailwind utilities; 4 | 5 | :root { 6 | --foreground-rgb: 0, 0, 0; 7 | --background-start-rgb: 214, 219, 220; 8 | --background-end-rgb: 255, 255, 255; 9 | } 10 | 11 | @media (prefers-color-scheme: dark) { 12 | :root { 13 | --foreground-rgb: 255, 255, 255; 14 | --background-start-rgb: 0, 0, 0; 15 | --background-end-rgb: 0, 0, 0; 16 | } 17 | } 18 | 19 | @layer utilities { 20 | .text-balance { 21 | text-wrap: balance; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/app/api/user/logout/route.ts: -------------------------------------------------------------------------------- 1 | import { NextRequest, NextResponse } from 'next/server'; 2 | 3 | export async function GET(_request: NextRequest) { 4 | try { 5 | const response = NextResponse.json({ 6 | message: 'logout Sucessful', 7 | success: true, 8 | }); 9 | response.cookies.set('token', '', { 10 | httpOnly: true, 11 | expires: new Date(0), 12 | }); 13 | return response; 14 | } catch (error: any) { 15 | return NextResponse.json({ message: error }, { status: 404 }); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | # Specify the base image 2 | FROM node:14-alpine 3 | 4 | # Set the working directory inside the container 5 | WORKDIR /app 6 | 7 | # Copy package.json and package-lock.json to the working directory 8 | COPY package*.json ./ 9 | 10 | # Install dependencies 11 | RUN npm install 12 | 13 | # Copy the rest of the application code to the working directory 14 | COPY . . 15 | 16 | # Build the Next.js app 17 | RUN npm run build 18 | 19 | # Expose the port that the app will run on 20 | EXPOSE 3000 21 | 22 | # Start the app 23 | CMD ["npm", "start"] 24 | -------------------------------------------------------------------------------- /src/models/contactModel.js: -------------------------------------------------------------------------------- 1 | import mongoose from 'mongoose'; 2 | 3 | // contact model 4 | 5 | const contactSchema = new mongoose.Schema( 6 | { 7 | name: { 8 | type: String, 9 | required: true, 10 | }, 11 | email: { 12 | type: String, 13 | required: true, 14 | unique: true, 15 | }, 16 | message: { 17 | type: String, 18 | required: true, 19 | }, 20 | }, 21 | { timestamps: true } 22 | ); 23 | 24 | export const Contact = 25 | mongoose.model.Contact || mongoose.model('Contact', contactSchema); 26 | -------------------------------------------------------------------------------- /src/app/page.test.tsx: -------------------------------------------------------------------------------- 1 | /** 2 | * @jest-environment jsdom 3 | */ 4 | import { render, screen } from '@testing-library/react'; 5 | import Home from '@/app/page'; 6 | 7 | describe('Home component', () => { 8 | it('renders the Home element correctly', () => { 9 | render(); 10 | // Check if the
element is in the document 11 | const section = document.querySelector('section'); 12 | expect(section).toBeInTheDocument(); 13 | 14 | // Check if the
has exactly 5 children 15 | expect(section?.children.length).toBe(5); 16 | }); 17 | }); 18 | -------------------------------------------------------------------------------- /src/models/userModel.js: -------------------------------------------------------------------------------- 1 | import mongoose from 'mongoose'; 2 | 3 | // user schema 4 | const userSchema = new mongoose.Schema({ 5 | username: { 6 | type: String, 7 | required: true, 8 | unqiue: true, 9 | }, 10 | email: { 11 | type: String, 12 | required: true, 13 | unqiue: true, 14 | }, 15 | password: { 16 | type: String, 17 | required: true, 18 | }, 19 | isVerified: { 20 | type: Boolean, 21 | required: false, 22 | default: false, 23 | }, 24 | }); 25 | 26 | export const User = mongoose.models.User || mongoose.model('User', userSchema); 27 | -------------------------------------------------------------------------------- /next.config.mjs: -------------------------------------------------------------------------------- 1 | /** @type {import('next').NextConfig} */ 2 | const nextConfig = { 3 | images: { 4 | domains: [ 5 | 'images.pexels.com', 6 | 'img.freepik.com', 7 | 'images.unsplash.com', 8 | 'via.placeholder.com', 9 | 'dev-ui-image-assets.s3.ap-south-1.amazonaws.com', 10 | 'plus.unsplash.com', 11 | 'res.cloudinary.com', 12 | 'avatars.githubusercontent.com', 13 | 'nextjs.org', 14 | 'randomuser.me', 15 | 'images.remotePatterns', 16 | 'images.generated.photos' 17 | ], 18 | }, 19 | }; 20 | 21 | export default nextConfig; 22 | -------------------------------------------------------------------------------- /.github/workflows/deploy.yml: -------------------------------------------------------------------------------- 1 | name: Deploy CI/CD 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | 8 | jobs: 9 | build-and-deploy: 10 | runs-on: ubuntu-latest 11 | 12 | steps: 13 | - name: Checkout Code 14 | uses: actions/checkout@v3 15 | 16 | - name: Set up Node.js 17 | uses: actions/setup-node@v3 18 | with: 19 | node-version: '18' 20 | 21 | - name: Install dependencies 22 | run: npm install 23 | 24 | - name: Run tests 25 | run: npm run lint 26 | 27 | # - name: Build 28 | # run: npm run build 29 | -------------------------------------------------------------------------------- /src/models/userBio.js: -------------------------------------------------------------------------------- 1 | import mongoose from 'mongoose'; 2 | 3 | // bio schema 4 | 5 | const bioSchema = new mongoose.Schema({ 6 | user: { 7 | type: mongoose.Types.ObjectId, 8 | ref: 'User', 9 | }, 10 | bio: { 11 | type: String, 12 | default: null, 13 | }, 14 | instagramLink: { 15 | type: String, 16 | default: null, 17 | }, 18 | LinkedlnLink: { 19 | type: String, 20 | default: null, 21 | }, 22 | githubLink: { 23 | type: String, 24 | default: null, 25 | }, 26 | }); 27 | 28 | export const Bio = mongoose.models.Bio || mongoose.model('Bio', bioSchema); 29 | -------------------------------------------------------------------------------- /tailwind.config.ts: -------------------------------------------------------------------------------- 1 | import type { Config } from 'tailwindcss'; 2 | 3 | const config: Config = { 4 | content: [ 5 | './src/pages/**/*.{js,ts,jsx,tsx,mdx}', 6 | './src/components/**/*.{js,ts,jsx,tsx,mdx}', 7 | './src/app/**/*.{js,ts,jsx,tsx,mdx}', 8 | ], 9 | theme: { 10 | extend: { 11 | backgroundImage: { 12 | 'gradient-radial': 'radial-gradient(var(--tw-gradient-stops))', 13 | 'gradient-conic': 14 | 'conic-gradient(from 180deg at 50% 50%, var(--tw-gradient-stops))', 15 | }, 16 | }, 17 | }, 18 | plugins: [], 19 | }; 20 | export default config; 21 | -------------------------------------------------------------------------------- /public/vercel.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/models/blogModel.js: -------------------------------------------------------------------------------- 1 | import mongoose from 'mongoose'; 2 | const blogSchema = new mongoose.Schema({ 3 | user: { 4 | type: mongoose.Types.ObjectId, 5 | ref: 'User', 6 | }, 7 | title: { 8 | type: String, 9 | required: true, 10 | }, 11 | imageUrl: { 12 | type: String, 13 | required: true, 14 | }, 15 | category: { 16 | type: String, 17 | required: true, 18 | }, 19 | content: { 20 | type: String, 21 | required: true, 22 | }, 23 | }); 24 | 25 | export const Blogs = 26 | mongoose.models.Blogs || mongoose.model('Blogs', blogSchema); // Corrected from "Blog" to "Blogs" 27 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | .yarn/install-state.gz 8 | 9 | # testing 10 | /coverage 11 | 12 | # next.js 13 | /.next/ 14 | /out/ 15 | 16 | # production 17 | /build 18 | 19 | # misc 20 | .DS_Store 21 | *.pem 22 | 23 | # debug 24 | npm-debug.log* 25 | yarn-debug.log* 26 | yarn-error.log* 27 | 28 | # local env files 29 | .env*.local 30 | .env 31 | 32 | # vercel 33 | .vercel 34 | 35 | # typescript 36 | *.tsbuildinfo 37 | next-env.d.ts 38 | 39 | # turbo 40 | .turbo 41 | .idea 42 | 43 | # prettier 44 | out 45 | 46 | -------------------------------------------------------------------------------- /src/app/api/user/giveBlogs/route.ts: -------------------------------------------------------------------------------- 1 | import { dbConnect } from '@/db/dbConnect'; 2 | import { Blogs } from '@/models/blogModel'; 3 | import { NextRequest, NextResponse } from 'next/server'; 4 | 5 | dbConnect(); 6 | export async function GET(_request: NextRequest) { 7 | try { 8 | const getBlog = await Blogs.find({}).sort({ _id: -1 }); 9 | const blogData = await getBlog; 10 | 11 | if (!getBlog) { 12 | return NextResponse.json({ message: 'Server Error' }, { status: 500 }); 13 | } 14 | 15 | return NextResponse.json({ data: blogData }, { status: 200 }); 16 | } catch (error: any) { 17 | return NextResponse.json({ message: error }, { status: 404 }); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/app/layout.tsx: -------------------------------------------------------------------------------- 1 | import type { Metadata } from 'next'; 2 | import { Inter } from 'next/font/google'; 3 | import './globals.css'; 4 | import { NavBar } from '@/components/component/NavBar'; 5 | import { Footer } from '@/components/component/Footer'; 6 | 7 | const inter = Inter({ subsets: ['latin'] }); 8 | 9 | export const metadata: Metadata = { 10 | title: 'Scam website', 11 | description: 'Scam Alert', 12 | }; 13 | 14 | export default function RootLayout({ 15 | children, 16 | }: Readonly<{ 17 | children: React.ReactNode; 18 | }>) { 19 | return ( 20 | 21 | 22 | 23 | {children} 24 |