Write some stuff in the readme
Also make a package.json for npm deps
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"name": "web2.0",
|
||||
"version": "1.0.0",
|
||||
"description": "A modern web app using a Django backend and an Angular frontend.",
|
||||
"scripts": {
|
||||
"test": "eslint ."
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git@sika.sahkoinsinoorikilta.fi:vtmk/web2.0.git"
|
||||
},
|
||||
"author": "SIK ry",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"eslint": "3.19.0"
|
||||
}
|
||||
}
|
||||
@@ -1,62 +1,62 @@
|
||||
# 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.
|
||||
|
||||
## Accessing the source
|
||||
|
||||
### Clone this repository and enter it
|
||||
|
||||
Set up your SSH key authentication in GitLab Profile Settings. Then clone the repository:
|
||||
Set up your SSH key authentication in GitLab Profile Settings. Then clone the repository and checkout the development branch:
|
||||
|
||||
```
|
||||
git clone git@sika.sahkoinsinoorikilta.fi:vtmk/web2.0.git
|
||||
cd web2.0
|
||||
```
|
||||
|
||||
Change to the development branch:
|
||||
|
||||
```
|
||||
git checkout develop
|
||||
```
|
||||
|
||||
## Install Python3
|
||||
## Install dependencies
|
||||
|
||||
Python version >3.5, pip and virtualenv are needed.
|
||||
### Dependency list
|
||||
|
||||
* Python >3.5
|
||||
* PostgreSQL >9.5
|
||||
* pip3
|
||||
* virtualenv
|
||||
* npm
|
||||
|
||||
Install with apt:
|
||||
```
|
||||
sudo apt install python3
|
||||
sudo apt install python3-pip
|
||||
sudo pip install virtualenv
|
||||
sudo apt install postgresql
|
||||
sudo pip3 install virtualenv
|
||||
sudo apt install npm
|
||||
```
|
||||
|
||||
## Install PostgreSQL
|
||||
|
||||
Version >9.5 is needed. More info at:
|
||||
More info about PostgreSQL at:
|
||||
https://www.postgresql.org/
|
||||
|
||||
Install with apt:
|
||||
```
|
||||
sudo apt install postgresql
|
||||
```
|
||||
|
||||
## Install dependencies
|
||||
|
||||
The following packages *might* need to be installed depending on your system. Find the corresponding packages
|
||||
from your distribution's repository.
|
||||
These packages might be needed on certain platforms:
|
||||
|
||||
* python3-dev
|
||||
* libffi-dev
|
||||
* python3-cffi
|
||||
* libssl-dev
|
||||
|
||||
The packages shouldn't be needed on Ubuntu 16.04, which is the most tested platform.
|
||||
|
||||
Install them with apt:
|
||||
|
||||
```
|
||||
sudo apt install python3-dev libffi-dev python3-cffi libssl-dev
|
||||
```
|
||||
|
||||
|
||||
## Create a virtual environment for python
|
||||
|
||||
Create a virtualenv in the parent directory.
|
||||
@@ -77,7 +77,7 @@ Assuming we are at the root of this repository and virtualenv is one level above
|
||||
Run the install wizard with
|
||||
|
||||
```
|
||||
sh setup.sh
|
||||
bash setup.sh
|
||||
```
|
||||
|
||||
and follow the instructions.
|
||||
@@ -90,14 +90,62 @@ and follow the instructions.
|
||||
python manage.py runserver 0.0.0.0:8000
|
||||
```
|
||||
|
||||
Using address 0.0.0.0 will bind all IP addresses.
|
||||
Using address 0.0.0.0 will bind to all IP addresses.
|
||||
|
||||
### Visit the page
|
||||
|
||||
Visit https://localhost:8000 in your browser!
|
||||
|
||||
### Run unit tests
|
||||
## Development workflow
|
||||
|
||||
When pulling changes from the server, use `rebase` instead of `merge` for a nice and clean linear history.
|
||||
|
||||
Example of pulling with rebase:
|
||||
```
|
||||
git pull --rebase
|
||||
```
|
||||
|
||||
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 `pep8` with
|
||||
|
||||
```
|
||||
pep8 --config=setup.cfg --count .
|
||||
```
|
||||
|
||||
Lint javascript using `eslint` with
|
||||
|
||||
```
|
||||
eslint .
|
||||
```
|
||||
|
||||
Use an editor with linting capabilities to write pretty code that passes linting. Examples include _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`.
|
||||
|
||||
Reference in New Issue
Block a user