clicepfl / website-archived

CLIC website software: ExpressJS web server written in TypeScript, SASS with NunjucksJS templating. 🚀 We are building v2 at https://github.com/clicepfl/clic-website-v2/ !
https://clic.epfl.ch
GNU Affero General Public License v3.0
7 stars 6 forks source link

CLIC website software

Welcome to the repository of the CLIC website software! It contains code for the web server behind clic.epfl.ch.

All decisions, features, bugs, enhancements and discussions for this repo take place in the Github issues, please have a look and exchange ideas there.

If you're contributing to this repo, you're probably either a:


Editor guides

Step-by-step instructions on how to modify the content of the website for non-developer content editors:


Technology stack

This software stack uses the following technologies:


Building and testing locally

Note: these instructions are not meant for production deployment. Please refer to the clic-website-production repository for this purpose.

You will need git, NodeJS (>= 12.13.1) installed on your operating system (Windows, Mac or Linux). Make sure that node and npm are visible on your PATH environment variable, i.e. from your command line:

node --version

should return something like v12.13.1.

Then, assuming you have setup your SSH keys, you can clone this repository:

git clone git@github.com:clicepfl/clic-website.git

Enter the newly created directory and run the installation script which will fetch the required dependencies and compile our source files such as Typescript and Sass:

cd clic-website
npm install

Once this is done, you can run the server locally with:

npm start

After this command, your terminal should hang with Web server started on port 8000 in DEBUG mode. You can then access the local server in your web browser at http://localhost:8000/.

You can stop the server by entering Ctrl+C in the terminal (this shortcut does not mean copy! It sends a SIGINT to interrupt the running process).

Installation troubleshooting

This is a list of issues that you may encounter when installing or starting the server. Feel free to add your own problems and solutions, otherwise head over to the Github issues.

Building during development

The npm install command is only required once when you first install the repository. If you then make changes to the repository, you can simply run npx gulp to compile your sources (it will be faster than npm install as it will not fetch dependencies). Then, re-start the server with npm start.


Repository hierarchy


Workflow

Features and modifications, including bug fixes, are proposed using branches and forks. The master branch of this repository is locked, meaning that each feature must be merged through a Pull Request reviewed by at least one member of the developement team. The workflow to add, modify or remove features is as follows:

  1. Announce the modification by filing a new issue in the Github issues. Describe the modification as precisely as possible. The language used in all repositories is English.

  2. Developers create a new branch for the described modification. The branch must be named {N}-hyphenized-title where {N} is the issue number attributed by Github. For instance, the issue #52 Create events page should have a branch named 52-events-page. Content editors do not need to create a new branch, they fork the repository and proceed with the instructions.

  3. Modifications are written to the new branch (resp. fork), tested and reviewed by its author. Also, do not forget to modify the corresponding documentation according to your changes, if applicable.

  4. Once all changes for this feature are finished, make sure that your branch (resp. fork) is up-to-date with the current version on master (git merge origin/master your-branch on your branch). Then, create a new pull request that compares your branch (resp. fork) against the master. Mention in the body of the pull request the associated issue number (you can type # and auto-complete). Assign another developer from the team to review your changes.

  5. The reviewer(s) carefully read the proposed modifications, test them locally and verify that they are sane. They can either accept the pull request or reject it with detailed comments by citing code and explain why the pull request is rejected. Branches cannot be merged back to master without reviews, as specified in the repository settings. This code review ensures that at least two people must read the code before deploying.

  6. Once the pull request is accepted, the original author merges the branch back to master (it may be useful to squash the commits of the branch when using the additional features of the pull request merge button). Then the author also deletes the merged branch from the branches on Github (or respectively deletes its copy of its fork). Finally, the author also closes the corresponding issue if no more work needs to be done for it.

  7. The live version must be updated by deploying after every merge on master by a developer. See the clic-website-production for instructions on how to deploy an update.


Authors and license

CLIC website software - web server of clic.epfl.ch
Copyright (C) 2020 Alexandre CHAU, Loïc DROZ, Jonathan SCANZI

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License
along with this program.  If not, see <https://www.gnu.org/licenses/>.