Skip to content

Commit f249be0

Browse files
committed
docs: add notice about the migration
1 parent cf992a5 commit f249be0

File tree

1 file changed

+1
-105
lines changed

1 file changed

+1
-105
lines changed

CONTRIBUTE.md

Lines changed: 1 addition & 105 deletions
Original file line numberDiff line numberDiff line change
@@ -1,105 +1 @@
1-
# Updating/Adding a demo project
2-
3-
## Project structure
4-
5-
All projects should have `start` and `test` scripts in their package.json's
6-
scripts section. `start` is necessary, since `pm2` will use it to start the
7-
project. `test` is optional, but recommended to ensure that, at bare minimum,
8-
the project can be started.
9-
10-
### Projects with build steps
11-
12-
If the project needs building starting `start` can be run, the build script must be
13-
called by the `prepare` script. If this is done, the workflow below trigger the build automatically.
14-
15-
If bundling is required, please follow the example of `build-a-pinterest-clone` and use `rollup` to bundle the project.
16-
17-
## How do I update everything in one go?
18-
19-
- SSH into the VM with `ssh freecodecamp@<ip>`
20-
- Run all the commands in `./scripts/update.sh`
21-
22-
### But just wanted to run a single script!
23-
24-
Fine. You can just run
25-
26-
```sh
27-
./scripts/update.sh
28-
```
29-
30-
but I _strongly_ recommend at least reading it first. Just in case it has not been updated to match new workflows.
31-
32-
## After a PR has been merged to the demo-projects repo:
33-
34-
- SSH into the VM with `ssh freecodecamp@<ip>`
35-
- `cd` to the `demo-projects` folder
36-
- `git fetch —all` to get new changes
37-
- `git pull origin main` to add the new changes
38-
39-
## If updating all projects:
40-
41-
- If needed: update packages
42-
- `npm ci --production`
43-
- If any enviroment variables have changed, update those projects' `.env` files.
44-
45-
### Reload all projects:
46-
47-
- `npm run reload`
48-
49-
## If updating a single project:
50-
51-
- If needed: update packages
52-
- `npm ci --production -w=apps/project-name` to update modules
53-
- If the enviroment variables have changed, update the `.env` file.
54-
- `pm2 list` to confirm that `project-name` is the name of the process.
55-
56-
### Reload the project:
57-
58-
- `npm run reload -- --only=<project-name>`
59-
60-
## If adding a new project:
61-
62-
### Make the PR's
63-
- In the `demo-projects` repo
64-
- Make sure the new project is in the `port-map.json` file. Update also `package.json` and `package-lock.json`
65-
- In the `demo-projects-nginx-config` repo, configure the new app:
66-
- Add config in `/sites-enabled/10-freecodecamp.rocks.conf` by copying config for one of the other projects and changing the names
67-
- Also add the title at the top of that file
68-
- Then, add the project with its port in `configs/upstreams.conf` like the others
69-
70-
### In the VM
71-
- ssh into the VM
72-
- update the nginx config:
73-
- `cd` to the `/etc/nginx` folder
74-
- Use `sudo` for the next few commands if you get a permission denied error
75-
- `git fetch --all` to get new changes
76-
- `git pull origin main` to add new changes
77-
- Reload `nginx` with the new config using `sudo nginx -s reload`
78-
- update the demo projects:
79-
- `cd` into the `~/demo-projects` folder
80-
- `git fetch --all` to get the new changes
81-
- `git pull origin main` to add new changes
82-
- run `npm ci` to install dependencies for all the projects
83-
- Add anything needed in any of the projects - likely a `.env` file with values
84-
- `cd` into the `~/demo-projects/apps` folder
85-
- Start the project with `npm start -- --only=<project-name>`
86-
87-
### Add the new subdomains to Cloudflare
88-
- Add the `https://<project>.freecodecamp.rocks` URL to our [Cloudflare](https://www.cloudflare.com/) by:
89-
- Going to our [Cloudflare Dashboard](https://dash.cloudflare.com/)
90-
- Open the `freecodecamp.rocks` domain
91-
- Click the `DNS` button at the top
92-
- Click `Add record`
93-
- Set the new record to `type` `A`
94-
- Set the new record `name` to the name of the project (sub-domain)
95-
- Set the new record `IPv4 address` to the ip of the VM
96-
- Click `save`
97-
98-
## After changing node version
99-
100-
Run
101-
102-
- `pm2 unstartup systemd`
103-
- `pm2 startup`
104-
105-
Then run the command it says to run. Now it should restart after VM reboots.
1+
Note: See https://github.com/freeCodeCamp/demo-projects/issues/403

0 commit comments

Comments
 (0)