Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 71 additions & 0 deletions .github/workflows/azure-acr-deploy-frontend-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Frontend - Build and Deploy on Azure (Dev)

on:
push:
branches: [development]
paths:
- "frontend/**"
- ".github/workflows/azure-deploy-frontend-dev.yml"
workflow_dispatch:

env:
REGISTRY: mploycontainerregistry-hncsekeah2gagbgb.azurecr.io
FRONTEND_IMAGE_NAME: nextjs-frontend

jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
driver-opts: |
image=moby/buildkit:latest
network=host

- name: Log in to Azure Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ secrets.ACR_USERNAME }}
password: ${{ secrets.ACR_PASSWORD }}

- name: Build and push image (with ACR cache)
uses: docker/build-push-action@v6
with:
context: ./frontend
file: ./frontend/Dockerfile
push: true
tags: |
${{ env.REGISTRY }}/${{ env.FRONTEND_IMAGE_NAME }}:development
cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.FRONTEND_IMAGE_NAME }}:buildcache
cache-to: type=registry,ref=${{ env.REGISTRY }}/${{ env.FRONTEND_IMAGE_NAME }}:buildcache,mode=max

deploy:
needs: build-and-push
runs-on: ubuntu-latest
environment: development
steps:
- name: Azure login
uses: azure/login@v2
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}

- name: Deploy to Azure Container Apps (Dev)
uses: azure/container-apps-deploy-action@v2
with:
registryUrl: ${{ env.REGISTRY }}
registryUsername: ${{ secrets.ACR_USERNAME }}
registryPassword: ${{ secrets.ACR_PASSWORD }}
containerAppName: mploy-frontend-dev
resourceGroup: ${{ secrets.AZURE_RESOURCE_GROUP_DEV }}
imageToDeploy: ${{ env.REGISTRY }}/${{ env.FRONTEND_IMAGE_NAME }}:development
targetPort: 3000
environmentVariables: >
NOTION_API_KEY=${{ secrets.NOTION_API_KEY }}
NOTION_DATABASE_ID=${{ secrets.NOTION_DATABASE_ID }}
MONGODB_URI=${{ secrets.MONGODB_URI }}
NODE_ENV=development
78 changes: 78 additions & 0 deletions .github/workflows/azure-acr-deploy-frontend-prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: Frontend - Build and Deploy on Azure (Prod)

on:
push:
branches: [production]
paths:
- "frontend/**"
- ".github/workflows/azure-deploy-frontend-prod.yml"
workflow_dispatch:

env:
REGISTRY: mploycontainerregistry-hncsekeah2gagbgb.azurecr.io
FRONTEND_IMAGE_NAME: nextjs-frontend

jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
driver-opts: |
image=moby/buildkit:latest
network=host

- name: Log in to Azure Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ secrets.ACR_USERNAME }}
password: ${{ secrets.ACR_PASSWORD }}

- name: Set version tag
id: vars
run: |
VERSION="v$(date +'%Y.%m.%d')-${GITHUB_RUN_NUMBER}"
echo "version=$VERSION" >> $GITHUB_OUTPUT

- name: Build and push :production and versioned tags (with ACR cache)
uses: docker/build-push-action@v6
with:
context: ./frontend
file: ./frontend/Dockerfile
push: true
tags: |
${{ env.REGISTRY }}/${{ env.FRONTEND_IMAGE_NAME }}:production
${{ env.REGISTRY }}/${{ env.FRONTEND_IMAGE_NAME }}:${{ steps.vars.outputs.version }}
cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.FRONTEND_IMAGE_NAME }}:buildcache
cache-to: type=registry,ref=${{ env.REGISTRY }}/${{ env.FRONTEND_IMAGE_NAME }}:buildcache,mode=max

deploy:
needs: build-and-push
runs-on: ubuntu-latest
environment: production
steps:
- name: Azure login
uses: azure/login@v2
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}

- name: Deploy to Azure Container Apps (Prod)
uses: azure/container-apps-deploy-action@v2
with:
registryUrl: ${{ env.REGISTRY }}
registryUsername: ${{ secrets.ACR_USERNAME }}
registryPassword: ${{ secrets.ACR_PASSWORD }}
containerAppName: mploy-frontend
resourceGroup: ${{ secrets.AZURE_RESOURCE_GROUP_PROD }}
imageToDeploy: ${{ env.REGISTRY }}/${{ env.FRONTEND_IMAGE_NAME }}:production
targetPort: 3000
environmentVariables: >
NOTION_API_KEY=${{ secrets.NOTION_API_KEY }}
NOTION_DATABASE_ID=${{ secrets.NOTION_DATABASE_ID }}
MONGODB_URI=${{ secrets.MONGODB_URI }}
NODE_ENV=production

This file was deleted.

8 changes: 0 additions & 8 deletions Makefile

This file was deleted.

77 changes: 63 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
# MAC Job Board
# MPLOY - MAC Job Board

Hey there! 👋

This is a modern, intelligent job board platform that automatically aggregates job listings, providing users with a streamlined experience to search, filter, and discover relevant opportunities. The platform updates daily with fresh listings through our smart AI robots.

## Features 🚀

- Jobs update automatically every single day from various sources (automatically deduplicated)
- We use AI to help fix, sort and summarise the listings
- You can filter for exactly what you want (e.g. Big Tech Intern Roles for Interational students)
- You can filter for exactly what you want (e.g. Big Tech Intern Roles for International students)
- Works perfectly on phone or laptop
- Server-side rendering (where possible) with Next.js 15 App Router
- Multiple filters can be applied at once, including text search
- Desktop/mobile responsive UI: list/details on desktop, modal on mobile
- State persists in URL: search, filters, pagination (`/jobs?q=dev&location=sydney&page=2`)
- Direct job links supported (`/jobs/[id]`)
- Parallel data fetching for faster loads
- Real-time job search with debouncing

## Frontend

Expand All @@ -18,6 +26,31 @@ This is a modern, intelligent job board platform that automatically aggregates j
- Mantine UI: For consistent, accessible UI components
- Tailwind CSS: For utility-first styling and responsive design

### Key Patterns

- **State Management**: Start with props; use custom hooks for reusable logic; Context for global state (e.g., job filters).
- **Data Flow**: URL as source of truth for filters/search; debounced API calls; prefetching for pagination.
- **Components**: Keep thin (50-150 lines); use layouts for shared UI; mark client components with "use client".
- **Features Used**: Intercepting routes for modals; Suspense for loading; Error boundaries; useMemo/useRef for optimization.

### Structure

```
src/
├── app/
│ ├── jobs/ # Main jobs route with filters, listing, details
│ │ ├── [id]/ # Dynamic job page
│ │ └── error.tsx # Job-specific error handling
│ ├── layout.tsx # Root layout with providers
│ └── page.tsx # Home (redirects to /jobs)
├── components/
│ ├── jobs/ # Job cards, lists, details, filters
│ └── layout/ # Nav, logo, search bar
├── context/
│ └── filter/ # Filter state provider
└── lib/ # Utils, theme
```

## Backend

- Server Actions: Answers search and feedback requests
Expand All @@ -27,35 +60,38 @@ This is a modern, intelligent job board platform that automatically aggregates j
## Getting Started

### Prerequisites

- Node.js 20+
- Java 17
- Go 1.21+
- Docker & Docker Compose
- Redis

### Local Development
```bash
# Start all services
docker compose -f docker-compose.dev.yml up
# Alternative if Make is installed
make dev

# Frontend only
```bash
cd frontend
npm install
npm run dev
```

# Backend only
cd backend
./gradlew bootRun
## Environment Variables

```
MONGODB_URI=
MONGODB_DATABASE=default
MONGODB_COLLECTION=listings

NODE_ENV=development
```

## Development Guidelines

### Git Workflow

#### Branch Structure
- `main` - Production branch

- `production` - Production branch
- `dev` - Development branch
- Feature branches follow the pattern:
```
Expand All @@ -64,6 +100,19 @@ cd backend
- backend/edwn/redis-caching
- frontend/sarah/job-filters
```


### Coding Conventions

- Use kebab-case for files (e.g., `product-card.ts`); camelCase for hooks (e.g., `useCustomHook`).
- Group related components in feature directories (e.g., `components/jobs/filters/`).
- Prioritize server components; use "use client" only when needed.
- Build with scalability and observability in mind (e.g., structured logging with Pino).

## Deployment (Development and Production)

- We are deployed on Azure Container Apps via Github Actions.
- GitHub Actions -> builds containers -> Azure Containers Registry -> Azure Container Apps.

## License
This project is licensed under the MIT License.

This project is licensed under the MIT License.
3 changes: 0 additions & 3 deletions backend/.gitattributes

This file was deleted.

42 changes: 0 additions & 42 deletions backend/.gitignore

This file was deleted.

7 changes: 0 additions & 7 deletions backend/Dockerfile.dev

This file was deleted.

Loading