Skip to content

Commit

Permalink
Build lint env fix (#392)
Browse files Browse the repository at this point in the history
* env production skip-check

* build-fix-env

* build-fix-env

* remove nodeenv env
  • Loading branch information
aakash2330 authored Sep 22, 2024
1 parent a9290b1 commit fc38978
Show file tree
Hide file tree
Showing 9 changed files with 53 additions and 41 deletions.
3 changes: 2 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ CDN_BASE_ACCESS_URL=https://job-board.b-cdn.net/assets

NEXT_PUBLIC_GOOGLE_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
42 changes: 22 additions & 20 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,12 +39,12 @@ 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=
NEXTAUTH_URL="http://localhost:3000"
Expand All @@ -69,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 @@ -105,45 +106,46 @@ 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" />


Expand Down
20 changes: 10 additions & 10 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { fileURLToPath } from "node:url";
import createJiti from "jiti";
import { fileURLToPath } from 'node:url';
import createJiti from 'jiti';

const jiti = createJiti(fileURLToPath(import.meta.url));

// Import env here to validate during build. Using jiti we can import .ts files :)
jiti("./src/env/client");
jiti("./src/env/server");
if (process.env.SKIP_ENV_CHECK !== 'true') {
const jiti = createJiti(fileURLToPath(import.meta.url));
jiti('./src/env/client');
jiti('./src/env/server');
}

/** @type {import('next').NextConfig} */
const nextConfig = {
Expand All @@ -18,11 +18,11 @@ const nextConfig = {
images: {
remotePatterns: [
{
protocol: "https",
hostname: "job-board.b-cdn.net", // Change this to your CDN domain
protocol: 'https',
hostname: 'job-board.b-cdn.net', // Change this to your CDN domain
},
],
},
};

export default nextConfig; // ES module export
export default nextConfig; // ES module export
2 changes: 1 addition & 1 deletion src/components/DescriptionEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const DescriptionEditor: React.FC<DescriptionEditorProps> = ({
modules={modules}
formats={formats}
value={description}
style={{ width: "100%" }}
style={{ width: '100%' }}
onChange={handleChange}
placeholder={placeholder}
className="text-white bg-gray-800 overflow-hidden job-description-editor"
Expand Down
2 changes: 1 addition & 1 deletion src/components/gmaps-autosuggest.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { clientEnv } from '@/env/client';

export type TgmapsAddress = { city: string; fullAddress: string };

export function GmapsAutocompleteAddress({ form }: { form: any }) {
export default function GmapsAutocompleteAddress({ form }: { form: any }) {
let autocomplete: any = null;

function onPlaceChanged() {
Expand Down
13 changes: 11 additions & 2 deletions src/components/job-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,14 @@ import Image from 'next/image';
import { FaFileUpload } from 'react-icons/fa';
import { Switch } from './ui/switch';
import { Label } from './ui/label';
import { GmapsAutocompleteAddress } from './gmaps-autosuggest';
import dynamic from 'next/dynamic';

const DynamicLineDrawingAnimation = dynamic(
() => import('./gmaps-autosuggest'),
{
ssr: false,
}
);

const PostJobForm = () => {
const { toast } = useToast();
Expand Down Expand Up @@ -345,7 +352,9 @@ const PostJobForm = () => {
)}
</div>

<GmapsAutocompleteAddress form={form}></GmapsAutocompleteAddress>
<DynamicLineDrawingAnimation
form={form}
></DynamicLineDrawingAnimation>

<FormField
control={form.control}
Expand Down
1 change: 0 additions & 1 deletion src/components/ui/sheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ const SheetContent = React.forwardRef<
{...props}
>
{children}

</SheetPrimitive.Content>
</SheetPortal>
));
Expand Down
3 changes: 0 additions & 3 deletions src/lib/constant/app.constant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ export const adminNavbar = [
},
{ id: 2, label: 'Manage Recruiters', path: '/' },
{ id: 3, label: 'Payment History', path: '/' },

];

export const socials: {
Expand Down Expand Up @@ -64,7 +63,6 @@ export const footerItems = [
},
];


export const trustedCompanies = [
{
icon: adobe,
Expand All @@ -91,4 +89,3 @@ export const trustedCompanies = [
name: 'google',
},
];

0 comments on commit fc38978

Please sign in to comment.