2019-10-08 19:56:52 +03:00
2018-09-10 21:08:37 +03:00
2019-03-26 17:33:09 +02:00
2019-10-06 22:18:21 +00:00
2019-09-16 19:44:14 +03:00
2019-09-16 19:44:14 +03:00
2017-05-21 16:28:47 +03:00
2019-02-08 19:10:36 +02:00
2018-02-05 10:25:01 +02:00
2019-10-08 19:42:49 +03:00
2019-10-06 11:03:09 +00:00
2019-03-12 15:14:09 +02:00
2019-03-26 17:10:25 +02:00
2019-05-27 20:35:45 +03:00
2019-03-26 15:44:50 +02:00
2017-09-15 19:13:17 +03:00
2019-01-15 15:25:40 +02:00
2019-10-08 00:29:20 +03:00
2019-05-27 23:38:54 +03:00
2016-05-18 19:27:22 +03:00
2017-11-25 21:56:07 +02:00
2019-05-27 23:38:54 +03:00
2019-05-27 20:46:56 +03:00
2018-01-28 21:14:00 +02:00
2019-10-08 19:56:52 +03:00
2017-09-15 20:11:44 +03:00
2019-05-27 23:38:54 +03:00

SIKWEB 2.0

A modern web app using a Django backend and an Angular frontend.

Components

Infoscreen

Angular-based slideshow app for the guild room's screens.

Member register

Data table app for viewing and modifying the member register, member applications and membership payments.

Web app

Mostly static website with an event calendar and news feed.

Coffee scale

Shows the current coffee scale status.

Accessing the source

Clone this repository and enter it

Set up your SSH key authentication in GitLab Profile Settings. Then clone the repository and checkout the development branch:

git clone git@gitlab.com:sahkoinsinoorikilta/vtmk/web2.0-backend.git
cd web2.0-backend
git checkout develop
cp scripts/git/pre-push .git/hooks/pre-push  # install a script to test code before committing

Windows install instructions

See Windows install instructions

Linux/Mac install instructions

See Linux/Mac install instructions

Initializing data

Run the following manage.py commands. Do not run these in production without thinking!

python manage.py createdefaultadmin  # creates an admin user
python manage.py initialize          # creates user groups
python manage.py createdummydata     # creates dummy members to the member register

Running

Use runserver command

python manage.py runserver 0.0.0.0:8000

Using address 0.0.0.0 will bind to all IP addresses. Using localhost will only bind to your machine.

Visit the page

Visit https://localhost:8000 in your browser!

Running in production

Run the project in production with gunicorn. Refer to this page for instructions.

Install production dependencies.

pip install -r requirements.production.txt

Development workflow

Do not use rebase when pulling or merging changes. Rebasing transforms the commit history and makes it appear more linear. This is a plus e.g. when working with a few people, but in this project traditional merging is recommended for clarity.

When you start working on a feature, create a feature branch for your changes. These feature branches should be prefixed with feature.

Example of creating a feature branch:

git checkout -b feature-error-page

When your changes are ready and the code works without errors, submit a merge request to develop in GitLab. Another developer reviews your changes and runs the merge. Feature branches should be closed on merge.

Bugfixes do not need their own feature branches and can be pushed straight to develop, but if the fix needs a notable amount of work, it should be done in a bugfix branch instead.

Merge requests to master should be reviewed by multiple developers. Only a moderator can accept merge requests to master.

Linting

Lint python files using pycodestyle with

pycodestyle --config=setup.cfg --count .

Lint javascript and markdown using eslint and remark with

npm test

Use an editor with linting capabilities to write pretty code that passes linting. Examples include VSCode, Atom and Pycharm.

Unit tests

Run unit tests with

python manage.py test -v 2

Due to the mostly static nature of the project, most elements are difficult to properly unit test. If you write code with actual logic, make sure to write at least one unit or integration test that tests your code's core functionality.

Tests are located in tests.py under every subproject.

GitLab CI

All pushed changes go through the GitLab Continuous Integration, which consists of automated unit testing and linting. Make sure your changes pass both before merging to develop or master.

S
Description
Web 2.0 Backend. Django, Angular
Readme 21 MiB
Languages
JavaScript 54.6%
Python 36.7%
HTML 6.6%
CSS 1.8%
Shell 0.2%