Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

42 about page #61

Closed
wants to merge 26 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
8072b68
feat: add nextjs boilerplate app route with src | github actions
longwind48 Sep 9, 2024
9c30174
ci: change cwd for github actions to npm ci
longwind48 Sep 10, 2024
a1a0b2f
ci: change entrypoint for github actions to run
longwind48 Sep 10, 2024
cec03cf
ci: fix build to point to .next dir
longwind48 Sep 10, 2024
73b296a
ci: add caching and add export configuration for static exports
longwind48 Sep 10, 2024
38815fe
ci: rm next export from package.json
longwind48 Sep 10, 2024
ae4914f
ci: change public dir to out
longwind48 Sep 10, 2024
aa37e63
ci: adapt new frontend_old name to docker compose
longwind48 Sep 10, 2024
7912aed
cd: add target to firebase config
longwind48 Sep 10, 2024
2f2e86b
ci: add scipts in package.json to build in diff env
longwind48 Sep 10, 2024
6357b7a
docs: add instructions for dev workflow
longwind48 Sep 10, 2024
904d965
cd: add missing target
longwind48 Sep 10, 2024
b3f9c36
cd: fix missing tareget in firebase json
longwind48 Sep 10, 2024
852f8d9
cd: fix invalid firebase target
longwind48 Sep 10, 2024
72f21e7
cd: fix pathing issues for deploy stage
longwind48 Sep 10, 2024
4034f14
docs: undo changes to main readme
longwind48 Sep 10, 2024
33a63b8
#41 import nextUI and set up navbar
chunxtan Sep 28, 2024
498d0c1
#41 tweak font styling
chunxtan Sep 28, 2024
e9643f2
#41 add standard layout styling
chunxtan Sep 28, 2024
8422717
#41 add footer to layout
chunxtan Sep 28, 2024
4ab1add
#41 make navbar components interactive
chunxtan Sep 28, 2024
253c9b3
#41 remove package-lock for regeneration in actions
chunxtan Sep 28, 2024
96730d0
Merge pull request #44 from bettersg/41_set_up_frontend_scaffolding
chunxtan Oct 9, 2024
c335397
add about page
alyssaongyx Oct 10, 2024
b32c3a2
update styling
alyssaongyx Oct 10, 2024
fe611da
set up navbar to hide when scrolling
alyssaongyx Oct 10, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
44 changes: 44 additions & 0 deletions .github/workflows/firebase-hosting-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# This file was auto-generated by the Firebase CLI
# https://github.com/firebase/firebase-tools

name: Deploy to Firebase Hosting on merge
on:
push:
branches:
- stg
jobs:
build_and_deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
- name: Cache dependencies
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.OS }}-node-
- name: Cache Next.js build
uses: actions/cache@v3
with:
path: ${{ github.workspace }}/frontend/.next/cache
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}
- name: Install dependencies and build
env:
APP_ENV: staging
run: |
cd frontend
npm ci
npm run build
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: ${{ secrets.GITHUB_TOKEN }}
firebaseServiceAccount: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_SCHEMESSG_V3_DEV }}
channelId: live
projectId: schemessg-v3-dev
target: staging
entryPoint: ./frontend
21 changes: 21 additions & 0 deletions .github/workflows/firebase-hosting-pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# This file was auto-generated by the Firebase CLI
# https://github.com/firebase/firebase-tools

name: Deploy to Firebase Hosting on PR
on: pull_request
permissions:
checks: write
contents: read
pull-requests: write
jobs:
build_and_preview:
if: ${{ github.event.pull_request.head.repo.full_name == github.repository }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: npm ci && npm run build
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: ${{ secrets.GITHUB_TOKEN }}
firebaseServiceAccount: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_SCHEMESSG_V3_DEV }}
projectId: schemessg-v3-dev
30 changes: 30 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -182,3 +182,33 @@ backend/ml_logic/schemesv2-your_embeddings.npy
backend/ml_logic/schemesv2-your_index.faiss
__pycache__/
.env

# Firebase
.firebase/

# Next.js build output
out/

# Environment variables
.env.local
.env.development.local
.env.test.local
.env.production.local

# npm debug logs
npm-debug.log*

# yarn debug logs
yarn-debug.log*
yarn-error.log*

# IDE-specific files
.vscode/
.idea/

# macOS-specific files
.DS_Store

# Temporary files
*.tmp
*.swp
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,4 +155,4 @@ To add dependencies specifically for development (e.g., testing frameworks, lint

# Notes
- Ensure your Docker Desktop is running before executing any Docker commands.
- If you encounter any issues, you can pm Traci on slack or whatsapp.
- If you encounter any issues, you can pm Traci on slack or whatsapp.
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ services:
frontend:
platform: linux/amd64
build:
context: ./frontend
context: ./frontend_old
dockerfile: Dockerfile
ports:
- "9099:9099"
environment:
- PORT=9099
volumes:
- ./frontend:/app
- ./frontend_old:/app
networks:
- app-network

Expand Down
3 changes: 3 additions & 0 deletions frontend/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": ["next/core-web-vitals", "next/typescript"]
}
16 changes: 16 additions & 0 deletions frontend/.firebaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"projects": {
"default": "schemessg-v3-dev"
},
"targets": {
"schemessg-v3-dev": {
"hosting": {
"staging": [
"schemessg-v3-dev"
]
}
}
},
"etags": {},
"dataconnectEmulatorConfig": {}
}
36 changes: 36 additions & 0 deletions frontend/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js
.yarn/install-state.gz

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
.env*.local

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts
88 changes: 88 additions & 0 deletions frontend/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# 🚀 SchemesSG V3 Frontend

Welcome to the Next.js frontend for SchemesSG V3! Let's build something awesome together.

## 📚 Quick Navigation
- [Prerequisites](#prerequisites)
- [Quick Start](#quick-start)
- [Key Scripts](#key-scripts)
- [Workflow & Contributing](#workflow--contributing)
- [Deployment](#deployment)
- [Environment](#environment)
- [URLs](#urls)

## Prerequisites

Before we dive in, make sure you've got:
- 💻 Node.js (v14 or later)
- 📦 npm (v6 or later)
- 🐙 Git

## Quick Start

1. **Setup (Let's get this party started!)**
```bash
cd frontend
npm install
```

2. **Development (Where the magic happens)**
```bash
npm run dev
```
🌐 Access your creation at `http://localhost:3000`

3. **Build & Test (Time to shine)**
Staging:
```bash
npm run build:staging
npm run test-build:staging
```
Production:
```bash
npm run build:prod
npm run test-build:prod
```

## Key Scripts

- 🔥 `npm run dev`: Fire up the development server (APP_ENV=development)
- 🏗️ `npm run build:staging`: Construct for staging (APP_ENV=staging)
- 🚀 `npm run build:prod`: Launch-ready for production (APP_ENV=production)
- 🧪 `npm run test-build:staging/prod`: Build and serve locally

## Workflow & Contributing

1. 🌿 Branch out from `stg`
2. ✏️ Make your changes, focusing on `src/app/page.tsx` for main content
3. 🧪 Test locally with `npm run dev`
4. 💾 Commit and push to your branch
5. 🙋 Create a Pull Request to the `stg` branch
6. 👀 After review and approval, your changes will join the party!
7. 🚀 For production, create a PR from `stg` to `main`

## Deployment

- 🚦 **Staging**: Auto-deploys from `stg` branch
- 🚀 **Production**: Not set up yet

🤖 GitHub Actions is currently configured to automatically deploy changes from the `stg` branch to the staging environment. No manual intervention required for staging deployment!

To prepare for future production deployment:
1. 🕵️ Thoroughly investigate on staging
2. 📝 Create a PR from `stg` to `main`
3. 🎉 Once production is set up, merging to `main` will trigger deployment

Note: Production deployment will be configured in the future. Stay tuned for updates!

## Environment

- 🌍 `APP_ENV`: Set to `development`, `staging`, or `production`
- ⚙️ Configure in `next.config.mjs` and set in npm scripts

## URLs

- 🧪 Staging: [https://schemessg-v3-dev.web.app/](https://schemessg-v3-dev.web.app/)
- 🚀 Production: Not available yet

For more details on the upcoming production setup, reach out to the team lead. Happy coding! 🎉
17 changes: 17 additions & 0 deletions frontend/firebase.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"hosting": {
"target": "staging",
"public": "out",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
}
}
16 changes: 16 additions & 0 deletions frontend/next.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
// output: 'export',
env: {
APP_ENV: process.env.APP_ENV || 'development',
},
// You can add environment-specific configurations here if needed
// For example:
// publicRuntimeConfig: {
// apiUrl: process.env.APP_ENV === 'production'
// ? 'https://api.example.com'
// : 'https://staging-api.example.com',
// },
};

export default nextConfig;
Loading
Loading