1) To run the project in Docker, copy docker-compose.yml.TEMPLATE
to docker-compose.yml
2) Change the contents of docker-compose.yml
so that POLYGON_API_KEY
and JWT_SIGNING_KEY
are up to date.
3) Save the file then run docker-compose up --build
from this directory.
4) The website can be accessed from http://localhost:8000, the admin interface (admin
, Password01!
) from http://localhost:8000/admin, and the API docs from http://localhost:8000/api/docs#/
5) You can stop the container by pressing Ctrl+C
in your terminal.
6) If you want to restart with a fresh database, append --force-recreate
at the end of the docker compose command.
Install the current or LTS version for your relevant platform.
https://nodejs.org/en/download/
Verify they are working with node --version
and npm --version
.
Run npm install --global yarn
in this directory (although you can probably run it anywhere).
Verify it is working with yarn --version
.
https://code.visualstudio.com/Download
VSCode > File > Open workspace from file
, and select the projects.code-workspace
file. This should give you a view with "backend", "common", and "frontend" views. An alternative to this approach is to simply open three different windows for the three subfolders, but that's a bit clunky.
Once you have opened the workspace, select the extensions tab on the right and search @recommended
. This will bring a list of extensions I recommend you install.
Once you have done this, use Cmd+shift+p
on MacOS or Ctrl+shift+p
on other platforms to open the command pallet. Type "Reload" and select the "Developer: Reload Window" option. It's worth remembering this shortcut, as it's incredibly useful when the editor gets confused (which will be a lot).
Follow the individual readme's for each of the projects, remembering to cd
to their respective directories before running any commands.
When making a change, you should use the following workflow.
On the relevant issue page, you can use the sidebar on the right to automatically create a branch for the issue.
On your local machine, switch to the branch you have just created. You can either do this with the commands provided by GitHub in the step above, or via VSCode by:
origin/
)Make some changes to the code, ensuring you have saved as you go along. You don't have to do the whole feature at once - it's better to break it into smaller stages.
VSCode should have a handy "Source Control" pane integrated into it, which should show in the sidebar whenever you open the workspace. When you want to make a commit, you should click the "+" icon next to the files you want to commit, which should move them into "staged changes". Once you are happy with the changes, enter a short description of the change into the "message" box, and click commit.
Make sure that your changes have synced with the server by clicking the "sync" icon in the bottom left of VSCode.
Repeat steps 3-5 until you have completed the feature, and are ready to merge it into the main branch.
This step should be done periodically, to ensure that any conflicts are caught early, before they become a hassle to fix.
First, ensure that all local changes have been committed (e.g. there are no staged or unstaged files).
You should now ensure that your feature branch is up-to-date with any changes that have been made on main
. Assuming you have the "gitlens" extension installed, you can do this by:
If the operation succeeds, click the "sync" button and continue to the next step. If you get a merge conflict, then carefully resolve the conflicts (making sure you don't break your code or anyone else's), stage the files, and commit the changes. Once you've done this, click the "sync" button and continue to the next step.
Go to the repo page on GH, and open the "Pull requests" tab. Click "new pull request", and ensure that the branches are base: main <- compare: [issue-branch]
. Click "Create pull request", give it a name and a description referencing the issue (e.g. "Resolves #12"), and then click "Create Pull Request" again.
Next, post a link to the PR in the code-review
Discord channel with the format:
@everyone [PR TITLE] [PR LINK]
Anyone that wants to review the change should react with 👀, and then remove that and react with 👍 when they are happy with the changes.
If a reviewer has a question or qualm with the code, they can either leave a comment on the main PR itself, add a one-off comment to a portion of the code, or start a review. Any discussion in the Discord should be within a message thread, and not in the main code-review
channel.
You can merge the PR once:
Once you have merged the change to main, react to your message with ✅.
Whilst coding, you should commit often. A good guideline is to commit whenever you have a working version of the code with a describable change - the feature doesn't have to be complete, but it must compile and shouldn't break anyone else's code.
If there are multiple members of the team collaborating on a single issue, you should all create spin-off branches from the issue branch. For example, I might create the branch 1-create-template-for-frontend-miles
as a spin-off of 1-create-template-for-frontend-miles
. Any changes you make should be done on your personal branch, and then synced with the feature branch in the manner described above (replacing any occurences of main
with the feature branch). Once all team members are happy that the feature branch is finished, you can then sync it with main
in the manner described above.