You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+32-29Lines changed: 32 additions & 29 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@
4
4
5
5
[Sugarizer](https://github.com/llaske/sugarizer) is the open source learning platform based on Sugar that began in the famous One Laptop Per Child project.
6
6
7
-
Sugarizer Server allow deployment of Sugarizer on a local server, for example on a school server, so expose locally Sugarizer as a Web Application. Sugarizer Server can also be used to provide collaboration features for Sugarizer Application on the network. Sugarizer Server could be deployed in a Docker container or on any computer with Node.js 6+ and MongoDB 2.6+.
7
+
Sugarizer Server allows the deployment of Sugarizer on a local server, for example on a school server, so expose locally Sugarizer as a Web Application. Sugarizer Server can also be used to provide collaboration features for Sugarizer Application on the network. Sugarizer Server could be deployed in a Docker container or on any computer with Node.js 6+ and MongoDB 2.6+.
8
8
9
9
10
10
## Running Sugarizer Server
@@ -59,6 +59,7 @@ Following is the typical content of Sugarizer Server settings file:
59
59
port = 27018
60
60
name = sugarizer
61
61
waitdb = 1
62
+
replicaset = false
62
63
63
64
[collections]
64
65
users = users
@@ -81,27 +82,27 @@ Following is the typical content of Sugarizer Server settings file:
81
82
82
83
The **[information]** section is for describing your server. It could be useful for clients connected to the server.
83
84
84
-
The **[web]** section describe the settings of the node.js process. By default, the web server is on the port 8080.
85
+
The **[web]** section describes the settings of the node.js process. By default, the web server is on the port 8080.
85
86
86
87
The **[security]** section regroup security settings. `min_password_size` is the minimum number of characters for the password. `max_age` is the expiration time in milliseconds of a session with the client. At the expiration of the session, the client should reenter its password. Default time is 172800000 (48 hours). Parameters `https`, `certificate_file`, `key_file` and `strict_ssl` are explain above.
87
88
It `no_signup_mode` is true, account creation is allowed only by an administrator or a teacher (no direct sign-up allowed by a student).
88
89
89
90
The **[client]** indicate the place where is located Sugarizer Client. Sugarizer Client is need by the server.
90
91
91
-
The **[presence]** section describe the settings of the presence server. By default, a web socket is created on port 8039. You need to change this value if you want to use another port.
92
+
The **[presence]** section describes the settings of the presence server. By default, a web socket is created on port 8039. You need to change this value if you want to use another port.
92
93
93
-
The **[database]** and **[collections]** sections are for MongoDB settings. You could update the server name (by default MongoDB run locally) and the server port. Names of the database and collections had no reason to be changed. The `waitdb` parameter allow you to force server to wait for the database.
94
+
The **[database]** and **[collections]** sections are for MongoDB settings. You could update the server name (by default MongoDB run locally) and the server port. Names of the database and collections had no reason to be changed. The `waitdb` parameter allow you to force server to wait for the database. Optionally, the `replicaset` parameter can be set to `true` to enable MongoDB Replicaset support, in this case the server name becomes the replicaset connection string.
94
95
95
96
The **[statistics]** section indicate if the server will log client usage.
96
97
97
98
The **[log]** section indicate how the server log access. If `level` value is greater than 0 or is not present, Sugarizer Server will log all access to the server on the command line.
98
99
99
-
The **[activities]** section describe information on where to find embedded activities. The favorites value list ids of activities that Web Application users will find by default on the home page. All values are self explained and had no reason to be changed.
100
+
The **[activities]** section describes information on where to find embedded activities. The favorites value list ids of activities that Web Application users will find by default on the home page. All values are self explained and had no reason to be changed.
100
101
101
102
102
103
## Dashboard
103
104
104
-
Sugarizer Server Dashboard is an admin tool for teachers and deployment administrator. This dashboard can be used to control and manage the work of learners and manage and analyze all activities on a Sugarizer Server. The Dashboard have following features:
105
+
Sugarizer Server Dashboard is an admin tool for teachers and deployment administrator. This dashboard can be used to control and manage the work of learners and manage and analyze all activities on a Sugarizer Server. The Dashboard has following features:
105
106
106
107
* Users: how many users have been registered on the server, recent users, top users on the server, create/edit/remove a user.
107
108
* Journal: how many Journals and how many entries in Journal on the server, last Journal, and last entries, edit a journal (see/update/remove) entries.
@@ -113,15 +114,15 @@ To login to the Dashboard the first time, you will have to create an admin accou
113
114
114
115
sh add-admin.sh admin password http://127.0.0.1:8080/auth/signup
115
116
116
-
Note: For security reason, the script should be launched from the local machine. On Docker, attach a new shell to the container and launch the script from this shell - in that case the port to use should be 80, not 8080.
117
+
Note: For security reasons, the script should be launched from the local machine. On Docker, attach a new shell to the container and launch the script from this shell - in that case the port to use should be 80, not 8080.
117
118
118
119
Where **admin** is the login for the new admin account and **password** is the password.
119
120
120
121
Once the admin account is created, you could access Sugarizer Dashboard on http://127.0.0.1:8080/dashboard.
121
122
122
123
## Server API
123
124
124
-
To implement the above functionalities, the sugarizer backend expose an API. The API routes look as follows:
125
+
To implement the above functionalities, the sugarizer backend exposes an API. The API routes look as follows:
125
126
126
127
127
128
#### INFORMATION ROUTE
@@ -207,43 +208,45 @@ To generate docs, run the following command in `terminal`.
Sugarizer Server comes with a script to import a set of students, administrators and classrooms from a CSV file.
213
+
Sugarizer Server comes with a script to import/delete a set of students, teachers, administrators and classrooms from a CSV file.
213
214
214
215
To launch it, run the command line:
215
216
216
217
cd sugarizer-server
217
218
export NODE_ENV=settings
218
219
node scripts/seed_users.js filename.csv
219
220
220
-
Where `settings` is the name of the .ini file to use for settings (default is `sugarizer`). `filename.csv` is the CSV who contains items to create. Here's an example of CSV file:
221
+
Where `settings` is the name of the .ini file to use for settings (default is `sugarizer`). `filename.csv` is the CSV who contains items to create/delete. Here's an example of CSV file:
*`type` is the type of account. Should be `student` or`admin`.
232
+
*`type` is the type of account. Should be `student`, `teacher`,`admin` or `delete`. If the type of set to `delete`, the user with that `name` will be deleted.
232
233
*`language` is the language for the account. If missing, the default is `en`.
233
-
*`color` is the color for the account. If missing, it's generated randomly.
234
+
*`stroke` is the stroke color for the account. If missing, it's generated randomly.
235
+
*`fill` is the fill color for the account. If missing, it's generated randomly.
234
236
*`password` is the password for the account. If missing, it's generated randomly.
235
-
*`classroom` is the classroom for the student. If a classroom with this name exist, the student is add to the classroom. If a classroom don't exist, the classroom is created first. If missing, the student is let without classroom.
237
+
*`classroom` is the classroom for the student. If a classroom with this name exists, the student is added to the classroom. If a classroom doesn't exist, the classroom is created first. If missing, the student is let without classroom.
236
238
237
-
At the end of the script a new CSV file named `output.csv` is generated. The output file has the same format than the input field with two more fields:
239
+
At the end of the script, a new CSV file named `output.csv` is generated. The output file has the same format than the input field with three more fields:
238
240
239
-
*`status` is 1 if item created, 0 if an error happened.
241
+
*`status` is 1 if item created, 2 if item deleted, 0 if an error happened.
1,Given password was invalid (Generated random password).,5d30162ced7ee117b842ad57,Nikhil,student,en,#D1A3FF,#AC32FF,l0dU,CM2
247
250
248
251
Note: For security reason, the script should be launched from the local machine. On Docker, attach a new shell to the container and launch the script from this shell - in that case the port to use should be 80, not 8080.
249
252
@@ -255,7 +258,7 @@ Few parameters in the **[security]** section of the setting file are dedicated t
255
258
256
259
* To run the server securely set `https` parameter to `true`.
257
260
*`certificate_file` and `key_file` are path to certificate and key file to sign requests.
258
-
*`strict_ssl` should be set to `false` if your certificate is a selfsigned certificate or is a certificate not signed by a trusted authority.
261
+
*`strict_ssl` should be set to `false` if your certificate is a self-signed certificate or is a certificate not signed by a trusted authority.
259
262
260
263
261
264
## Unit testing
@@ -271,27 +274,27 @@ Note that settings for unit testing are defined in [env/test.ini](env/test.ini).
271
274
272
275
# Optimize performance
273
276
274
-
If you want to optimize JavaScript performance, you could generate an optimized version of Sugarizer and Sugarizer-Server with [Grunt](http://gruntjs.com). This optimized version will minimize and reduce size of the public resources.
277
+
If you want to optimize JavaScript performance, you could generate an optimized version of Sugarizer and Sugarizer-Server with [Grunt](http://gruntjs.com). This optimized version will minimize and reduce the size of the public resources.
275
278
276
-
First ensure than Node.js and npm is installed on your machine. See [here](http://nodejs.org/) for more information.
279
+
First, ensure that Node.js and npm are installed on your machine. See [here](http://nodejs.org/) for more information.
277
280
278
-
The Gruntfile.js contains tasks settings to build an optimized version of Sugarizer and Sugarizer-Server. To do that, ensure first that Grunt is installed:
281
+
The Gruntfile.js contains task settings to build an optimized version of Sugarizer and Sugarizer-Server. To do that, ensure first that Grunt is installed:
279
282
280
283
npm install -g grunt-cli
281
284
282
-
Then navigate to Sugarizer directory install specific component for Sugarizer by running:
285
+
Then navigate to Sugarizer directory install the specific component for Sugarizer by running:
283
286
284
287
npm install
285
288
286
289
Then launch Grunt task to minify Sugarizer JavaScript files:
287
290
288
291
grunt -v
289
292
290
-
After minification, the `build` directory will contain the optimized version of each file in a same directory that the initial one, so you could just copy files:
293
+
After minification, the `build` directory will contain the optimized version of each file in the same directory as the initial one, so you could just copy files:
291
294
292
295
cp -r build/* .
293
296
294
-
Then navigate to Sugarizer-Server directory install specific component for Sugarizer-Server by running:
297
+
Then navigate to Sugarizer-Server directory install the specific component for Sugarizer-Server by running:
0 commit comments