Skip to content

Commit e540567

Browse files
authored
Create an Introduction and contributing doc file (#758)
* Create an Introduction doc file * Move existing introduction * Replace getting started with introduction * Update getting-started.md * Update introduction * Add a contributing page to the Introduction part
1 parent 4c8bca5 commit e540567

File tree

6 files changed

+163
-67
lines changed

6 files changed

+163
-67
lines changed

website/docs/contributing.md

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
---
2+
id: contributing
3+
title: Contributing to accounts-js
4+
sidebar_label: Contributing
5+
---
6+
7+
**TL;DR; Tests, coverage, linting, changelog** (See Pull Request Requirements, below).
8+
9+
The Accounts project was intended - since its inception - to be a community maintained project. We would love to see you get involved (especially long time contributors from the Meteor community who we've worked with before).
10+
11+
## Getting Started
12+
13+
1. Fork the project on Github (top right on the project page)
14+
2. Clone the project: `git clone [email protected]:yourname/accounts`
15+
3. Checkout a relevant branch like: `git checkout some-branch`
16+
4. Create your own feature branch: `git checkout -b proposed-feature`
17+
18+
## Development
19+
20+
- [Install Node.js](https://nodejs.org/en/download/).
21+
- [Install Yarn](https://yarnpkg.com/en/docs/install#mac-stable).
22+
23+
#### Useful Commands:
24+
25+
- Install project dependencies: `yarn`
26+
- Link together all the packages: `yarn setup`
27+
- Watch the packages for changes and recompile: `yarn start`
28+
- If you want to use the accounts project in your own project, use `yarn link @accounts/<name of package>` within your project.
29+
30+
## Pull Requests
31+
32+
### Requirements
33+
34+
For non-bug-fixes, please open an _issue_ first and discuss your idea to make sure we're on the same page.
35+
Alternatively, prepend your PR title with `[discuss]` to have a conversation around the code.
36+
37+
#### All PRs:
38+
39+
1. Must not break the **test suite** (`yarn test`), nor reduce **test coverage** (`yarn coverage`). If you're fixing a bug, include a test that would fail without your fix.
40+
41+
2. Must respect the **tslint.json** (`yarn lint`). Ideally your editor supports `tslint`. Especially since the project is quite new, feel free to query default rules with us that don't make sense, or disable rules in a particular scope when it makes sense, together with a comment explaining why.
42+
You can find the config [here](https://github.com/accounts-js/tslint-config-accounts).
43+
44+
3. Must be **isolated**. Avoid grouping many, unrelated changes in a single PR.
45+
46+
4. GitHub now allows auto-squashing of commits in a PR, so no need to rebase your commits before final submission.
47+
48+
### Submission
49+
50+
1. From [Getting Started](#getting-started), your work should ideally be in its own feature branch.
51+
1. `git push` your branch to git and create a new pull request for the appropriate branch.
52+
53+
## Contributors with Commit Bit
54+
55+
- Should still submit a PR for changes (i.e. no work should be done on a branch directly; all work should be done in it's own separate feature branch), which should be okayed by one other team member before merging.
56+
57+
- Should squash merged PRs whenever possible (via GitHub options).
58+
59+
## Financial contributions
60+
61+
We also welcome financial contributions in full transparency on our [open collective](https://opencollective.com/accounts-js).
62+
Anyone can file an expense. If the expense makes sense for the development of the community, it will be "merged" in the ledger of our open collective by the core contributors and the person who filed the expense will be reimbursed.
63+
64+
## Credits
65+
66+
### Contributors
67+
68+
Thank you to all the people who have already contributed to accounts-js!
69+
<a href="graphs/contributors"><img src="https://opencollective.com/accounts-js/contributors.svg?width=890" /></a>
70+
71+
### Backers
72+
73+
Thank you to all our backers! [[Become a backer](https://opencollective.com/accounts-js#backer)]
74+
75+
<a href="https://opencollective.com/accounts-js#backers" target="_blank"><img src="https://opencollective.com/accounts-js/backers.svg?width=890" /></a>
76+
77+
### Sponsors
78+
79+
Thank you to all our sponsors! (please ask your company to also support this open source project by [becoming a sponsor](https://opencollective.com/accounts-js#sponsor))
80+
81+
<a href="https://opencollective.com/accounts-js/sponsor/0/website" target="_blank"><img src="https://opencollective.com/accounts-js/sponsor/0/avatar.svg" /></a>
82+
<a href="https://opencollective.com/accounts-js/sponsor/1/website" target="_blank"><img src="https://opencollective.com/accounts-js/sponsor/1/avatar.svg" /></a>
83+
<a href="https://opencollective.com/accounts-js/sponsor/2/website" target="_blank"><img src="https://opencollective.com/accounts-js/sponsor/2/avatar.svg" /></a>
84+
<a href="https://opencollective.com/accounts-js/sponsor/3/website" target="_blank"><img src="https://opencollective.com/accounts-js/sponsor/3/avatar.svg" /></a>
85+
<a href="https://opencollective.com/accounts-js/sponsor/4/website" target="_blank"><img src="https://opencollective.com/accounts-js/sponsor/4/avatar.svg" /></a>
86+
<a href="https://opencollective.com/accounts-js/sponsor/5/website" target="_blank"><img src="https://opencollective.com/accounts-js/sponsor/5/avatar.svg" /></a>
87+
<a href="https://opencollective.com/accounts-js/sponsor/6/website" target="_blank"><img src="https://opencollective.com/accounts-js/sponsor/6/avatar.svg" /></a>
88+
<a href="https://opencollective.com/accounts-js/sponsor/7/website" target="_blank"><img src="https://opencollective.com/accounts-js/sponsor/7/avatar.svg" /></a>
89+
<a href="https://opencollective.com/accounts-js/sponsor/8/website" target="_blank"><img src="https://opencollective.com/accounts-js/sponsor/8/avatar.svg" /></a>
90+
<a href="https://opencollective.com/accounts-js/sponsor/9/website" target="_blank"><img src="https://opencollective.com/accounts-js/sponsor/9/avatar.svg" /></a>

website/docs/getting-started.md

Lines changed: 22 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,40 @@
11
---
22
id: getting-started
3-
title: Getting started
3+
title: Getting started with @accounts/boost
44
sidebar_label: '@accounts/boost'
55
---
66

7-
# accounts
8-
9-
## About
10-
11-
The `@accounts` suite of packages aims to provide the consumer an end to end authentication and accounts management solution, with a simple to start with interface while preserving options for configuration. These packages provide OAuth support for popular providers such as Instagram, Twitter, Github, two factor authentication, password based accounts along with recovery options and customizable account creation and validation.
12-
137
The `@accounts` packages are modular by nature and can be manually installed and configured, however we provide `@accounts/boost` - a package containing useful abstractions to get a GraphQL accounts server started with minimal configuration.
148

15-
## Getting started with @accounts/boost
16-
179
**Install the core**
1810

19-
`npm install @accounts/boost`
11+
```bash
12+
// Npm
13+
npm install --save @accounts/boost
14+
15+
// Yarn
16+
yarn add @accounts/boost
17+
```
2018

2119
**Choose your database database driver**
2220

23-
`npm install @accounts/mongo`
21+
```bash
22+
// Npm
23+
npm install --save @accounts/mongo
24+
25+
// Yarn
26+
yarn add @accounts/mongo
27+
```
2428

2529
**Choose your authentication services**
2630

27-
`npm install @accounts/password`
31+
```bash
32+
// Npm
33+
npm install --save @accounts/password
34+
35+
// Yarn
36+
yarn add @accounts/password
37+
```
2838

2939
The following starts an accounts server using the database, transport, and authentication services you provided with the default settings.
3040

@@ -241,54 +251,3 @@ const accountsServerUri = 'http://localhost:4003/';
241251
console.log(`GraphQL server running at ${apolloServer.url}`);
242252
})();
243253
```
244-
245-
### Prior Art
246-
247-
This project is inspired by Meteor's accounts suite of packages. Meteor
248-
framework had a plug and play approach for its monolithic framework that saved a
249-
ton of work that is traditionally done by any development team, over and over
250-
again. Meteor's accounts system had a couple of restrictions:
251-
252-
- First it was published in Meteor's "atmosphere" package repository and was
253-
dependent on the Meteor's build tool.
254-
- Second, Meteor is built around DDP and so its accounts system was taking that
255-
for granted.
256-
- Third, Meteor's dependency on MongoDB meant that the business logic was
257-
dependant on how the data is stored in the database.
258-
259-
### FAQ
260-
261-
Going into this project we asked ourselves (and were asked by others) a bunch of
262-
questions that helped us define what this project is all about. This is part of
263-
these questions: If you have a question that you think could shape this
264-
project please PR this document or open an issue!
265-
266-
### Why wouldn't you just use passport?
267-
268-
We are not here to replace passport.js. Actually, in our vision, passport.js
269-
will be one authentication method that you can plug in. Currently, the only
270-
problem with passport.js in that regard is that it is designed to work with
271-
connect middlewares and adapter code is needed to plug into let's say a WS
272-
transport. We currently implemented our own local strategy just to make sense
273-
out of basic accounts packages. In the near future it will be separated into its
274-
own package.
275-
276-
### Why not refactor out the Meteor accounts suite?
277-
278-
Well, as explained above, Meteor's accounts system is tied to the data storage
279-
and transport in a way that is actually harder to separate than rewriting with
280-
those abstractions in mind. We do offer an adapter package that allows Meteor
281-
applications an easy and gradual way to move out of Meteor's current accounts
282-
system.
283-
284-
### Why do you use a mono-repo?
285-
286-
Early on we understood that a mono-repo is required in order to have a good
287-
developer experience while adding any accounts logic. This also helps us keep the
288-
codebase relatively small for using apps as you will not load in client code on
289-
server apps and vice versa. Although having a mono repo is great, we feel that
290-
someone maintaining the Redis package should not get notifications regarding
291-
changes on the Mongo or React packages. If you are adding in a
292-
feature that requires changes to the transport or the data store packages, we
293-
recommend cloning all of the accounts-js packages into the same directory and just
294-
open your IDE on that directory as project root.

website/docs/introduction.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
---
2+
id: introduction
3+
title: Introduction
4+
sidebar_label: Introduction
5+
---
6+
7+
The `@accounts` suite of packages aims to provide the consumer an end to end authentication and accounts management solution, with a simple way to start while preserving options for configuration. These packages provide OAuth support for popular providers such as Instagram, Twitter, Github, two factor authentication, password based accounts along with recovery options and customizable account creation and validation.
8+
9+
Three pieces need to be configured to use accounts-js in your application:
10+
11+
#### 1. Transports
12+
13+
Since accounts-js is very flexible, it can be used with multiple transports. For now we provide packages for both [GraphQL](/docs/transports/graphql) and [REST](/docs/transports/rest).
14+
15+
#### 2. Databases
16+
17+
We provide a native [mongo](/docs/databases/mongo) integration which is compatible with the meteor account system. We also have a [Typeorm](/docs/databases/typeorm) integration which will let you use accounts-js with any kind of databases.
18+
19+
#### 3. Strategies
20+
21+
You can use multiple strategies to let your users access to your app. For now we support authentication via [email/username and password](/docs/strategies/password), Oauth support is coming soon!
22+
23+
### Prior Art
24+
25+
This project is inspired by Meteor's accounts suite of packages. Meteor framework had a plug and play approach for its monolithic framework that saved a ton of work that is traditionally done by any development team, over and over again. Meteor's accounts system had a couple of restrictions:
26+
27+
- First it was published in Meteor's "atmosphere" package repository and was dependent on the Meteor's build tool.
28+
- Second, Meteor is built around DDP and so its accounts system was taking that for granted.
29+
- Third, Meteor's dependency on MongoDB meant that the business logic was dependant on how the data is stored in the database.
30+
31+
### FAQ
32+
33+
Going into this project we asked ourselves (and were asked by others) a bunch of questions that helped us define what this project is all about. This is part of these questions: If you have a question that you think could shape this project please PR this document or open an issue!
34+
35+
#### Why wouldn't you just use passport?
36+
37+
We are not here to replace passport.js. Actually, in our vision, passport.js will be one authentication method that you can plug in. Currently, the only problem with passport.js in that regard is that it is designed to work with connect middlewares and adapter code is needed to plug into let's say a WS transport. We currently implemented our own local strategy just to make sense out of basic accounts packages. In the near future it will be separated into its own package.
38+
39+
#### Why not refactor out the Meteor accounts suite?
40+
41+
Well, as explained above, Meteor's accounts system is tied to the data storage and transport in a way that is actually harder to separate than rewriting with those abstractions in mind. We do offer an adapter package that allows Meteor applications an easy and gradual way to move out of Meteor's current accounts system.
42+
43+
#### Why do you use a mono-repo?
44+
45+
Early on we understood that a mono-repo is required in order to have a good developer experience while adding any accounts logic. This also helps us keep the codebase relatively small for using apps as you will not load in client code on server apps and vice versa. Although having a mono repo is great, we feel that someone maintaining the Redis package should not get notifications regarding changes on the Mongo or React packages. If you are adding in a feature that requires changes to the transport or the data store packages, we recommend cloning all of the accounts-js packages into the same directory and just open your IDE on that directory as project root.

website/docusaurus.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ module.exports = {
2323
src: 'img/logo.png',
2424
},
2525
links: [
26-
{ to: 'docs/getting-started', label: 'Getting Started', position: 'right' },
26+
{ to: 'docs/introduction', label: 'Documentation', position: 'right' },
2727
{
2828
to: 'docs/api/server/api-readme',
2929
label: 'Api reference',

website/sidebars.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
module.exports = {
99
docs: {
10+
Introduction: ['introduction', 'contributing'],
1011
'Getting started': ['getting-started', 'email'],
1112
Transports: ['transports/graphql', 'transports/rest'],
1213
Databases: ['databases/mongo', 'databases/redis', 'databases/typeorm'],

website/src/pages/index.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,9 @@ const features = [
3131
description: (
3232
<>
3333
We provide a native <a href="/docs/databases/mongo">mongo</a> integration which is
34-
compatible with the meteor account system. We also have a Typeorm integration which will let
35-
you use accounts-js with any kind of databases.
34+
compatible with the meteor account system. We also have a{' '}
35+
<a href="/docs/databases/typeorm">Typeorm</a> integration which will let you use accounts-js
36+
with any kind of databases.
3637
</>
3738
),
3839
},
@@ -68,7 +69,7 @@ function Home() {
6869
'button button--outline button--primary button--lg',
6970
styles.getStarted
7071
)}
71-
to={withBaseUrl('docs/getting-started')}
72+
to={withBaseUrl('docs/introduction')}
7273
>
7374
Get Started
7475
</Link>

0 commit comments

Comments
 (0)