Skip to content
This repository was archived by the owner on Nov 7, 2025. It is now read-only.

Commit 3e91cd9

Browse files
committed
Prepare CYF fork
1 parent 2de9a4d commit 3e91cd9

File tree

11 files changed

+63
-458
lines changed

11 files changed

+63
-458
lines changed

.github/CODE_OF_CONDUCT.md

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

.github/CONTRIBUTING.md

Lines changed: 0 additions & 19 deletions
This file was deleted.
File renamed without changes.
File renamed without changes.

.github/workflows/keepalive.yml

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

.github/workflows/push.yml

Lines changed: 5 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,8 @@ on:
88
workflow_dispatch:
99

1010
jobs:
11-
windows:
12-
runs-on: windows-latest
13-
steps:
14-
- uses: textbook/take-action@nodejs
15-
with:
16-
node-version: 22
17-
- run: npm run lint
18-
1911
nodejs:
20-
strategy:
21-
fail-fast: false
22-
matrix:
23-
node: [20.19, 20, 22, 24]
2412
runs-on: ubuntu-latest
25-
outputs:
26-
lcov-artifact-id: ${{ steps.upload-lcov.outputs.artifact-id }}
2713
services:
2814
postgres:
2915
image: postgres:17-alpine
@@ -39,21 +25,19 @@ jobs:
3925
- 5432:5432
4026
env:
4127
DATABASE_URL: postgres://testdb:keepitsecret@localhost:5432/testdb
42-
LOG_LEVEL: debug
4328
steps:
4429
- uses: textbook/take-action@nodejs
4530
with:
46-
node-version: ${{ matrix.node }}
31+
node-version: 22
4732
- uses: textbook/take-action@playwright
4833
- run: npm run lint
4934
- run: npm run test:cover
5035
env:
5136
FORCE_COLOR: true
5237
- uses: actions/upload-artifact@v4
53-
id: upload-lcov
5438
if: vars.ENABLE_COVERALLS == 'true'
5539
with:
56-
name: lcov-${{ matrix.node }}
40+
name: lcov
5741
path: coverage/lcov.info
5842
if-no-files-found: error
5943
- run: npm run migration up
@@ -62,19 +46,18 @@ jobs:
6246

6347
coverage:
6448
runs-on: ubuntu-latest
65-
needs: [nodejs]
66-
if: always() && vars.ENABLE_COVERALLS == 'true' && needs.nodejs.outputs.lcov-artifact-id
49+
if: vars.ENABLE_COVERALLS == 'true'
6750
environment:
6851
name: coveralls
6952
url: https://coveralls.io/github/${{ github.repository }}
53+
needs: [nodejs]
7054
steps:
7155
- uses: actions/checkout@v4
7256
- run: |
7357
curl -L https://coveralls.io/coveralls-linux.tar.gz | tar -xz -C /usr/local/bin
7458
- uses: actions/download-artifact@v4
7559
with:
76-
artifact-ids: ${{ needs.nodejs.outputs.lcov-artifact-id }}
77-
merge-multiple: true
60+
name: lcov
7861
path: coverage/
7962
- run: coveralls report coverage/lcov.info
8063
env:
@@ -126,7 +109,6 @@ jobs:
126109
- run: npx --yes wait-on --log --timeout 30000 http-get://localhost:4321
127110
- run: npm run e2e
128111
env:
129-
LOG_LEVEL: debug
130112
PLAYWRIGHT_BASE_URL: http://localhost:4321
131113
- if: always() && steps.docker-run.outputs.id
132114
run: docker logs ${{ steps.docker-run.outputs.id }}

README.md

Lines changed: 58 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,45 @@
1212
- [x] Dev mode (watch modes for client and server, proxy to avoid CORS issues)
1313
- [x] Production build (single deployment artifact)
1414
- [x] [GitHub Actions] pipeline
15-
- [x] [Google App Engine], [Heroku], [Render] or [Vercel] deployment
15+
- [x] [Coolify], [Google App Engine], [Heroku], [Render] or [Vercel] deployment
1616
- [x] [Docker] build
17-
- [x] [Dev Containers] integration
17+
18+
## Setup
19+
20+
> **Note** if you have _any problems_ setting up the starter kit, see the [wiki] and, if still not solved, post to
21+
> [`#cyf-full-stack-starter-kit` in Slack][2].
22+
23+
Pick one member of the team to own the repository and pipeline. That person should do the following:
24+
25+
1. Click the "Use this template" button above (see [GitHub's docs][1]) to create your team repository and name it something appropriate for your project.
26+
- Your repo should say _"generated from"_, **not** _"forked from"_, _"CodeYourFuture/cyf-final-project-starter-kit"_ at the top
27+
28+
2. Make sure all of the project team are [collaborators] on the repository.
29+
30+
### Deploy to Coolify
31+
32+
This repo will work with the [Nixpack Node provider's][nixpacks-node] defaults, so deployment should be straightforward.
33+
34+
1. Create a new project
35+
36+
2. In the default "production" environment, create a Postgresql database
37+
- Choose the default type
38+
- Once it has started up, copy the "Postgres URL (internal)"
39+
40+
3. Also in the default "production" environment, create a "Git Based > Public Repository" resource
41+
- Choose your repository URL
42+
- Under "Environment Variables", set `PGSSLMODE` to `disable` and `DATABASE_URL` to the URL you copied above
43+
- Under "Healthcheck", check "Enabled", set the Path to `/healthz` and the Return Code to 301
44+
- Under "Webhooks", copy the "Manual Git Webhooks > GitHub" URL then follow the link to "Webhook configuration on GitHub" to add this to your repo
45+
- Use the command `python3 -c 'import secrets;print(secrets.token_hex(16))'` to generate a good secret
46+
47+
### Deploy to Render
48+
49+
[![Deploy to Render](https://render.com/images/deploy-to-render-button.svg)](https://render.com/deploy)
50+
51+
1. In your repo, click the "Deploy to Render" button in the relevant section of the README and log in using GitHub when prompted.
52+
2. Fill in a service group name for your application and then click "Apply".
53+
3. Once it has deployed successfully, click the "managed resources" link to view the application details.
1854

1955
## Scripts
2056

@@ -25,27 +61,44 @@ commonly use:
2561
- `e2e`: builds and starts the app in production mode and runs the Playwright tests against it.
2662
- `e2e:dev`: builds and starts the app in dev mode and runs the Playwright tests against it.
2763
- `lint`: runs ESLint and Prettier against all the relevant files in the project.
28-
- `format`: reformats the code with Prettier.
29-
- `lint:fix`: attempts to fix all ESLint and Prettier violations.
3064
- `serve`: builds and starts the app in production mode locally.
3165
- `ship`: runs `lint`, then `test`, then `e2e`; ideal before a `git push`.
3266
- `test`: runs the unit and integration tests.
3367
- `test:cover`: runs the tests and outputs coverage data.
3468

35-
[Dev Containers]: https://code.visualstudio.com/docs/devcontainers/containers
69+
### Security
70+
71+
If the project handles **any kind of** Personally Identifiable Information (PII) then make sure the following
72+
principles are followed:
73+
74+
- Only collect **strictly necessary** PII;
75+
- Access to PII should be as restricted as possible;
76+
- Access to PII should only be possible after authentication. Authentication **must be done** via GitHub. **Ad hoc
77+
authentication solutions are not allowed**;
78+
- Admins must be able to control who has access to the platform and at which levels using only GitHub groups;
79+
- There must be an audit mechanism in place. It is required by law to know who accessed what and when;
80+
- Code must be reviewed by senior developers before being pushed to production;
81+
- APIs must be secure. Make sure we are not handling security on the frontend.
82+
83+
[1]: https://docs.github.com/en/free-pro-team@latest/github/creating-cloning-and-archiving-repositories/creating-a-repository-from-a-template#creating-a-repository-from-a-template
84+
[2]: https://codeyourfuture.slack.com/archives/C021ATWS9A5
85+
[collaborators]: https://help.github.com/en/articles/inviting-collaborators-to-a-personal-repository
86+
[Coolify]: https://coolify.io/
3687
[Docker]: https://www.docker.com
3788
[ESLint]: https://eslint.org/
3889
[Express]: https://expressjs.com/
3990
[GitHub Actions]: https://github.com/features/actions
4091
[Google App Engine]: https://cloud.google.com/appengine/?hl=en
4192
[Heroku]: https://www.heroku.com/
4293
[Morgan]: https://github.com/expressjs/morgan
94+
[nixpacks-node]: https://nixpacks.com/docs/providers/node
4395
[Node]: https://nodejs.org/en/
4496
[node-postgres]: https://node-postgres.com/
4597
[node-test]: https://nodejs.org/api/test.html
4698
[Playwright]: https://playwright.dev/
4799
[Postgres]: https://www.postgresql.org/
48100
[Prettier]: https://prettier.io/
101+
[pull request]: https://help.github.com/en/articles/about-pull-requests
49102
[React]: https://reactjs.org/
50103
[React Router]: https://reactrouter.com/en/main
51104
[Render]: https://render.com/

bin/cyf.sh

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

0 commit comments

Comments
 (0)