Skip to content

Commit

Permalink
Resolved merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
SATYAM1000 committed Sep 25, 2024
2 parents cdf301c + d81b889 commit a696915
Show file tree
Hide file tree
Showing 56 changed files with 1,605 additions and 1,024 deletions.
5 changes: 3 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ CDN_BASE_UPLOAD_URL=https://sg.storage.bunnycdn.com/job-board/assets
CDN_BASE_ACCESS_URL=https://job-board.b-cdn.net/assets


NEXT_PUBLIC_GOOGLE_MAPS_API_KEY=

NEXT_PUBLIC_GOOGLE_MAPS_API_KEY=maps-api-key

# To run the application in production environment / check the envs
# SKIP_ENV_CHECK=true npm run [replace with your script name]
8 changes: 6 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
name: Continuous Integration

env:
SKIP_ENV_CHECK: 'true'

on:
push:
branches: [ main ]
branches: [main]
pull_request:
branches: [ main ]
branches: [main]

jobs:
build:
Expand All @@ -14,6 +17,7 @@ jobs:
- uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Use Node.js
uses: actions/setup-node@v2
with:
Expand Down
90 changes: 66 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Project Name: Job Board

[All about job board](https://marmalade-height-05f.notion.site/100xDevs-Job-board-ab8ca399180d49e4bc0c2ff5c81dfb08?pvs=25) <br/>
[Project Status](https://marmalade-height-05f.notion.site/Job-board-10315651c69c80b581b5f7b64667341c)

## Table of Contents

- [Description](#description)
Expand Down Expand Up @@ -37,22 +39,24 @@ Follow these steps to set up the repository locally and run it.

```bash
#
# Database
# Database
#
DATABASE_URL="postgres://postgres:password@localhost:5432/postgres"

#
# AUTH
# AUTH
#
NEXTAUTH_SECRET="koXrQGB5TFD4KALDX4kAvnQ5RHHvAOIzB"
NEXTAUTH_SECRET=
NEXTAUTH_URL="http://localhost:3000"

#
# Bunny CDN
#
CDN_SZ_NAME=
CDN_BASE_PATH=
CDN_API_KEY=
CDN_BASE_UPLOAD_URL=
CDN_BASE_ACCESS_URL=

NEXT_PUBLIC_GOOGLE_MAPS_API_KEY=
```

2. To generate AUTH_SECRET,
Expand All @@ -67,7 +71,6 @@ Follow these steps to set up the repository locally and run it.

[Run in browser](https://www.cryptool.org/en/cto/openssl/)


### Running the Project with Docker

```bash
Expand Down Expand Up @@ -103,43 +106,82 @@ Emails: '[email protected], [email protected]';
Password: '123456';
```


## Steps to create a BunnyCDN storage for this repo:

1. **Create a storage zone:**

<img src="https://utfs.io/f/CUistsOk9f0Iocrllmq4RQuXkCx9NthDrTEw6dFy1Z3KfIPc" alt="Create a storage zone" width="150" />
<img src="https://utfs.io/f/CUistsOk9f0Iocrllmq4RQuXkCx9NthDrTEw6dFy1Z3KfIPc" alt="Create a storage zone" width="150" />

2. **Connect the storage zone to a pull zone:**

<img src="https://utfs.io/f/CUistsOk9f0ImevkKUyo3QdPNXDuFbcZEagW0AUej1tzvmMw" alt="Connect the storage zone to a pull zone" width="250" />
<img src="https://utfs.io/f/CUistsOk9f0ImevkKUyo3QdPNXDuFbcZEagW0AUej1tzvmMw" alt="Connect the storage zone to a pull zone" width="250" />

4. **Set environment variables:**
3. **Set environment variables:**

Go to the FTP & API Access section in the storage zone and add the following environment variables:

```bash
CDN_API_KEY=<your-api-key>
```

Which you can find in the storage -> [storage name] -> FTP & API Access section

<img src="https://utfs.io/f/CUistsOk9f0Imf5c1ZUyo3QdPNXDuFbcZEagW0AUej1tzvmM" alt="CDN_API_KEY" width="500" />

---

```bash
CDN_BASE_UPLOAD_URL=<your-cdn-base-upload-url>
```
Which is https://[your-hostname]/[storage-name]/[any folder name you might have added otherwise empty]

```bash
CDN_BASE_UPLOAD_URL=<your-cdn-base-upload-url>
```

Which is https://[your-hostname]/[storage-name]/[any folder name you might have added otherwise empty]

<img src="https://utfs.io/f/CUistsOk9f0Imf5c1ZUyo3QdPNXDuFbcZEagW0AUej1tzvmM" alt="CDN_BASE_UPLOAD_URL" width="500" />

---

```bash
CDN_BASE_ACCESS_URL=<your-cdn-base-access-url>
```
Which is https://[your-pull-zone-hostname]/[any folder name you might have added otherwise empty] or get link from the dashboard as mentioned below


```bash
CDN_BASE_ACCESS_URL=<your-cdn-base-access-url>
```

Which is https://[your-pull-zone-hostname]/[any folder name you might have added otherwise empty] or get link from the dashboard as mentioned below

<img src="https://utfs.io/f/CUistsOk9f0IyM9047Pa7YvK8qbtnUAPO9jwxdskhzc2JNoR" alt=" CDN_BASE_ACCESS_URL" width="600" />


# Steps to Set Up Google Maps Platform API Key

To use the Google Maps API in your applications, follow the steps below to create and set up your API key.

### Step 1: Go to Google Cloud Console
1. Navigate to the [Google Cloud Console](https://console.cloud.google.com/).
2. If you don’t have a Google account, create one and sign in.

### Step 2: Create a New Project
1. In the Cloud Console, click on the **Select a project** dropdown at the top.
2. Click **New Project** to create a new project.
3. Give your project a name, select the organization (optional), and choose the billing account.
4. Click **Create**.

### Step 3: Google Maps Platform
1. Search Google Maps Platform in the Console search bar
<img width="1438" alt="Screenshot 2024-09-22 at 10 15 15 AM" src="https://github.com/user-attachments/assets/a5f93c1e-d7b6-4a5b-847b-868b1133643d">

2. If your account is not setup yet , finish your account setup
<img width="930" alt="Screenshot 2024-09-22 at 10 02 59 AM" src="https://github.com/user-attachments/assets/c8ee7aa3-7610-4836-86f6-c28e8604c2b9">

3.After Completeing account setup , select the "Keys and Credentails" Section.
4.Then select the Create Credentials option , under which you can select the "API Key Option"
<img width="1440" alt="Screenshot 2024-09-22 at 10 05 36 AM" src="https://github.com/user-attachments/assets/9e897c91-3282-4e28-8fdf-d920d6c4bc15">

5. You will receive a API Key , add the key to the NEXT_PUBLIC_GOOGLE_MAPS_API_KEY in the .env
<img width="660" alt="Screenshot 2024-09-22 at 10 19 33 AM" src="https://github.com/user-attachments/assets/adcb5a49-892e-43a1-b318-56b296280611">



### Step 4: Changes required to make it work on localhost
1. Although the documentation mentions that without restriction , the API key will work everywhere, that is not the case for http requests.
2. Add a restriction and mention your localhost along with your port for it to start working on local , and save and continue
<img width="694" alt="Screenshot 2024-09-22 at 10 06 44 AM" src="https://github.com/user-attachments/assets/3acfdf47-4b1d-480f-8172-0fbfa1c39f02">

3. to test navigate to the http://localhost:3000/create , and test the "Where is the job located" input.
15 changes: 0 additions & 15 deletions prisma/migrations/20240915130106_/migration.sql

This file was deleted.

15 changes: 0 additions & 15 deletions prisma/migrations/20240915194739_init/migration.sql

This file was deleted.

16 changes: 16 additions & 0 deletions prisma/migrations/20240921165842_update/migration.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/*
Warnings:
- Changed the type of `type` on the `Job` table. No cast exists, the column would be dropped and recreated, which cannot be done if there is data, since the column is required.
*/
-- CreateEnum
CREATE TYPE "EmployementType" AS ENUM ('Full_time', 'Part_time', 'Internship', 'Contract');

-- AlterTable
ALTER TABLE "Job" ADD COLUMN "has_experience_range" BOOLEAN NOT NULL DEFAULT false,
ADD COLUMN "maxExperience" INTEGER,
ADD COLUMN "minExperience" INTEGER,
ADD COLUMN "skills" TEXT[],
DROP COLUMN "type",
ADD COLUMN "type" "EmployementType" NOT NULL;
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ CREATE TYPE "WorkMode" AS ENUM ('remote', 'hybrid', 'office');
-- CreateEnum
CREATE TYPE "Role" AS ENUM ('USER', 'ADMIN');

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

-- CreateTable
CREATE TABLE "User" (
"id" TEXT NOT NULL,
Expand All @@ -36,7 +33,8 @@ CREATE TABLE "Job" (
"type" TEXT NOT NULL,
"work_mode" "WorkMode" NOT NULL,
"currency" "Currency" NOT NULL DEFAULT 'INR',
"location" "JobLocations" NOT NULL,
"city" TEXT NOT NULL,
"address" TEXT NOT NULL,
"application" TEXT NOT NULL,
"companyLogo" TEXT NOT NULL,
"has_salary_range" BOOLEAN NOT NULL DEFAULT false,
Expand Down
55 changes: 33 additions & 22 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -19,28 +19,32 @@ model User {
}

model Job {
id String @id @default(cuid())
userId String
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)
city String
address String
application String
companyLogo String
hasSalaryRange Boolean @default(false) @map("has_salary_range")
minSalary Int?
maxSalary Int?
isVerifiedJob Boolean @default(false) @map("is_verified_job")
postedAt DateTime @default(now())
updatedAt DateTime @updatedAt
user User @relation(fields: [userId], references: [id])
id String @id @default(cuid())
userId String
title String
description String?
companyName String @map("company_name")
companyBio String @map("company_bio")
companyEmail String @map("company_email")
category String
type EmployementType
workMode WorkMode @map("work_mode")
currency Currency @default(INR)
city String
address String
application String
companyLogo String
skills String[]
hasSalaryRange Boolean @default(false) @map("has_salary_range")
minSalary Int?
maxSalary Int?
hasExperiencerange Boolean @default(false) @map("has_experience_range")
minExperience Int?
maxExperience Int?
isVerifiedJob Boolean @default(false) @map("is_verified_job")
postedAt DateTime @default(now())
updatedAt DateTime @updatedAt
user User @relation(fields: [userId], references: [id])
}

enum Currency {
Expand All @@ -59,3 +63,10 @@ enum Role {
ADMIN
}

enum EmployementType {
Full_time
Part_time
Internship
Contract
}

Loading

0 comments on commit a696915

Please sign in to comment.