Skip to content

Commit

Permalink
Added create job form and implemented s3 image upload functionality (c…
Browse files Browse the repository at this point in the history
…ode100x#321)

* added create job form and s3 image upload functionality

* changed .env.example file

* added Chennai field to JobLocation Enum

* fixed type error in DescriptionEditor.tsx and other minor changes

* changed .env.example file

---------

Co-authored-by: developingright <[email protected]>
  • Loading branch information
developingright and developingright authored Sep 10, 2024
1 parent bf2055e commit 5f7b36f
Show file tree
Hide file tree
Showing 16 changed files with 742 additions and 437 deletions.
6 changes: 5 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
DATABASE_URL="postgres://postgres:postgres@db:5432/job-board-db"
NEXTAUTH_SECRET="koXrQGB5TFDhiX47swxHW+4KALDX4kAvnQ5RHHvAOIzB"
NEXTAUTH_URL="http://localhost:3000"
NEXTAUTH_URL="http://localhost:3000"
AWS_S3_REGION=your-aws-region
AWS_S3_ACCESS_KEY_ID=your-access-ID
AWS_S3_SECRET_ACCESS_KEY=your-access-key
AWS_S3_BUCKET_NAME=your-bucket
9 changes: 9 additions & 0 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@ const nextConfig = {
fullUrl: true,
},
},
images: {
remotePatterns: [
{
protocol: 'https',
//Add aws s3 bucket hostname
hostname: '<bucket_url/hostname>', //example - youraws.s3.ap-south-2.amazonaws.com
},
],
},
};

module.exports = nextConfig;
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
"seed": "ts-node --compiler-options {\"module\":\"CommonJS\"} prisma/seed.ts"
},
"dependencies": {
"@aws-sdk/client-s3": "^3.645.0",
"@aws-sdk/s3-request-presigner": "^3.645.0",
"@hookform/resolvers": "^3.9.0",
"@prisma/client": "5.18.0",
"@radix-ui/react-accordion": "^1.2.0",
Expand Down Expand Up @@ -49,6 +51,7 @@
"react-dom": "^18",
"react-hook-form": "^7.52.2",
"react-icons": "^5.2.1",
"react-quill": "^2.0.0",
"tailwind-merge": "^2.4.0",
"tailwindcss-animate": "^1.0.7",
"vaul": "^0.9.1",
Expand Down
15 changes: 0 additions & 15 deletions prisma/migrations/20240902211016_/migration.sql

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ CREATE TYPE "WorkMode" AS ENUM ('remote', 'hybrid', 'office');
CREATE TYPE "Role" AS ENUM ('USER', 'ADMIN');

-- CreateEnum
CREATE TYPE "Location" AS ENUM ('BANGLORE', 'DELHI', 'MUMBAI', 'PUNE', 'CHENNAI', 'HYDERABAD', 'KOLKATA', 'AHMEDABAD', 'JAIPUR', 'SURAT');
CREATE TYPE "JobLocations" AS ENUM ('BANGLORE', 'DELHI', 'MUMBAI', 'CHENNAI', 'PUNE', 'HYDERABAD', 'KOLKATA', 'AHMEDABAD', 'JAIPUR', 'SURAT');

-- CreateTable
CREATE TABLE "User" (
Expand All @@ -30,9 +30,15 @@ CREATE TABLE "Job" (
"title" TEXT NOT NULL,
"description" TEXT,
"company_name" TEXT NOT NULL,
"company_bio" TEXT NOT NULL,
"company_email" TEXT NOT NULL,
"category" TEXT NOT NULL,
"type" TEXT NOT NULL,
"work_mode" "WorkMode" NOT NULL,
"currency" "Currency" NOT NULL DEFAULT 'INR',
"location" "Location" NOT NULL,
"location" "JobLocations" NOT NULL,
"application" TEXT NOT NULL,
"companyLogo" TEXT NOT NULL,
"has_salary_range" BOOLEAN NOT NULL DEFAULT false,
"minSalary" INTEGER,
"maxSalary" INTEGER,
Expand Down
8 changes: 7 additions & 1 deletion prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,15 @@ model Job {
title String
description String?
companyName String @map("company_name")
companyBio String @map("company_bio")
companyEmail String @map("company_email")
category String
type String
workMode WorkMode @map("work_mode")
currency Currency @default(INR)
location JobLocations
application String
companyLogo String
hasSalaryRange Boolean @default(false) @map("has_salary_range")
minSalary Int?
maxSalary Int?
Expand Down Expand Up @@ -56,8 +62,8 @@ enum JobLocations {
BANGLORE
DELHI
MUMBAI
PUNE
CHENNAI
PUNE
HYDERABAD
KOLKATA
AHMEDABAD
Expand Down
Loading

0 comments on commit 5f7b36f

Please sign in to comment.