-
Notifications
You must be signed in to change notification settings - Fork 456
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feature/faq-section
- Loading branch information
Showing
32 changed files
with
652 additions
and
185 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,32 @@ | ||
DATABASE_URL="postgres://postgres:postgres@db:5432/job-board-db" | ||
NEXTAUTH_SECRET="koXrQGB5TFDhiX47swxHW+4KALDX4kAvnQ5RHHvAOIzB" | ||
# | ||
# Database | ||
# | ||
DATABASE_URL="postgres://postgres:password@localhost:5432/postgres" | ||
|
||
# | ||
# AUTH | ||
# | ||
NEXTAUTH_SECRET="koXrQGB5TFD4KALDX4kAvnQ5RHHvAOIzB" | ||
NEXTAUTH_URL="http://localhost:3000" | ||
|
||
# PRISMA STUDIO DOCKER | ||
POSTGRES_URL=postgres://postgres:postgres@db:5432/job-board-db | ||
POSTGRES_HOST=db | ||
POSTGRES_USERNAME=postgres | ||
POSTGRES_PASSWORD=postgres | ||
|
||
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 | ||
AWS_S3_BUCKET_NAME=your-bucket | ||
# | ||
# Bunny CDN | ||
# | ||
CDN_API_KEY=api-key | ||
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= | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: Continuous Deployment | ||
on: | ||
push: | ||
branches: [ main ] | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Docker login | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Build and push | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: . | ||
file: ./Dockerfile.prod | ||
push: true | ||
tags: 100xdevs/job-board-staging:${{ github.sha }} | ||
|
||
- name: Clone staging-ops repo, update, and push | ||
env: | ||
PAT: ${{ secrets.PAT }} | ||
run: | | ||
git clone https://github.com/code100x/staging-ops.git | ||
cd staging-ops | ||
sed -i 's|image: 100xdevs/job-board-staging:.*|image: 100xdevs/job-board-staging:${{ github.sha }}|' staging/job-board/deployment.yml | ||
git config user.name "GitHub Actions Bot" | ||
git config user.email "[email protected]" | ||
git add staging/job-board/deployment.yml | ||
git commit -m "Update job-board-staging image to ${{ github.sha }}" | ||
git push https://${PAT}@github.com/code100x/staging-ops.git main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: Continuous Deployment (Prod) | ||
on: | ||
push: | ||
branches: [ production ] | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Docker login | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Build and push | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: . | ||
file: ./Dockerfile.prod | ||
push: true | ||
tags: 100xdevs/job-board:${{ github.sha }} | ||
|
||
- name: Clone staging-ops repo, update, and push | ||
env: | ||
PAT: ${{ secrets.PAT }} | ||
run: | | ||
git clone https://github.com/code100x/staging-ops.git | ||
cd staging-ops | ||
sed -i 's|image: 100xdevs/job-board:.*|image: 100xdevs/job-board:${{ github.sha }}|' prod/job-board/deployment.yml | ||
git config user.name "GitHub Actions Bot" | ||
git config user.email "[email protected]" | ||
git add prod/job-board/deployment.yml | ||
git commit -m "Update job-board image to ${{ github.sha }}" | ||
git push https://${PAT}@github.com/code100x/staging-ops.git main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
|
||
FROM node:20-alpine AS build | ||
ARG DATABASE_URL | ||
WORKDIR /usr/src/app | ||
COPY package*.json ./ | ||
RUN npm install | ||
COPY . . | ||
RUN DATABASE_URL=$DATABASE_URL npx prisma generate | ||
RUN DATABASE_URL=$DATABASE_URL npm run build | ||
|
||
FROM node:20-alpine AS production | ||
WORKDIR /usr/src/app | ||
COPY --from=build /usr/src/app/.next ./.next | ||
COPY --from=build /usr/src/app/node_modules ./node_modules | ||
COPY --from=build /usr/src/app/public ./public | ||
COPY --from=build /usr/src/app/package.json ./package.json | ||
CMD ["npm", "run", "start"] | ||
|
||
EXPOSE 3000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
# Project Name: Job Board | ||
|
||
[All about job board](https://marmalade-height-05f.notion.site/100xDevs-Job-board-ab8ca399180d49e4bc0c2ff5c81dfb08?pvs=25) <br/> | ||
[Job board bugs](https://marmalade-height-05f.notion.site/100xDevs-JOB-BOARD-Bugs-10115651c69c80478fc8f673a139bc60) | ||
## Table of Contents | ||
|
||
- [Description](#description) | ||
|
@@ -11,14 +12,6 @@ | |
|
||
Job Board is a platform designed to connect employers with potential employees. Employers can post job listings, and job seekers can apply for these positions. The application ensures a seamless and efficient job search and hiring process. | ||
|
||
## Features | ||
|
||
- **User Registration and Authentication**: Secure and easy registration and login for both employers and job seekers. | ||
- **Job Listings Management**: Employers can create, update, and manage job listings. | ||
- **Job Applications**: Job seekers can browse listings and apply directly through the platform. | ||
- **Profile Management**: Users can create and update their profiles with relevant information. | ||
- **Search and Filter**: Advanced search and filtering options to find the perfect job or candidate. | ||
|
||
## Technologies | ||
|
||
- **Web-app**: Next.Js, TypeScript | ||
|
@@ -44,9 +37,23 @@ Follow these steps to set up the repository locally and run it. | |
1. Create a `.env` file in the root folder of your project. Update it following the convention of the `.env.example` file. Here's an example: | ||
|
||
```bash | ||
# | ||
# Database | ||
# | ||
DATABASE_URL="postgres://postgres:password@localhost:5432/postgres" | ||
|
||
# | ||
# AUTH | ||
# | ||
NEXTAUTH_SECRET="koXrQGB5TFD4KALDX4kAvnQ5RHHvAOIzB" | ||
NEXTAUTH_URL="http://localhost:3000" | ||
|
||
# | ||
# Bunny CDN | ||
# | ||
CDN_SZ_NAME= | ||
CDN_BASE_PATH= | ||
CDN_API_KEY= | ||
``` | ||
|
||
2. To generate AUTH_SECRET, | ||
|
@@ -61,6 +68,7 @@ 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 | ||
|
@@ -95,3 +103,44 @@ Now, you can run the project and make changes as needed. | |
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" /> | ||
|
||
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" /> | ||
|
||
4. **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] | ||
|
||
<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 | ||
|
||
<img src="https://utfs.io/f/CUistsOk9f0IyM9047Pa7YvK8qbtnUAPO9jwxdskhzc2JNoR" alt=" CDN_BASE_ACCESS_URL" width="600" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/* | ||
Warnings: | ||
- You are about to drop the column `location` on the `Job` table. All the data in the column will be lost. | ||
- Added the required column `address` to the `Job` table without a default value. This is not possible if the table is not empty. | ||
- Added the required column `city` to the `Job` table without a default value. This is not possible if the table is not empty. | ||
*/ | ||
-- AlterTable | ||
ALTER TABLE "Job" DROP COLUMN "location", | ||
ADD COLUMN "address" TEXT NOT NULL, | ||
ADD COLUMN "city" TEXT NOT NULL; | ||
|
||
-- DropEnum | ||
DROP TYPE "JobLocations"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.