docs
[oweals/finalsclub.git] / README.md
1
2 # Finals Club (FC)
3
4 This is the source code repository for [finalsclub.org](http://finalsclub.org/).
5
6 FC is a 501(c)(3) non-profit open education project dedicated to
7 helping college students collaborate, learn, and share their knowledge freely online.
8
9
10 # Installing
11
12 Requirements:
13
14 - Linux server (circa 2011)
15 - Node.js (Version 0.4.10 or later)
16 - MongoDB (Version  1.8.2 or later)
17
18 ## Quick start for a single server installation
19
20         $ pwd
21         /home/you
22         $ git clone git@github.com:/finalsclubdev/FinalsClub fc
23         $ cd fc
24         $ git submodule init
25         $ git submodule update
26
27         [[ flesh this out with correct commands - reference util scripts - fix util scripts ]]
28
29
30 # Database
31
32 The database is MongoDB.
33 MongoDB is not a relational database, but rather a noSQL or "document/object" based database.
34 Data is stored as structured objects versus tables and rows.
35 (More about MongoDB)[http://mongodb.org].
36
37 ## Collections
38
39 - archivedcourses
40         [[ schema needed ]]
41 - archivednotes
42         [[ schema needed ]]
43 - archivedsubjects
44         [[ schema needed ]]
45 - courses
46         [[ schema needed ]]
47 - lectures
48         [[ schema needed ]]
49 - notes
50         [[ schema needed ]]
51 - posts
52         [[ schema needed ]]
53 - schools
54         [[ schema needed ]]
55 - sessions
56         [[ schema needed ]]
57 - users
58         [[ schema needed ]]
59
60
61
62 # Source Code
63
64 The source code for the website itself consists of these main parts:
65
66 - The collaborative, real-time editor
67 - The back channel
68 - The surrounding website
69
70 These 3 pieces are written in Javascript for Node.js.
71
72 ## The Collaborative Real-time Editor 
73
74 The real-time editor is an embedded editor called
75 [Etherpad-Lite](https://github.com/Pita/etherpad-lite) (EPL).
76 It provides the ability for multiple people to simultaneously edit a single document.
77 The documents in FC are the notes for a specific lecture.
78
79 EPL is installed as a git submodule to the main FC source tree with the name "etherpad-lite".
80
81
82 ## The Back Channel (BC)
83
84 The back channel portion of FC is implemented with ["BC"](https://github.com/FinalsClubDev/bc).
85 BC allows the note takers, or anyone else who is just observing,
86 to suggest questions for the lecturer, and vote on each other's questions.
87 It also allows people to post commentary.
88
89 Although the actual BC code was written for FC, it has been extracted from the original
90 FC source and turned into an independent open source project.
91
92 BC is installed as a git submodule to the main FC source tree with the name "bc".
93
94
95 ## The Surrounding Website
96
97 This is the FC website, which brings together the other two elements into
98 a single website that serves it's stated purpose (above).
99 This would be the home page, privacy policy page, the page that lists the participating
100 schools, the sub pages containing lists of lectures and note taking sessions, and the
101 core page where EPL and BC are both found along side each other. 
102
103 Several node modules are leveraged to to make the basic website work:
104
105 - (async)[URL]
106 - (aws-lib)[URL]
107 - (connect)[URL]
108 - (connect-mongo)[URL]
109 - (ejs)[URL]
110 - (express)[URL]
111 - (express-messages)[URL]
112 - (hat)[URL]
113 - (hooks)[URL]
114 - (init)[URL]
115 - (jade)[URL]
116 - (mongodb)[URL]
117 - (mongoose)[URL]
118 - (socket.io)[URL]
119
120
121
122 # AWS Infrastructure
123
124 The actual finalsclub.org servers run in the cloud on Linux servers, using Amazon Web Services (AWS).
125 Scaling is accomplished by adding additional servers to a load balancer.
126
127 NOTE: The scaling system is automatic; new servers have to be added manually, but it it's very easy.
128 NOTE: Automatic fail-over of the database is not yet in place.
129
130 NOTE: There are currently 2 running server instances.  One for the live server and one for testing.
131
132 Data is stored in a MongoDB server running on the same AWS instance as the website.
133 Data is backed up daily to the durable AWS S3 system.
134 One backup of the database is kept for the most recent 30 days, one for each of the most
135 recent 12 months, and one for every year.
136
137 AWS Cloudwatch is used to monitor the servers.
138 When the configured conditions warrant attention, notices are sent to "info@finalsclub.org".
139
140 NOTE: There are currently 2 monitors set up:
141
142 - available disk space
143 - CPU utilization
144
145 NOTE: We still have an ongoing issue with the EPL server hanging up.  This is being worked on.
146
147
148
149