Skip to content

Commit

Permalink
chore: 📝 added open-source boilerplating
Browse files Browse the repository at this point in the history
  • Loading branch information
arctic-hen7 committed Jun 21, 2021
1 parent a1835f0 commit 482c229
Show file tree
Hide file tree
Showing 5 changed files with 257 additions and 1 deletion.
54 changes: 54 additions & 0 deletions .versionrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"types": [
{ "type": "feat", "section": "Features" },
{ "type": "fix", "section": "Bug Fixes" },
{ "type": "docs", "section": "Documentation Changes" },
{ "type": "perf", "section": "Performance Improvements" },
{ "type": "refactor", "section": "Code Refactorings" },
{ "type": "test", "section": "Tests", "hidden": true },
{ "type": "build", "section": "Build System", "hidden": true },
{ "type": "ci", "hidden": true },

{
"type": "feat",
"section": "Features",
"hidden": false
},
{
"type": "fix",
"section": "Bug Fixes",
"hidden": false
},
{
"type": "chore",
"section": "Chores",
"hidden": true
},
{
"type": "docs",
"section": "Documentation Changes",
"hidden": false
},
{
"type": "style",
"section": "Code Style Changes",
"hidden": true
},
{
"type": "refactor",
"section": "Code Refactorings",
"hidden": true
},
{
"type": "perf",
"section": "Performance Improvements",
"hidden": false
},
{
"type": "test",
"section": "Code Testing Changes",
"hidden": true
}
],
"releaseCommitMessageFormat": "chore(release): 🔖 {{currentTag}}"
}
134 changes: 134 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@

# Contributor Covenant Code of Conduct

## Our Pledge

We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, caste, color, religion, or sexual identity
and orientation.

We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.

## Our Standards

Examples of behavior that contributes to a positive environment for our
community include:

* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the
overall community

Examples of unacceptable behavior include:

* The use of sexualized language or imagery, and sexual attention or
advances of any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email
address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

## Enforcement Responsibilities

Community leaders are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.

Community leaders have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, and will communicate reasons for moderation
decisions when appropriate.

## Scope

This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the community in public spaces.
Examples of representing our community include using an official e-mail address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
[arctic_hen7@pm.me](mailto:arctic_hen7@pm.me).
All complaints will be reviewed and investigated promptly and fairly.

All community leaders are obligated to respect the privacy and security of the
reporter of any incident.

## Enforcement Guidelines

Community leaders will follow these Community Impact Guidelines in determining
the consequences for any action they deem in violation of this Code of Conduct:

### 1. Correction

**Community Impact**: Use of inappropriate language or other behavior deemed
unprofessional or unwelcome in the community.

**Consequence**: A private, written warning from community leaders, providing
clarity around the nature of the violation and an explanation of why the
behavior was inappropriate. A public apology may be requested.

### 2. Warning

**Community Impact**: A violation through a single incident or series
of actions.

**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or
permanent ban.

### 3. Temporary Ban

**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.

**Consequence**: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No public or
private interaction with the people involved, including unsolicited interaction
with those enforcing the Code of Conduct, is allowed during this period.
Violating these terms may lead to a permanent ban.

### 4. Permanent Ban

**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.

**Consequence**: A permanent ban from any sort of public interaction within
the community.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.0, available at
[https://www.contributor-covenant.org/version/2/0/code_of_conduct.html][v2.0].

Community Impact Guidelines were inspired by
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].

For answers to common questions about this code of conduct, see the FAQ at
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available
at [https://www.contributor-covenant.org/translations][translations].

[homepage]: https://www.contributor-covenant.org
[v2.0]: https://www.contributor-covenant.org/version/2/0/code_of_conduct.html
[Mozilla CoC]: https://github.com/mozilla/diversity
[FAQ]: https://www.contributor-covenant.org/faq
[translations]: https://www.contributor-covenant.org/translations

40 changes: 40 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Contributing

First off, thanks so much for taking the time to contribute to Diana, it's greatly appreciated!

## I just want to propose something

If you just want to let us know about a bug, or propose a new feature, please open an issue on this repository. We'll take a look as soon as possible!

If you have a question about Diana, open a new issue with the `question` tag and we'll get to it as soon as possible!

## What should I work on?

You can check out the [roadmap](./README.md#Roadmap) or the [issues](https://github.com/arctic-hen7/diana/issues) to see what's currently needing to be done. If you want to work on something that's not on there, please file an issue and we'll take a look it as soon as possible!

## How do I contribute?

Contributing to a project on Github is pretty straight forward. If this is you're first time contributing to a project, all you need to do is fork this repository to your own GitHub account, add then change the code you want to (usually on your local machine, you'd pull your fork down). Commit your changes as necessary, and when you're done, submit a pull request on this repository and we'll review it as soon as possible!

Make sure your code doesn't break anything existing, that all tests pass, and, if necessary, add tests so your code can be confirmed to work automatically.

After you've submitted a pull request, a maintainer will review your changes. Unfortunately, not every pull request will be merged, but we'll try to request changes so that your pull request can best be integrated into the project.

## Building and Testing

- `cargo build`
- `cargo test`

Diana exposes three major components -- the dedicated subscriptions server, the serverful GraphQL system, and the serverless GraphQL system. The first two are what you'll most likely be working with, and these are run from within Docker. To work on Diana, you'll need both Docker and Docker Compose installed.

There's a series of Bonnie scripts in the root of the project, and `bonnie up` will allow you to bring up the whole system (including a MongoDB database for testing). That will make all systems react to your changes, though they can be a bit slow to do so (re-compiling Rust takes a while), so you may want to open two terminals and then run `bonnie sh-server` in one of them and `bonnie sh-subscriptions-server` in the other. Those will give you fully-fledged ZSH prompts in the containers from which you can work. `cargo watch -w . -w ../lib -x "run"` will build the containers reactively and let you see errors and the like.

If you're building something that's likely to impact serverless functionality, you'll need to test the deployment of the system on Netlify. Right now, Diana's serverless systems haven't been built, so instructions on how to do this will come once that's been done.

## Documentation

If the code you write needs to be documented in the help page, the README, or elsewhere, please do so! Also, please ensure your code is commented, it makes everything so much easier for everyone.

## Committing

We use the Conventional Commits system, but you can commit however you want. Your pull request will be squashed and merged into a single compliant commit, so don't worry about this!
27 changes: 26 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,28 @@
# Diana

TODO
Diana is an out-of-the-box fully-fledged GraphQL system for Rust with inbuilt support for commonly-used features like subscriptions and authentication.

## Why?

GraphQL is great, Rust is great! Building a GraphQL server from low-level tooling is cumbersome. Diana solves that by doing all the heavy lifting of boilerplating, authentication, and the like for you, exposing a simple API that allows you to spin up a GraphQL system in no time!

## How do I use it?

TODO once the project is more mature

## Why the name?

*Diana* is the Roman name for the Greek goddess *Artemis*, the sister of Apollo. Apollo is a GraphQL-focused company, and Diana is an open-source GraphQL system for Rust (which Apollo currently doesn't support). Diana has absolutely no affiliation with Apollo the company though!

## Roadmap

* [ ] Write tests for existing code
* [ ] Support authentication over WebSockets for subscriptions

## Contributing

Contributing guidelines can be found [here](./CONTRIBUTING.md), and please make sure you follow our [code of conduct](CODE_OF_CONDUCT.md).

## License

See [`LICENSE`](./LICENSE).
3 changes: 3 additions & 0 deletions bonnie.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,6 @@ start-subscriptions-server = "bonnie dc up -d subscriptions-server"
stop-subscriptions-server = "bonnie dc stop subscriptions-server"
attach-subscriptions-server = "bonnie up-subscriptions-server && docker attach $(bonnie getcontainerid diana.subscriptions-server)"
sh-subscriptions-server = "bonnie dc run --entrypoint \"/bin/zsh\" -p 9002:6000 --use-aliases --rm subscriptions-server"

# Releases the project to GitHub
release = "standard-version && git push --follow-tags origin main"

0 comments on commit 482c229

Please sign in to comment.