Skip to content

Commit 2699f2a

Browse files
thomasyzy7kevin-lannAustin-Xminhhaitran08MasahisaSekita
authored
Release/1.2 - Main (#60)
Co-authored-by: Kevin Lan <[email protected]> Co-authored-by: Austin-X <[email protected]> Co-authored-by: minhhaitran08 <[email protected]> Co-authored-by: Masahisa Sekita <[email protected]> Co-authored-by: Austin-X <[email protected]> Co-authored-by: dawangk <[email protected]> Co-authored-by: kevin-lann <[email protected]> Co-authored-by: MasahisaSekita <[email protected]>
1 parent 6def085 commit 2699f2a

File tree

174 files changed

+25331
-4013
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

174 files changed

+25331
-4013
lines changed

.github/workflows/testing.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: Run Tests
2+
on: push
3+
jobs:
4+
build:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@v2
8+
- name: Run frontend tests
9+
run: cd course-matrix/frontend && npm install && npm run test
10+
- name: Run backend tests
11+
run: cd course-matrix/backend && npm install && npm run test

.github/workflows/workflow.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Format the code
2+
3+
on:
4+
push:
5+
6+
jobs:
7+
format:
8+
runs-on: ubuntu-latest
9+
name: Format Files
10+
steps:
11+
- uses: actions/checkout@v3
12+
- uses: actions/setup-node@v3
13+
with:
14+
node-version: "20"
15+
- name: Prettier
16+
run: npx prettier --write **/*.{js,ts,tsx,json,md}
17+
env:
18+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
19+
- uses: stefanzweifel/git-auto-commit-action@v4
20+
if: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }}
21+
with:
22+
commit_message: "Auto-formatted the code using Prettier"

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,17 +49,20 @@ PORT=8081
4949
CLIENT_APP_URL="http://localhost:5173"
5050
DATABASE_URL=[Insert Supabase Project URL]
5151
DATABASE_KEY=[Insert Supabase Project API key]
52+
53+
OPENAI_API_KEY=[Insert OpenAI API Key]
54+
PINECONE_API_KEY=[Insert Pinecone API Key]
55+
PINECONE_INDEX_NAME="course-matrix"
5256
```
5357

54-
The `DATABASE_URL` variable should contain your Supabase project url and the `DATABASE_KEY` should contain your Supabase project’s API key. To learn how to create a new Supabase project: see [here](https://medium.com/@heshramsis/building-a-crud-app-with-supabase-and-express-a-step-by-step-guide-for-junior-developers-81456b850910). Note that for the purposes of this project, we will provide the grader with all necessary API keys and URLs.
58+
The `DATABASE_URL` variable should contain your Supabase project url and the `DATABASE_KEY` should contain your Supabase project’s API key. To learn how to create a new Supabase project: see [here](https://medium.com/@heshramsis/building-a-crud-app-with-supabase-and-express-a-step-by-step-guide-for-junior-developers-81456b850910). Likewise, the `OPENAI_API_KEY` variable should contain your OpenAI Project API Key and the `PINECONE_API_KEY` should contain your Pinecone Project API Key. Note that for the purposes of this project, **we will provide the grader with all necessary API keys and URLs**.
5559

5660
4. Configure environment variables for frontend. Create a `.env` file in `/frontend` and populate it with the following:
5761

5862
```
5963
VITE_SERVER_URL="http://localhost:8081"
6064
```
6165

62-
6366
### Running the Application
6467

6568
To run the application locally:
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { describe, test, expect } from "@jest/globals";
2+
import request from "supertest";
3+
import app from "../src/index";
4+
5+
describe("Sum function", () => {
6+
test("Returns correct value", () => {
7+
expect(2 + 3).toEqual(5);
8+
});
9+
});
10+
11+
// Will finish the rest of the tests below in Sprint 3
12+
13+
// describe("GET /auth/session", () => {
14+
// test("It should respond with 200 status", async () => {
15+
// const response = await request(app).get("/auth/session");
16+
// expect(response.statusCode).toBe(200);
17+
// });
18+
// });
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import type { Config } from "jest";
2+
3+
const config: Config = {
4+
preset: "ts-jest",
5+
moduleNameMapper: {
6+
"\\.(css|scss)$": "identity-obj-proxy",
7+
"^.+\\.svg": "<rootDir>/tests/mocks/svgMock.tsx",
8+
},
9+
// to obtain access to the matchers.
10+
setupFilesAfterEnv: ["<rootDir>/tests/setupTests.ts"],
11+
moduleFileExtensions: ["ts", "tsx", "js", "jsx", "json", "node"],
12+
modulePaths: ["<rootDir>"],
13+
testEnvironment: "jsdom",
14+
transform: {
15+
"^.+\\.(ts|tsx)$": [
16+
"ts-jest",
17+
{
18+
tsconfig: "tsconfig.test.json",
19+
},
20+
],
21+
"^.+\\.(js|jsx)$": "babel-jest",
22+
},
23+
};
24+
25+
export default config;

0 commit comments

Comments
 (0)