forked from CodeYourFuture/Full-Stack-Project-Assessment
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Full Stack Assessment Project v2 upgrade
This is the proposed v2 update to the Full Stack Assessment Project. Main changes: 1. Use a monorepo approach based on `textbook/starter-kit/v2`, but stripped down with some parts removed to make it lighter and easier to navigate. These includes a much smaller `package.json` file with less available commands, no support for test coverage, plain `console.log` logging instead of morgan, no built-in support for helmet, and removed most of the deployment targets, keeping Netlify only. 2. Reorganized the assessment based on features instead of splitting it alongside frontend and backend. Week 1 is an MVP, Week 2 adds video embedding and the add/remove functionality, while Week 3 ends with ratings support 3. Optional features have been reorganized and expanded, one part code style improvements: linting, unit tests, e2e tests. The other part are better error handling. There are still a couple small optional product features as well. Note that the scope of the mandatory part of the project mostly remains the exact same as before, but there are some new requirements: 1. Deployment is now mandatory, with most of its setup happening during Week 1. Deployment setup is toward Netlify and Supabase using the proposed updates to the deployment section in our curriculum: CodeYourFuture/curriculum#515 2. Data validation is now mandatory on the backend side for the "Add video" feature. (It is technically still optionali, but strongly recommended through the frontend) 3. Ratings now have to be persisted to the database through the API (this was theoretically already a requirement, however due to how the assessment was worded on the backend side it effectively became an optional feature accidentally) The core repository also contains some predefined files for the frontend, backend and e2e tests to get the trainees a starting point, especially as we don't really teach them how this is done.
- Loading branch information
Showing
78 changed files
with
14,064 additions
and
35,748 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
dist/ | ||
node_modules/ | ||
.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
DATABASE_URL=postgres://cyf:password@localhost:5432/cyf | ||
TEST_DATABASE_URL=postgres://cyf:password@localhost:5432/cyf_test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"env": { | ||
"browser": true, | ||
"es6": true, | ||
"node": true, | ||
"commonjs": true, | ||
"jest/globals": true | ||
}, | ||
"extends": ["@codeyourfuture/standard", "prettier"], | ||
"parserOptions": { | ||
"ecmaVersion": 2021, | ||
"sourceType": "module" | ||
}, | ||
"plugins": ["jest"], | ||
"root": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: enforce-linting | ||
|
||
run-name: Enforce lint passes on committed files | ||
|
||
on: | ||
workflow_dispatch: | ||
#pull_request: | ||
|
||
jobs: | ||
run-linter: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: "20" | ||
cache: "npm" | ||
- run: npm install | ||
- run: npm exec prettier -- --check . | ||
- run: npm exec eslint . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
name: Reset Server | ||
run-name: Reset deployed application occasionally | ||
on: | ||
workflow_dispatch: | ||
#schedule: | ||
# - cron: "30 * * * *" | ||
|
||
jobs: | ||
pingServer: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- run: 'curl --request POST https://<your_project_name>.netlify.app/api/videos/reset -H "Content-Type: application/json" --data "{\"code\":\"$RESET_CODE\"}" || true' | ||
env: | ||
RESET_CODE: ${{ secrets.RESET_CODE }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: run-client-tests | ||
|
||
run-name: Enforce tests pass on committed files | ||
|
||
on: | ||
workflow_dispatch: | ||
#pull_request: | ||
|
||
jobs: | ||
run-client-tests: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: "20" | ||
cache: "npm" | ||
- run: cp .env.example .env | ||
- run: npm install | ||
- run: npm run test:client |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: run-e2e | ||
|
||
run-name: Enforce playwright end-to-end tests pass on committed files | ||
|
||
on: | ||
workflow_dispatch: | ||
#pull_request: | ||
|
||
jobs: | ||
run-features: | ||
runs-on: ubuntu-latest | ||
services: | ||
postgres: | ||
image: postgres | ||
env: | ||
POSTGRES_PASSWORD: password | ||
POSTGRES_USER: cyf | ||
# Set health checks to wait until postgres has started | ||
options: >- | ||
--health-cmd pg_isready | ||
--health-interval 10s | ||
--health-timeout 5s | ||
--health-retries 5 | ||
ports: | ||
- 5432:5432 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: "20" | ||
cache: "npm" | ||
- run: cp .env.example .env | ||
- run: npm install | ||
- run: npx playwright install --with-deps | ||
- run: npm run test:e2e | ||
env: | ||
NODE_ENV: test | ||
TEST_DATABASE_URL: postgres://cyf:password@localhost:5432/cyf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: run-server-tests | ||
|
||
run-name: Enforce tests pass on committed files | ||
|
||
on: | ||
workflow_dispatch: | ||
#pull_request: | ||
|
||
jobs: | ||
run-server-tests: | ||
runs-on: ubuntu-latest | ||
services: | ||
postgres: | ||
image: postgres | ||
env: | ||
POSTGRES_PASSWORD: password | ||
POSTGRES_USER: cyf | ||
# Set health checks to wait until postgres has started | ||
options: >- | ||
--health-cmd pg_isready | ||
--health-interval 10s | ||
--health-timeout 5s | ||
--health-retries 5 | ||
ports: | ||
- 5432:5432 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: "20" | ||
cache: "npm" | ||
- run: cp .env.example .env | ||
- run: npm install | ||
- run: npm run test:server | ||
env: | ||
TEST_DATABASE_URL: postgres://cyf:password@localhost:5432/cyf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
e2e/blob-report/ | ||
e2e/playwright/.cache/ | ||
e2e/playwright-report/ | ||
e2e/test-results/ | ||
node_modules/ | ||
server/static/ | ||
.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
v20.8.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"arrowParens": "always", | ||
"bracketSpacing": true, | ||
"endOfLine": "lf", | ||
"semi": true, | ||
"singleQuote": false, | ||
"trailingComma": "es5", | ||
"useTabs": true | ||
} |
Oops, something went wrong.