-
-
Notifications
You must be signed in to change notification settings - Fork 362
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
216 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
--- | ||
name: 🐛 Bug report | ||
about: Create a report to help us improve | ||
labels: bug | ||
|
||
--- | ||
|
||
**🐞 Describe the bug** | ||
|
||
A clear and concise description of what the bug is. | ||
|
||
**📚 To Reproduce** | ||
|
||
Steps to reproduce the behavior. | ||
|
||
**💡 Expected behavior** | ||
|
||
A clear and concise description of what you expected to happen. | ||
|
||
**🖼️ Screenshots** | ||
|
||
If applicable, add screenshots to help explain your problem. | ||
|
||
**⚙️ Environment** | ||
- Installation: [e.g. Docker/Docker-Compose/Netlify/Vercel/Manually] | ||
- Ackee version: [e.g. v2.1.0] | ||
|
||
**📋 Additional context** | ||
|
||
Add any other context about the problem here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
contact_links: | ||
- name: 📚 Ackee Docs | ||
url: https://docs.ackee.electerious.com/ | ||
about: Checkout Ackee's Documentation before you open an issue. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--- | ||
name: 🚀 Feature request | ||
about: Suggest an idea for this project | ||
labels: feature request | ||
|
||
--- | ||
|
||
**🐣 Is your feature request related to a problem? Please describe.** | ||
|
||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] | ||
|
||
**💡 Describe the solution you'd like** | ||
|
||
A clear and concise description of what you want to happen. | ||
|
||
**❓ Describe alternatives you've considered** | ||
|
||
A clear and concise description of any alternative solutions or features you've considered. | ||
|
||
**📋 Additional context** | ||
|
||
Add any other context about the feature request here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,4 +31,7 @@ node_modules | |
|
||
# Dist folder | ||
dist/* | ||
!dist/.gitkeep | ||
!dist/.gitkeep | ||
|
||
# Vercel | ||
.vercel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ env: | |
- YARN_GPG=no | ||
node_js: | ||
- 'node' | ||
- '12' | ||
- '14' | ||
os: | ||
- windows | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# Contributing | ||
|
||
Thanks for taking the time to contribute to this project! | ||
|
||
## How to help? | ||
|
||
There are multiple tasks you can do in order to help us, for example: | ||
|
||
- fill an issue to report bugs or your specific needs | ||
- contribute to existing issues | ||
- write a PR to improve the project | ||
|
||
## Contributing workflow | ||
|
||
In order to make a code contribution, create a fork of Ackee by clicking the "Fork" button on [GitHub](https://github.com/electerious/Ackee) and cloning the repo to your local machine. | ||
|
||
Please use the `develop` branch as a base for your contribution and make your changes on a new branch. | ||
|
||
Ensure that you open an issue to discuss the changes before submitting a PR. | ||
|
||
Once you're finished, push your branch to your repo and create a pull request! | ||
|
||
## Development mode | ||
|
||
Simply run Ackee with `NODE_ENV` set to `development` to get access to the [GraphQL Playground](https://docs.ackee.electerious.com/#/docs/API#playground). You can do this by adding `NODE_ENV=development` to the environment of your `docker-compose.yml` or by running: | ||
|
||
```sh | ||
yarn start:dev | ||
``` | ||
|
||
## Linting | ||
|
||
[ESlint](https://eslint.org/) is used for linting. It's recommended to add the corresponding extension to your editor. It's also possible to run the `lint` task with the following command: | ||
|
||
```sh | ||
yarn lint | ||
``` | ||
|
||
## Testing | ||
|
||
To make sure your changes didn't break anything, use the `test` task to run all tests: | ||
|
||
```sh | ||
yarn test | ||
``` | ||
|
||
That's it, happy coding! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
'use strict' | ||
|
||
/** | ||
* A serverless function handler for the '/api' route, for use with Vercel. | ||
* This handler follows the AWS Lambda API; Vercel deployments are opted-in | ||
* using the "NODEJS_AWS_HANDLER_NAME" environment variable defined in vercel.json. | ||
* | ||
* See: | ||
* - https://vercel.com/docs/serverless-functions/supported-languages#node.js | ||
* - https://vercel.com/docs/runtimes#advanced-usage/advanced-node-js-usage/aws-lambda-api | ||
*/ | ||
exports.handler = require('../src/serverless').handler |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,9 @@ | ||
'use strict' | ||
|
||
const { ApolloServer } = require('apollo-server-lambda') | ||
const { UnsignedIntResolver, UnsignedIntTypeDefinition, DateTimeResolver, DateTimeTypeDefinition } = require('graphql-scalars') | ||
|
||
const connect = require('../src/utils/connect') | ||
const isDemoMode = require('../src/utils/isDemoMode') | ||
const isDevelopmentMode = require('../src/utils/isDevelopmentMode') | ||
const { createServerlessContext } = require('../src/utils/createContext') | ||
|
||
const allowOrigin = process.env.ACKEE_ALLOW_ORIGIN || '' | ||
const dbUrl = process.env.ACKEE_MONGODB || process.env.MONGODB_URI | ||
|
||
if (dbUrl == null) { | ||
throw new Error('MongoDB connection URI missing in environment') | ||
} | ||
|
||
connect(dbUrl) | ||
|
||
const apolloServer = new ApolloServer({ | ||
introspection: isDemoMode === true || isDevelopmentMode === true, | ||
playground: isDemoMode === true || isDevelopmentMode === true, | ||
debug: isDevelopmentMode === true, | ||
typeDefs: [ | ||
UnsignedIntTypeDefinition, | ||
DateTimeTypeDefinition, | ||
require('../src/types') | ||
], | ||
resolvers: { | ||
UnsignedInt: UnsignedIntResolver, | ||
DateTime: DateTimeResolver, | ||
...require('../src/resolvers') | ||
}, | ||
context: createServerlessContext | ||
}) | ||
|
||
exports.handler = apolloServer.createHandler({ | ||
cors: { | ||
origin: allowOrigin === '*' ? true : allowOrigin.split(','), | ||
methods: 'GET,POST,PATCH,OPTIONS', | ||
allowedHeaders: 'Content-Type' | ||
} | ||
}) | ||
/** | ||
* A serverless function handler for the '/api' route, for use with Netlify. | ||
* | ||
* See: | ||
* - https://docs.netlify.com/functions/overview/ | ||
*/ | ||
exports.handler = require('../src/serverless').handler |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
'use strict' | ||
|
||
const { ApolloServer } = require('apollo-server-lambda') | ||
const { UnsignedIntResolver, UnsignedIntTypeDefinition, DateTimeResolver, DateTimeTypeDefinition } = require('graphql-scalars') | ||
|
||
const connect = require('./utils/connect') | ||
const isDemoMode = require('./utils/isDemoMode') | ||
const isDevelopmentMode = require('./utils/isDevelopmentMode') | ||
const { createServerlessContext } = require('./utils/createContext') | ||
|
||
const allowOrigin = process.env.ACKEE_ALLOW_ORIGIN || '' | ||
const dbUrl = process.env.ACKEE_MONGODB || process.env.MONGODB_URI | ||
|
||
if (dbUrl == null) { | ||
throw new Error('MongoDB connection URI missing in environment') | ||
} | ||
|
||
connect(dbUrl) | ||
|
||
const apolloServer = new ApolloServer({ | ||
introspection: isDemoMode === true || isDevelopmentMode === true, | ||
playground: isDemoMode === true || isDevelopmentMode === true, | ||
debug: isDevelopmentMode === true, | ||
typeDefs: [ | ||
UnsignedIntTypeDefinition, | ||
DateTimeTypeDefinition, | ||
require('./types') | ||
], | ||
resolvers: { | ||
UnsignedInt: UnsignedIntResolver, | ||
DateTime: DateTimeResolver, | ||
...require('./resolvers') | ||
}, | ||
context: createServerlessContext | ||
}) | ||
|
||
exports.handler = apolloServer.createHandler({ | ||
cors: { | ||
origin: allowOrigin === '*' ? true : allowOrigin.split(','), | ||
methods: 'GET,POST,PATCH,OPTIONS', | ||
allowedHeaders: 'Content-Type' | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"build": { | ||
"env": { | ||
"NODEJS_AWS_HANDLER_NAME": "handler" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters