Skip to content

Commit

Permalink
Update folder name from api-v2 -> api and frontend-v2 -> frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
BrandonLim8890 committed Oct 22, 2023
1 parent e377149 commit e8c36c1
Show file tree
Hide file tree
Showing 298 changed files with 31 additions and 31 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ jobs:
node-version: 16
- uses: bahmutov/npm-install@v1
- run: yarn lint
run-api-v2-tests:
run-api-tests:
runs-on: ubuntu-latest
name: API V2 Tests
name: API Tests
steps:
- name: Checkout code
uses: actions/checkout@v3
Expand All @@ -26,7 +26,7 @@ jobs:
node-version: "16"
- run: yarn install --immutable
- name: Run Jest Tests
run: yarn packages/api-v2 test
run: yarn packages/apitest
build-frontend-image:
runs-on: ubuntu-latest
steps:
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ GraduateNU aims to empower Northeastern students to customize their plan of stud

1. Make sure you run the dev postgres database using `yarn dev:db:up`. Run `yarn dev:db:down` when you're done.

2. Make a copy of the packages/api-v2/.env.development and name it .env.development.local. Fill in placeholder secrets.
2. Make a copy of the packages/api/.env.development and name it .env.development.local. Fill in placeholder secrets.

3. Make a copy of the packages/api-v2/.env.testing and name it .env.testing.local. for running BE tests
3. Make a copy of the packages/api/.env.testing and name it .env.testing.local. for running BE tests

4. If you haven't run migrations in a while or this is a fresh repo, then run the migrations for the the api using `yarn packages/api-v2 dev:migration:run`. See packages/API-V2/README for more info.
4. If you haven't run migrations in a while or this is a fresh repo, then run the migrations for the the api using `yarn packages/api dev:migration:run`. See packages/api/README for more info.

5. Then run the new version of the application by running `yarn dev:v2` at the root of the project. This starts up a NestJS server + a NextJS frontend + a Proxy. The proxy listens on port [3002](http://localhost:3002/), forwards /api requests to the NestJS server running on port 3001, and all other requests to the frontend running on port 3000.

6. Visit [http://localhost:3002](http://localhost:3002/) to view the app.

To run the two separately, visit the frontend and api-v2 packages(sub directories of the monorepo).
To run the two separately, visit the frontend and api packages(sub directories of the monorepo).

## Running the prod builds in prod docker configurations locally

Expand All @@ -43,9 +43,9 @@ Example: `yarn packages/frontend lint`

The workspaces within this monorepo are:

1. **frontend-v2**: A Next.js web UI. It is what users see when they visit our application.
1. **frontend**: A Next.js web UI. It is what users see when they visit our application.

2. **api-v2**: A Nest.js API reponsible for storing and managing Graduate's data. Our frontend leans on our api for data related services.
2. **api**: A Nest.js API reponsible for storing and managing Graduate's data. Our frontend leans on our api for data related services.

3. **api-client:** A typescript client responsible for providing a streamlined and typed interface to interact with our API. The frontend uses this client to send request to our API.

Expand Down
2 changes: 1 addition & 1 deletion infrastructure/develop/docker-compose.api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ services:
ports:
- 4001:3001
env_file:
- "../../packages/api-v2/.env.development"
- "../../packages/api/.env.development"
# env vars here override the env vars in the env_file above
environment:
# we are no longer connecting to the db on localhost, the host is the name of the container
Expand Down
12 changes: 6 additions & 6 deletions infrastructure/prod/Dockerfile.app
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,21 @@ WORKDIR /app
# package.json of root and of needed packages
COPY package.json yarn.lock babel.config.js .yarnrc.yml ./
COPY .yarn .yarn
COPY packages/frontend-v2/package.json packages/frontend-v2/package.json
COPY packages/frontend/package.json packages/frontend/package.json
COPY packages/api-client/package.json packages/api-client/package.json
COPY packages/common/package.json packages/common/package.json

# Install at root level
RUN yarn install > /dev/null

# Get src files
COPY packages/frontend-v2 packages/frontend-v2
COPY packages/frontend packages/frontend
COPY packages/api-client packages/api-client
COPY packages/common packages/common

RUN yarn packages/api-client build
RUN yarn packages/common build
RUN yarn packages/frontend-v2 build
RUN yarn packages/frontend build

# Production image
FROM node:16-alpine AS runner
Expand All @@ -36,9 +36,9 @@ RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs

COPY --from=builder --chown=nextjs:nodejs /app/node_modules ./node_modules
COPY --from=builder --chown=nextjs:nodejs /app/packages/frontend-v2/public ./public
COPY --from=builder --chown=nextjs:nodejs /app/packages/frontend-v2/.next/standalone ./
COPY --from=builder --chown=nextjs:nodejs /app/packages/frontend-v2/.next/static ./.next/static
COPY --from=builder --chown=nextjs:nodejs /app/packages/frontend/public ./public
COPY --from=builder --chown=nextjs:nodejs /app/packages/frontend/.next/standalone ./
COPY --from=builder --chown=nextjs:nodejs /app/packages/frontend/.next/static ./.next/static

USER nextjs

Expand Down
6 changes: 3 additions & 3 deletions infrastructure/prod/Dockerfile.server
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@ WORKDIR /server
# package.json of root and of needed packages
COPY package.json yarn.lock babel.config.js .yarnrc.yml ./
COPY .yarn .yarn
COPY packages/api-v2/package.json packages/api-v2/package.json
COPY packages/api/package.json packages/api/package.json
COPY packages/common/package.json packages/common/package.json

# Install at root level
RUN yarn install > /dev/null

# Get src files
COPY packages/api-v2 packages/api-v2
COPY packages/api packages/api
COPY packages/common packages/common

# Build server and common dependency
RUN yarn packages/common build
RUN yarn packages/api-v2 build
RUN yarn packages/api build

FROM node:16-alpine AS runner
WORKDIR /server
Expand Down
2 changes: 1 addition & 1 deletion infrastructure/prod/entrypoint.server.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh

cd packages/api-v2
cd packages/api
yarn typeorm migration:run
exec "$@"

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
]
},
"scripts": {
"dev:v2": "concurrently \"yarn foreach '@graduate/(common|api-v2|frontend-v2|api-client)' run dev\" \"yarn dev:proxy\"",
"prod:v2": "concurrently \"yarn foreach '@graduate/(common|api-v2|frontend-v2|api-client)' run prod\" \"yarn dev:proxy\"",
"dev": "concurrently \"yarn foreach '@graduate/(common|api|frontend|api-client)' run dev\" \"yarn dev:proxy\"",
"prod": "concurrently \"yarn foreach '@graduate/(common|api|frontend|api-client)' run prod\" \"yarn dev:proxy\"",
"foreach": "yarn workspaces foreach --parallel --verbose --interlaced --include",
"dev:proxy": "node infrastructure/develop/dev-proxy.js",
"dev:db:up": "docker compose -f infrastructure/develop/docker-compose.db.yml up -d",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion packages/api-v2/README.md → packages/api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

1. Run `yarn dev:db:up` from the project root to run the database in docker. You can run `yarn dev:db:down` from the project root to take down the database when you're done.

2. Run `yarn dev` from within the api-v2 directory to run the server in watch mode.
2. Run `yarn dev` from within the api directory to run the server in watch mode.

## Testing

Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion packages/api-v2/package.json → packages/api/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@graduate/api-v2",
"name": "@graduate/api",
"version": "0.0.1",
"description": "",
"author": "",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module.exports = {
extends: "next/core-web-vitals",
settings: {
next: {
rootDir: "packages/frontend-v2/",
rootDir: "packages/frontend/",
},
},
};
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next

Run the full stack application with `yarn dev:v2` from the root of the monorepo.

To run only the frontend, use `yarn dev` from the root of this workspace(`packages/frontend-v2`).
To run only the frontend, use `yarn dev` from the root of this workspace(`packages/frontend`).

You can start editing the pages by modifying files in `pages/`. The pages auto-update as you edit the file.

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@graduate/frontend-v2",
"name": "@graduate/frontend",
"version": "0.1.0",
"private": true,
"scripts": {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2973,9 +2973,9 @@ __metadata:
languageName: unknown
linkType: soft

"@graduate/api-v2@workspace:packages/api-v2":
"@graduate/api@workspace:packages/api":
version: 0.0.0-use.local
resolution: "@graduate/api-v2@workspace:packages/api-v2"
resolution: "@graduate/api@workspace:packages/api"
dependencies:
"@golevelup/ts-jest": ^0.3.2
"@graduate/common": "workspace:*"
Expand Down Expand Up @@ -3034,9 +3034,9 @@ __metadata:
languageName: unknown
linkType: soft

"@graduate/frontend-v2@workspace:packages/frontend-v2":
"@graduate/frontend@workspace:packages/frontend":
version: 0.0.0-use.local
resolution: "@graduate/frontend-v2@workspace:packages/frontend-v2"
resolution: "@graduate/frontend@workspace:packages/frontend"
dependencies:
"@chakra-ui/icons": ^2.0.0
"@chakra-ui/react": ^2.0.0
Expand Down

0 comments on commit e8c36c1

Please sign in to comment.