-
Notifications
You must be signed in to change notification settings - Fork 1
/
README.md.old
174 lines (121 loc) · 4.91 KB
/
README.md.old
1
2
3
4
5
6
7
8
9
10
11
12
13
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
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
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
# Drywall
A website and user system starter. Implemented with Express and Backbone.
[![Dependency Status](https://david-dm.org/jedireza/drywall.svg?theme=shields.io)](https://david-dm.org/jedireza/drywall)
[![devDependency Status](https://david-dm.org/jedireza/drywall/dev-status.svg?theme=shields.io)](https://david-dm.org/jedireza/drywall#info=devDependencies)
## Technology
Server side, Drywall is built with the [Express](http://expressjs.com/)
framework. We're using [MongoDB](http://www.mongodb.org/) as a data store.
The front-end is built with [Backbone](http://backbonejs.org/).
We're using [Grunt](http://gruntjs.com/) for the asset pipeline.
| On The Server | On The Client | Development |
| ------------- | -------------- | ----------- |
| Express | Bootstrap | Grunt |
| Jade | Backbone.js | |
| Mongoose | jQuery | |
| Passport | Underscore.js | |
| Async | Font-Awesome | |
| EmailJS | Moment.js | |
## Live demo
| Platform | Username | Password |
| ------------------------------ | -------- | -------- |
| https://drywall.herokuapp.com/ | root | h3r00t |
__Note:__ The live demo has been modified so you cannot change the root user,
the root user's linked admin role or the root admin group. This was done in
order to keep the app ready to use at all times.
## Requirements
You need [Node.js](http://nodejs.org/download/) and
[MongoDB](http://www.mongodb.org/downloads) installed and running.
We use [`bcrypt`](https://github.com/ncb000gt/node.bcrypt.js) for hashing
secrets. If you have issues during installation related to `bcrypt` then [refer
to this wiki
page](https://github.com/jedireza/drywall/wiki/bcrypt-Installation-Trouble).
We use [`emailjs`](https://github.com/eleith/emailjs) for email transport. If
you have issues sending email [refer to this wiki
page](https://github.com/jedireza/drywall/wiki/Trouble-sending-email).
## Installation
```bash
$ git clone [email protected]:jedireza/drywall.git && cd ./drywall
$ npm install
```
## Setup
First you need to setup your config file.
```bash
$ mv ./config.example.js ./config.js #set mongodb and email credentials
```
Next, you need a few records in the database to start using the user system.
Run these commands on mongo via the terminal. __Obviously you should use your
email address.__
```js
use drywall; // or your mongo db name if different
```
```js
db.admingroups.insert({ _id: 'root', name: 'Root' });
db.admins.insert({ name: {first: 'Root', last: 'Admin', full: 'Root Admin'}, groups: ['root'] });
var rootAdmin = db.admins.findOne();
db.users.save({ username: 'root', isActive: 'yes', email: '[email protected]', roles: {admin: rootAdmin._id} });
var rootUser = db.users.findOne();
rootAdmin.user = { id: rootUser._id, name: rootUser.username };
db.admins.save(rootAdmin);
```
## Running the app
```bash
$ npm start
# > [email protected] start /Users/jedireza/projects/jedireza/drywall
# > grunt
# Running "copy:vendor" (copy) task
# ...
# Running "concurrent:dev" (concurrent) task
# Running "watch" task
# Running "nodemon:dev" (nodemon) task
# Waiting...
# [nodemon] v1.3.7
# [nodemon] to restart at any time, enter `rs`
# [nodemon] watching: *.*
# [nodemon] starting `node app.js`
# Server is running on port 3000
```
Now just use the reset password feature to set a password.
- Go to `http://localhost:3000/login/forgot/`
- Submit your email address and wait a second.
- Go check your email and get the reset link.
- `http://localhost:3000/login/reset/:email/:token/`
- Set a new password.
Login. Customize. Enjoy.
## Philosophy
- Create a website and user system.
- Write code in a simple and consistent way.
- Only create minor utilities or plugins to avoid repetitiveness.
- Find and use good tools.
- Use tools in their native/default behavior.
## Features
- Basic front end web pages.
- Contact page has form to email.
- Login system with forgot password and reset password.
- Signup and Login with Facebook, Twitter, GitHub, Google and Tumblr.
- Optional email verification during signup flow.
- User system with separate account and admin roles.
- Admin groups with shared permission settings.
- Administrator level permissions that override group permissions.
- Global admin quick search component.
## Questions and contributing
Any issues or questions (no matter how basic), open an issue. Please take the
initiative to include basic debugging information like operating system
and relevant version details such as:
```bash
$ npm version
# { drywall: '0.0.0',
# npm: '2.5.1',
# http_parser: '2.3',
# modules: '14',
# node: '0.12.0',
# openssl: '1.0.1l',
# uv: '1.0.2',
# v8: '3.28.73',
# zlib: '1.2.8' }
```
Contributions are welcome. Your code should:
- pass `$ grunt lint` without error
If you're changing something non-trivial, you may want to submit an issue
first.
## License
MIT