Skip to content

StephenC0729/JobScamApp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JobScamApp

ASP.NET Core MVC application for reporting job scams with role-based authentication and authorization.

Features

  • Role-based Authentication: Admin, Moderator, JobPoster, JobSeeker roles
  • Scam Reporting: Users can report job scams with evidence and details
  • Job Listings: Legitimate job postings with company information
  • Moderation System: Moderators can review and manage content
  • Ownership Controls: Users can only edit their own content (except Moderators/Admins)

Tech Stack

  • Backend: ASP.NET Core 8.0 MVC
  • Authentication: ASP.NET Core Identity with Roles
  • Database: SQL Server with Entity Framework Core
  • Frontend: Razor Views with Bootstrap 5
  • ORM: Entity Framework Core with Code-First Migrations

User Roles & Permissions

Role Scam Reports Job Listings Moderation User Management Audit Logs
JobSeeker ✅ Flag Jobs Only ✅ View Only + Flag Jobs ❌ No Access ❌ No Access ❌ No Access
JobPoster ❌ No Access ✅ Create/Edit Own ❌ No Access ❌ No Access ❌ No Access
Moderator ✅ View/Edit Only ✅ Create/Edit Any ✅ Full Access ✅ Suspend/Warn Users ❌ No Access
Admin ✅ View/Edit Only ✅ Edit/View Any ✅ Full Access ✅ Edit User Roles & Suspend ✅ View & Export

Setup Instructions

Prerequisites

  • .NET 8.0 SDK or later
  • SQL Server (LocalDB, Express, Full, or Docker)
  • Git
  • Docker (optional, for SQL Server container)

Option 1: Visual Studio 2022

  1. Clone Repository

    git clone https://github.com/YOUR_USERNAME/JobScamApp.git
    cd JobScamApp
  2. Open in Visual Studio

    • Open JobScamApp.sln in Visual Studio 2022
    • Wait for NuGet packages to restore automatically
  3. Configure Database

    • Open appsettings.json
    • The connection string configured for LocalDB:
      {
        "ConnectionStrings": {
          "JobScamAppContextConnection": "Server=(localdb)\\mssqllocaldb;Database=JobScamApp;Trusted_Connection=True;MultipleActiveResultSets=true"
        }
      }
  4. Apply Database Migrations

    • Open Package Manager Console (Tools → NuGet Package Manager → Package Manager Console)
    • Run: Update-Database
  5. Run the Application

    • Press F5 or click the green "Start" button
    • The app will open at https://localhost:7xxx

Option 2: JetBrains Rider

  1. Clone Repository

    • In Rider: FileNewProject from Version Control
    • Enter: https://github.com/YOUR_USERNAME/JobScamApp.git
    • Choose directory and click Clone
  2. Restore Packages

    • Rider should automatically restore NuGet packages
    • If not: ToolsNuGetRestore NuGet Packages
  3. Configure Database

    • Open appsettings.json
    • The connection string is configured for Docker SQL Server:
      {
        "ConnectionStrings": {
          "JobScamAppContextConnection": "Server=localhost,1433;Database=JobScamApp;User Id=sa;Password=SqlServer2024Pass;TrustServerCertificate=true;"
        }
      }
  4. Apply Database Migrations

    • Open Terminal in Rider (ViewTool WindowsTerminal)
    • Navigate to project directory: cd JobScamApp
    • Run: dotnet ef database update
  5. Run the Application

    • Click the green play button or press Ctrl+F5
    • Navigate to https://localhost:7xxx

Project Structure

JobScamApp/
├── Controllers/           # MVC Controllers with role-based authorization
│   ├── AdminController.cs
│   ├── AuditController.cs
│   ├── HomeController.cs
│   ├── JobListingsController.cs
│   ├── JobPosterController.cs
│   ├── JobSeekerController.cs
│   ├── ModeratorController.cs
│   └── ScamReportsController.cs
├── Models/               # Domain models
│   ├── AuditLog.cs          # Audit trail entity
│   ├── ErrorViewModel.cs    # Error handling model
│   ├── JobListing.cs        # Job listing entity
│   ├── JobScamAppUser.cs    # Custom Identity User
│   ├── ScamReport.cs        # Scam report entity
│   └── UserManagementViewModel.cs
├── Services/             # Business logic services
│   ├── AuditService.cs      # Audit logging implementation
│   └── IAuditService.cs     # Audit service interface
├── Views/                # Razor views with Bootstrap UI
│   ├── Admin/               # Admin management views
│   ├── Audit/               # Audit log views
│   ├── Home/                # Public home pages
│   ├── JobListings/         # Job listing views
│   ├── JobPoster/           # Job poster dashboard
│   ├── JobSeeker/           # Job seeker dashboard
│   ├── Moderator/           # Moderation views
│   ├── ScamReports/         # Scam report views
│   └── Shared/              # Shared layouts and partials
├── Data/                 # Entity Framework context
│   └── JobScamAppDbContext.cs
├── Areas/Identity/       # Scaffolded Identity UI
│   └── Pages/Account/       # Login, register, etc.
└── Migrations/           # EF Core migrations

API Endpoints

Scam Reports

  • GET /ScamReports - List all reports (with filtering)
  • GET /ScamReports/Details/{id} - View report details
  • GET /ScamReports/EditData/{id} - Edit report (Own or Moderator+)
  • POST /ScamReports/UpdateData/{id} - Update report
  • POST /ScamReports/DeleteData/{id} - Delete report
  • POST /JobListings/ReportSuspicious/{id} - Flag job as suspicious (creates scam report)

Job Listings

  • GET /JobListings - List all jobs (with search/filtering)
  • GET /JobListings/Details/{id} - View job details
  • GET /JobListings/AddData - Create job form (JobPoster+)
  • POST /JobListings/AddData - Submit new job
  • GET /JobListings/EditData/{id} - Edit job (Own or Moderator+)
  • POST /JobListings/UpdateData/{id} - Update job
  • POST /JobListings/DeleteData/{id} - Delete job

User Management (Admin Only)

  • GET /Admin - Admin dashboard with system statistics
  • GET /Admin/Users - Manage users (search, filter by role)
  • GET /Admin/EditUser/{id} - Edit user details and roles
  • POST /Admin/EditUser - Update user information
  • GET /Admin/SuspendUser/{id} - Suspend user form
  • POST /Admin/SuspendUser - Apply user suspension
  • POST /Admin/UnsuspendUser/{id} - Remove user suspension
  • POST /Admin/DeleteUser/{id} - Delete user account

Audit Logs (Admin Only)

  • GET /Audit - View audit logs (with filtering and pagination)
  • GET /Audit/EntityHistory - View entity change history
  • GET /Audit/ExportLogs - Export audit logs to CSV
  • GET /Audit/ExportScamReports - Export scam reports to CSV
  • GET /Audit/ExportJobListings - Export job listings to CSV

Role Dashboards

  • GET /JobSeeker - JobSeeker dashboard (JobSeeker role)
  • GET /JobPoster - JobPoster dashboard (JobPoster role)
  • GET /Moderator - Moderator dashboard (Moderator role)
  • GET /Admin - Admin dashboard (Admin role)

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

For support and questions, please open an issue in the GitHub repository.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •