An Brief Qidian Reader app based on Bootstrap + Angular UI Bootstrap, AngularJS, NodeJS+ExpressJS and MongoDB.
.
├── models: MongoDB Models
├── public: Front-End Resources
│ ├── app: Angular App
│ │ ├── components
│ │ ├── shared
│ │ ├── app.module.js
│ │ └── app.routes.js
│ ├── assets: Resources
│ │ ├── css
│ │ ├── img
│ │ ├── js
│ │ └── libs: Bower Libraries
│ └── index.html
├── routes: Express Routes
│ ├── apis: RESTful API Routes
│ └── api.js: RESTful API Entrance
├── .bowerrc
├── .gitignore
├── bower.json
├── package.json
└── server.js
- Make sure you have node installed with npm.
- Run
npm install
under the repository folder- It will handle node modules, bower, and bower modules.
- Read .bowerrc and package.json for detail.
- For local debuging, adjust server.js to point to your local mongoDB.
- For local nodemon, use nodemon.json as the config.
Remember to purchase storage, or a storage request forbidden error will show up when creating database associated.
Source Secret is required for private repo deployment.
This credential uses ssh private/public key pairs to pull repo, and is safe because it can be assigned to single repo by deploy key.
- Create ssh key without passphrase (empty passphrase).
- Add ssh public key to the deploy key of the repo on git source.
- Create a Source Secret in OpenShift, with ssh private key. Remember: Do not modify after browse and import.
- Check link to builder account before create.
- In build config (where source is defined), assign the secret to the souce.
- SSH url will work. Remember: Do not use HTTP url, Do not add ssh:// before SSH url.
This credential uses username and password to pull repo, but is not safe because the auth is not only for the target repo.
- Create a Source Secret in OpenShift, with basic auth: git source login information.
- Check link to builder account before create.
- In build config (where source is defined), assign the secret to the source.
- HTTP url will work. SSH url not tested.
- Use Webhooks, set PayLoad URL, set Content type as application/json, and then leave Secret Blank. For private repo, Secret field should be set. On OpenShift side, rebuild and deployment will automatically take place.
- Use npm scripts.postinstall "npm install bower && bower install" to install bower component. Also use .bowerrc and bower.json to define bower install content.
To host an OpenShift app at a specified url, the following steps should be taken:
- Generate a default route for this app, naming internal-route for example.
- Generate a specified route for this app, naming external-route for example.
- Register the specified domain online (for example using Name).
- Under DNS settings add a CNAME DNS with your internal-route url as source, and your external-route url as destination.
- deploy on HTTPS, and adjust Github link when complete
- apply more secured authentication.
- add notifications.
- update last read chapter on QiDian Server.
- pull bookcase from QiDian Server.