Fakultas Ilmu Komputer UI

README.md 5.97 KB
Newer Older
Luthfi Dzaky Saifuddin's avatar
Luthfi Dzaky Saifuddin committed
1
# Digipus
Luthfi Dzaky Saifuddin's avatar
Luthfi Dzaky Saifuddin committed
2
3
4
5
6
7
8
9
10
11
12

## Pipeline Status

[![pipeline status](https://gitlab.cs.ui.ac.id/pmpl/class-project/marjinal-digipus/badges/master/pipeline.svg)](https://gitlab.cs.ui.ac.id/pmpl/class-project/marjinal-digipus/commits/master)

[![coverage report](https://gitlab.cs.ui.ac.id/pmpl/class-project/marjinal-digipus/badges/master/coverage.svg)](https://gitlab.cs.ui.ac.id/pmpl/class-project/marjinal-digipus/commits/master)

## Table of Contents
- [Description](#description) 
- [Initial Setup](#initial-setup)
- [Running Development Environment](#running-development-environment)
13
- [Running Development Environment with Docker Compose](#running-development-environment-with-docker-compose)
Luthfi Dzaky Saifuddin's avatar
Luthfi Dzaky Saifuddin committed
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
- [Contributors](#contributors)

## Description

### Abstract
Digipus is a system application that can accommodate archiving educational material from regional 
apparatus, academics, and practitioners, and organizing it properly so that it becomes material for 
increasing knowledge and skills for the community at large.

There are three personas here, Admin, Contributor, and User (General Public). As admins, they monitor 
contributors and material uploaded by contributors by rejecting or approving uploaded material. 
As contributors, they can upload a material. And as a user, they can look at the material uploaded by contributor.

### Feature 
Feature that already in this project.

Admin: 
1. Login/Register as an admin.
2. Approve/Reject a material.
3. Configuration category and criteria of material.
4. Manage contributor.
5. Manage admin.
6. Edit profile.

Contributor:
1. Login/Register as an admin.
2. Upload a material.
3. Edit profile.
4. Look at statistic comments.

User: 
1. Look on a material.
2. Give comment.
3. Download or read materials.

## Initial Setup

This project uses Python 3 with Django Framework. You need to install the required
dependencies prior to building and contributing to the project.

- [Python 3.6 or newer](https://www.python.org/downloads/release/) and `pip` package
  manager.
  > Note: We recommend using _virtual environment_ to isolate project-specific
  > Python packages from system-level packages. You can install and use
  > [`virtualenv`](https://virtualenv.pypa.io/en/stable/) package to create the
  > virtual environment for this project.
60
- PostgreSQL.
Luthfi Dzaky Saifuddin's avatar
Luthfi Dzaky Saifuddin committed
61
62
63
64
65
66
67
68
69
70
71

To verify your Python is installed. Make sure
the interpreter can be invoked from the shell. For example,
in `bash` shell (macOS or GNU/Linux-based OS):
```bash
$ python3 --version
Python 3.8.2
$ pip3 --version
pip 20.0.2 from /usr/lib/python3/dist-packages/pip (python 3.8)
```

72
73
74
75
76
77
78
79
80
81
82
83
84
This project uses PostgreSQL as the database. So, add these lines to `.env` to
setup your local database-related environment variables:
```bash
IS_LOCAL=True
DB_NAME=marjinal
DB_USER=postgres      
DB_PASSWORD=postgres
DB_HOST=localhost
DB_PORT=5432
```
You can adjust `DB_NAME`, `DB_USER`, `DB_PASSWORD`, `DB_HOST`, and `DB_PORT`
based on your local configuration.

85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
Furthermore, this project utilizes Django's mail engine to send notification email
for contributors that're subscribing to new comments on their uploaded materials.
The codebase already have a class email configured as a default sender email, but you can use your own too.
To do so, please configure your `.env` to have these values:
```bash
EMAIL_HOST_USER=<your-email>@gmail.com
EMAIL_HOST_PASSWORD=<your-email-password>
```

> Note:
> Be informed that only **Google Mail accounts** that can be used, since the default SMTP server host & port are Google's.
>
> Your email also have to have [`Less secure app access` turned **on**](https://www.google.com/settings/security/lesssecureapps).
> [Reference](https://stackoverflow.com/a/26852782)
>
> If you want to use other SMTP server, please configure through env var `EMAIL_HOST` and `EMAIL_PORT`.

Luthfi Dzaky Saifuddin's avatar
Luthfi Dzaky Saifuddin committed
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
After you clone this repository, let's make sure you installed all requirements, migrate, and collect static.
```bash
pip3 install -r requirements.txt
python3 manage.py makemigrations
python3 manage.py migrate
python3 manage.py collectstatic --no-input
```

## Running Development Environment
To run the server:

```bash
python3 manage.py runserver
```

You can see the app running by going to `http://127.0.0.1:8000/` via your browser.

To run the test:
```bash
python3 manage.py test
```

To see your coverage:
```bash
coverage run --include="./*" --omit="manage.py,digipus/*,env/*" manage.py test
coverage report -m
```

You can load an some initial data with this command:
 ```bash
python3 manage.py loaddata */fixtures/initial.json 
```

135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
## Running Development Environment with Docker Compose
Requires [Docker](https://docs.docker.com/get-docker/) and [Docker Compose](https://docs.docker.com/compose/install/).

If you have already created a `.env` file, adjust its content to:
```bash
SECRET_KEY=place-your-secret-key-here
IS_LOCAL=True
DB_NAME=marjinal
DB_USER=postgres
DB_PASSWORD=postgres
DB_HOST=db
DB_PORT=5432
```

Create a `.env.db` file, fill its content with:
```bash
POSTGRES_USER=postgres
POSTGRES_PASSWORD=postgres
POSTGRES_DB=marjinal
```

To build and run the containers:
```bash
docker-compose up -d --build
```

To run the containers without rebuilding them first:
```bash
docker-compose up -d
```

To stop the containers:
```bash
docker-compose down
```

To run any command related to the DIGIPUS container:
```bash
docker-compose exec digipus <command>
```

For example, to migrate the database:
```bash
docker-compose exec digipus python manage.py migrate
```

To run any command related to the database container:
```bash
docker-compose exec db <command>
```

For example, to run `psql`:
```bash
docker-compose exec db psql -U postgres
```

Luthfi Dzaky Saifuddin's avatar
Luthfi Dzaky Saifuddin committed
191
192
193
## Contributors
This repository is one of the projects from the Software Project course.

Luthfi Dzaky Saifuddin's avatar
Luthfi Dzaky Saifuddin committed
194
195
Contributor: Marjinal x Diskominfo Depok
* Lecturer : Dr. Ade Azurat
Luthfi Dzaky Saifuddin's avatar
Luthfi Dzaky Saifuddin committed
196
197
198
199
200
201
202
203
204
* Scrum Master: Kemas Khaidar Ali
* Product Owner: Fadhlillah Zata R.
* Developer: 
    * I Gusti Putu Agastya Indrayana - 1706074940
    * Igor Lestin Sianipar - 1706023372
    * Mika Dabelza Abi - 1706022842
    * Samuel Dimas Partogi - 1706074915
    * Saul Andre Lumban Gaol - 1706023555
    
205