Skip to content

Commit b414c8e

Browse files
authored
Merge dev to prod (#231)
1 parent cc5e4fe commit b414c8e

39 files changed

+710
-1141
lines changed
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: Frontend - Build and Deploy on Azure (Dev)
2+
3+
on:
4+
push:
5+
branches: [development]
6+
paths:
7+
- "frontend/**"
8+
- ".github/workflows/azure-deploy-frontend-dev.yml"
9+
workflow_dispatch:
10+
11+
env:
12+
REGISTRY: mploycontainerregistry-hncsekeah2gagbgb.azurecr.io
13+
FRONTEND_IMAGE_NAME: nextjs-frontend
14+
15+
jobs:
16+
build-and-push:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Checkout repository
20+
uses: actions/checkout@v4
21+
22+
- name: Set up Docker Buildx
23+
uses: docker/setup-buildx-action@v3
24+
with:
25+
driver-opts: |
26+
image=moby/buildkit:latest
27+
network=host
28+
29+
- name: Log in to Azure Container Registry
30+
uses: docker/login-action@v3
31+
with:
32+
registry: ${{ env.REGISTRY }}
33+
username: ${{ secrets.ACR_USERNAME }}
34+
password: ${{ secrets.ACR_PASSWORD }}
35+
36+
- name: Build and push image (with ACR cache)
37+
uses: docker/build-push-action@v6
38+
with:
39+
context: ./frontend
40+
file: ./frontend/Dockerfile
41+
push: true
42+
tags: |
43+
${{ env.REGISTRY }}/${{ env.FRONTEND_IMAGE_NAME }}:development
44+
cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.FRONTEND_IMAGE_NAME }}:buildcache
45+
cache-to: type=registry,ref=${{ env.REGISTRY }}/${{ env.FRONTEND_IMAGE_NAME }}:buildcache,mode=max
46+
47+
deploy:
48+
needs: build-and-push
49+
runs-on: ubuntu-latest
50+
environment: development
51+
steps:
52+
- name: Azure login
53+
uses: azure/login@v2
54+
with:
55+
creds: ${{ secrets.AZURE_CREDENTIALS }}
56+
57+
- name: Deploy to Azure Container Apps (Dev)
58+
uses: azure/container-apps-deploy-action@v2
59+
with:
60+
registryUrl: ${{ env.REGISTRY }}
61+
registryUsername: ${{ secrets.ACR_USERNAME }}
62+
registryPassword: ${{ secrets.ACR_PASSWORD }}
63+
containerAppName: mploy-frontend-dev
64+
resourceGroup: ${{ secrets.AZURE_RESOURCE_GROUP_DEV }}
65+
imageToDeploy: ${{ env.REGISTRY }}/${{ env.FRONTEND_IMAGE_NAME }}:development
66+
targetPort: 3000
67+
environmentVariables: >
68+
NOTION_API_KEY=${{ secrets.NOTION_API_KEY }}
69+
NOTION_DATABASE_ID=${{ secrets.NOTION_DATABASE_ID }}
70+
MONGODB_URI=${{ secrets.MONGODB_URI }}
71+
NODE_ENV=development
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: Frontend - Build and Deploy on Azure (Prod)
2+
3+
on:
4+
push:
5+
branches: [production]
6+
paths:
7+
- "frontend/**"
8+
- ".github/workflows/azure-deploy-frontend-prod.yml"
9+
workflow_dispatch:
10+
11+
env:
12+
REGISTRY: mploycontainerregistry-hncsekeah2gagbgb.azurecr.io
13+
FRONTEND_IMAGE_NAME: nextjs-frontend
14+
15+
jobs:
16+
build-and-push:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Checkout repository
20+
uses: actions/checkout@v4
21+
22+
- name: Set up Docker Buildx
23+
uses: docker/setup-buildx-action@v3
24+
with:
25+
driver-opts: |
26+
image=moby/buildkit:latest
27+
network=host
28+
29+
- name: Log in to Azure Container Registry
30+
uses: docker/login-action@v3
31+
with:
32+
registry: ${{ env.REGISTRY }}
33+
username: ${{ secrets.ACR_USERNAME }}
34+
password: ${{ secrets.ACR_PASSWORD }}
35+
36+
- name: Set version tag
37+
id: vars
38+
run: |
39+
VERSION="v$(date +'%Y.%m.%d')-${GITHUB_RUN_NUMBER}"
40+
echo "version=$VERSION" >> $GITHUB_OUTPUT
41+
42+
- name: Build and push :production and versioned tags (with ACR cache)
43+
uses: docker/build-push-action@v6
44+
with:
45+
context: ./frontend
46+
file: ./frontend/Dockerfile
47+
push: true
48+
tags: |
49+
${{ env.REGISTRY }}/${{ env.FRONTEND_IMAGE_NAME }}:production
50+
${{ env.REGISTRY }}/${{ env.FRONTEND_IMAGE_NAME }}:${{ steps.vars.outputs.version }}
51+
cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.FRONTEND_IMAGE_NAME }}:buildcache
52+
cache-to: type=registry,ref=${{ env.REGISTRY }}/${{ env.FRONTEND_IMAGE_NAME }}:buildcache,mode=max
53+
54+
deploy:
55+
needs: build-and-push
56+
runs-on: ubuntu-latest
57+
environment: production
58+
steps:
59+
- name: Azure login
60+
uses: azure/login@v2
61+
with:
62+
creds: ${{ secrets.AZURE_CREDENTIALS }}
63+
64+
- name: Deploy to Azure Container Apps (Prod)
65+
uses: azure/container-apps-deploy-action@v2
66+
with:
67+
registryUrl: ${{ env.REGISTRY }}
68+
registryUsername: ${{ secrets.ACR_USERNAME }}
69+
registryPassword: ${{ secrets.ACR_PASSWORD }}
70+
containerAppName: mploy-frontend
71+
resourceGroup: ${{ secrets.AZURE_RESOURCE_GROUP_PROD }}
72+
imageToDeploy: ${{ env.REGISTRY }}/${{ env.FRONTEND_IMAGE_NAME }}:production
73+
targetPort: 3000
74+
environmentVariables: >
75+
NOTION_API_KEY=${{ secrets.NOTION_API_KEY }}
76+
NOTION_DATABASE_ID=${{ secrets.NOTION_DATABASE_ID }}
77+
MONGODB_URI=${{ secrets.MONGODB_URI }}
78+
NODE_ENV=production

.github/workflows/azure-static-web-apps-lively-desert-03e284d00.yml

Lines changed: 0 additions & 46 deletions
This file was deleted.

Makefile

Lines changed: 0 additions & 8 deletions
This file was deleted.

README.md

Lines changed: 63 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,22 @@
1-
# MAC Job Board
1+
# MPLOY - MAC Job Board
22

33
Hey there! 👋
44

55
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.
66

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

1321
## Frontend
1422

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

29+
### Key Patterns
30+
31+
- **State Management**: Start with props; use custom hooks for reusable logic; Context for global state (e.g., job filters).
32+
- **Data Flow**: URL as source of truth for filters/search; debounced API calls; prefetching for pagination.
33+
- **Components**: Keep thin (50-150 lines); use layouts for shared UI; mark client components with "use client".
34+
- **Features Used**: Intercepting routes for modals; Suspense for loading; Error boundaries; useMemo/useRef for optimization.
35+
36+
### Structure
37+
38+
```
39+
src/
40+
├── app/
41+
│ ├── jobs/ # Main jobs route with filters, listing, details
42+
│ │ ├── [id]/ # Dynamic job page
43+
│ │ └── error.tsx # Job-specific error handling
44+
│ ├── layout.tsx # Root layout with providers
45+
│ └── page.tsx # Home (redirects to /jobs)
46+
├── components/
47+
│ ├── jobs/ # Job cards, lists, details, filters
48+
│ └── layout/ # Nav, logo, search bar
49+
├── context/
50+
│ └── filter/ # Filter state provider
51+
└── lib/ # Utils, theme
52+
```
53+
2154
## Backend
2255

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

2962
### Prerequisites
63+
3064
- Node.js 20+
3165
- Java 17
3266
- Go 1.21+
3367
- Docker & Docker Compose
3468
- Redis
3569

3670
### Local Development
37-
```bash
38-
# Start all services
39-
docker compose -f docker-compose.dev.yml up
40-
# Alternative if Make is installed
41-
make dev
4271

43-
# Frontend only
72+
```bash
4473
cd frontend
4574
npm install
4675
npm run dev
76+
```
4777

48-
# Backend only
49-
cd backend
50-
./gradlew bootRun
78+
## Environment Variables
79+
80+
```
81+
MONGODB_URI=
82+
MONGODB_DATABASE=default
83+
MONGODB_COLLECTION=listings
84+
85+
NODE_ENV=development
5186
```
5287

5388
## Development Guidelines
5489

5590
### Git Workflow
5691

5792
#### Branch Structure
58-
- `main` - Production branch
93+
94+
- `production` - Production branch
5995
- `dev` - Development branch
6096
- Feature branches follow the pattern:
6197
```
@@ -64,6 +100,19 @@ cd backend
64100
- backend/edwn/redis-caching
65101
- frontend/sarah/job-filters
66102
```
67-
103+
104+
### Coding Conventions
105+
106+
- Use kebab-case for files (e.g., `product-card.ts`); camelCase for hooks (e.g., `useCustomHook`).
107+
- Group related components in feature directories (e.g., `components/jobs/filters/`).
108+
- Prioritize server components; use "use client" only when needed.
109+
- Build with scalability and observability in mind (e.g., structured logging with Pino).
110+
111+
## Deployment (Development and Production)
112+
113+
- We are deployed on Azure Container Apps via Github Actions.
114+
- GitHub Actions -> builds containers -> Azure Containers Registry -> Azure Container Apps.
115+
68116
## License
69-
This project is licensed under the MIT License.
117+
118+
This project is licensed under the MIT License.

backend/.gitattributes

Lines changed: 0 additions & 3 deletions
This file was deleted.

backend/.gitignore

Lines changed: 0 additions & 42 deletions
This file was deleted.

backend/Dockerfile.dev

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)