Website for the UofT CloudClub.
Important: to follow this section first ensure you've installed all requirements in the previous section - git, Node, VS Code, and XAMPP
git clone https://github.com/CloudClub-uoft/cloud-club-website
using the terminal and enter your credentials.
git clone https://github.com/CloudClub-uoft/cloud-club-website
Terminal
tab at the top, then New Terminal
npm install
in the terminal, then hit enter. This will install all the necessary packages to make our website run.env
at the root of the cloned repository (the cloud-club-website folder). The file should be named exactly as .env (pronounced dotenv) and paste in it the environment variables shared by the project administrator (Qingyuan). To make a new file in VS Code, hover over the left panel displaying the open files and hit the new file button near the top right of the panel. Make sure the file is in the cloud-club-website folder, not another folder!node .
in the terminal at the root of the repository.localhost:PORT
in your browser. Here PORT
is a placeholder for the port number specified by the "PORT" variable in the .env file. The default is 4000.
cloudclub.ca
, then congrats! Your setup is completelocalhost:PORT
views/index.ejs
What is CloudClub?
to Hello World
, type Ctrl + S
(Windows) or Cmd + S
(Mac) to saveCtrl + C
(Windows and Mac) to exitnode .
again or use the up-arrow key to restart the serverHello World
Note: The sections below will not be necessary for a first-time setup. They will come into play after you start making changes to the website
git branch
to verify you are currently on the staging branchgit pull
to update your local branch (this is like "refreshing" your Google Docs to get changes from your teammates)git checkout -b <branch-name>
to create a new branch and move to that branch
<branch-name>
should be your name, a verb describing the type of change, and what you're changing, something like wu_patch_edit_posts
git branch
again to verify you are at this new branch. Important: you must be at your own branch, not staging, before you make changesgit status
to check the files you've changed. The files you modified should all be in red git add <file1> <file2> <file3> ...
to stage the files you've changed for commit. Tip: simply copy the files you see from the previous step
git add .
. Be sure you're not doing this blindly as you may include unintended files in the commit.git status
again to make sure only the intended files have been staged for commit (turned green).git commit -m "<your message>"
to commit these files. The message you write should be a one-sentence description of your change.git push
to push the changes to the remote. If you get an error, simply follow the instructions and specify an upstream branch (git push --set-upstream origin ....
)git diff
to see how your local changes compare to the original version of the websitegit log
to get the list of previous commits (both by you and other developers) in reverse chronological ordergit rebase origin/staging
to fast-forward your local branch to stay up to date with the remote branch
git checkout -b <branch-name>
to make changes locally in another branch. Before you submit these changes, perhaps your peers also made more changes and uploaded the more updated version to Google Drive. In this case you will wish to first incorporate their changes in your local Word Doc - this is analogous to running git rebase origin/staging
git log
after you rebase to see what new chnages you have pulled in from your teammatesThe Selenium framework for Python is required for frontend testing. During tests a properly configured MySQL instance should be accessible by the website server.
python -m pip install selenium
NOTE: A Selenium webdriver must be accessible via the PATH variable. Documentation.
All frontend tests are stored under the test/frontend directory. A test can be invoked by executing the test script inside one of the test directories.
python test_forum.py
Review Code Formatting and Standards Document. Link
Setup VSCode workspace for linting and formatting. Link (Slide 12)
METHOD-name
, i.e. GET-post
/name?param=:PLACEHOLDER
, i.e. /post?id=:POSTID
data
has data.field
module.exports = (app, db, redis) => { ... }
even if the function doesn't use DB or Redis connections. Do require
in routing.js
and pass to all imported route files.node .
, I'm getting this redis error:Redis connection failed: Error: Redis connection to redis-17266.c8.us-east-1-2.ec2.cloud.redislabs.com:17266 failed - getaddrinfo ENOTFOUND redis-17266.c8.us-east-1-2.ec2.cloud.redislabs.com
command + space bar
(Mac), search for Visual Studio Code
Where do I run git clone command?
Open in Terminal
command + space bar
and search for terminal, click enter)cd <directory>
. For example, if you wish to put it in the Documents directory you would type cd Documents
This error:
C:\Users\qingy\OneDrive\Documents\webDev\cloud-club-website\config\sql-db.js:16
if (err) throw err
^
Error: connect ENOENT 3306
at PipeConnectWrap.afterConnect [as oncomplete] (net.js:1148:16) {
errno: -4058,
code: 'ENOENT',
syscall: 'connect',
address: '3306,
fatal: true
}
Make sure XAMPP is enabled!