Skip to content

Commit b78b8ed

Browse files
committed
Created a few README's.
1 parent db270dd commit b78b8ed

File tree

5 files changed

+51
-0
lines changed

5 files changed

+51
-0
lines changed

api/README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# API
2+
3+
This is where all API controllers, custom hooks, helpers, models, policies and responses live.
4+
5+
## Controllers
6+
7+
Controllers handle API requests, and decide how to respond, using the custom responses, which track API requests in our datastore.
8+
9+
## Helpers
10+
11+
Helpers are generic, reusable functions used by multiple controllers (or hooks, policies, etc).
12+
13+
## Hooks
14+
15+
Custom hooks (currently only the 1), are used to tap into different parts of a request. The custom hook setup in this repo, is designed to start recording an API request, while the custom responses finalize the record.
16+
17+
## Models
18+
19+
The data models inform Sails (really Waterline) how to create / modify tables (if `sails.config.models.migrate === 'alter'`), or our custom [schema validation and enforcement](../README.md#schema-validation-and-enforcement) on how it should behave.
20+
21+
## Policies
22+
23+
Policies are simple functions, that determine if a request should continue, or fail. These are configured in [`config/policies.js`](../config/policies.js)
24+
25+
## Responses
26+
27+
These custom responses handle the final leg of request logging. They are responsible for ensuring data isn't leaked, by utilizing the `customToJSON` functionality of models.

assets/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Assets
2+
3+
Here is where images, fonts, styles, and React source files live.
4+
5+
React source files can be found in `src`, while the rest can be found in their respective folders.

config/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Configuration
2+
3+
The majority of configuration files live in this folder. `local.js.sample` is intended to be copied to `local.js` (which is Git ignored), which will override anything in the `env` folder (defaults to `env/development.js`).
4+
5+
## Things to keep in-mind
6+
7+
NEVER store credentials, security keys, session secrets, etc in Git-tracked files!
8+
9+
`bootstrap.js` Has nothing to do with the CSS framework Bootstrap. It is actually the last file Sails runs before being fully "lifted". Currently, this repo uses this file for schema validation and enforcement on production servers. Read more about this in the main [README](../README.md#schema-validation-and-enforcement).

views/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Sails.js Views
2+
3+
Generally speaking, you do not want to modify files in this folder. You likely want [`../assets/src`](../assets/src) folder, where all of the React source files live.
4+
5+
The homepage [`pages/homepage.ejs`](pages/homepage.ejs) is setup so we can serve multiple React apps via Sails (recommended to use Nginx or some proxy to just read from `.tmp/public/REACT_APP`).
6+
7+
The error pages are still in-use, when appropriate however, and you will likely want to modify those.

webpack/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Webpack Configuration
2+
3+
The majority of the webpack configuration is built in [`common.config.js`](common.config.js), while the other files extend this file, and change or add what they need for those environments.

0 commit comments

Comments
 (0)