Skip to content
This repository has been archived by the owner on Sep 5, 2023. It is now read-only.

Commit

Permalink
Add contributing/development guide
Browse files Browse the repository at this point in the history
  • Loading branch information
shalvah committed Feb 14, 2021
1 parent 04b7503 commit b4275f5
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 7 deletions.
8 changes: 4 additions & 4 deletions .env.example
Expand Up @@ -3,19 +3,19 @@ TWITTER_CONSUMER_SECRET=
TWITTER_ACCESS_TOKEN=
TWITTER_ACCESS_TOKEN_SECRET=

REDIS_HOSTNAME=
REDIS_HOSTNAME=localhost
REDIS_PORT=6379
REDIS_PASSWORD=

LAMBDA_FUNCTION_NAME=testLambdaFunction
LAMBDA_FUNCTION_ARN="arn:aws:lambda:<region>:<account-id>:function:testLambdaFunction"

TWITTER_SCREEN_NAME=RemindMe_OfThis
TWITTER_CALLBACK_URL=http://127.0.0.1:4000/_/completetwittersignin
TWITTER_CALLBACK_URL=http://localhost:3000/_/completetwittersignin

EXTERNAL_URL=remindmeofthis.app
EXTERNAL_URL=http://localhost:3000

FIREBASE_PROJECT_ID=remindmeofthistweet
SENTRY_DSN=

NODE_ENV=
NODE_ENV=development
23 changes: 23 additions & 0 deletions CONTRIBUTING.md
@@ -0,0 +1,23 @@
# Contribution and Development

## Requirements
- Node.js v12 or later
- A Redis server. You can run one easily with Docker: `docker run --name remindme-redis -d -p 6379:6379redis redis-server --appendonly yes`
- The Serverless framework: `npm i -g serverless`
- If you're going to use the Sign In With Twitter functionality, you'll need to create a Twitter app at [developer.twitter.com](http://developer.twitter.com). Alternately, you can use the local Twitter mock API (not implemented yet).

## Setting up
1. Clone the repo and install dependencies.
2. Create a `.env` file by copying the `.env.example` file.
3. Set the `TWITTER_CONSUMER_KEY`,`TWITTER_CONSUMER_SECRET`,`TWITTER_ACCESS_TOKEN`, and `TWITTER_ACCESS_TOKEN_SECRET` values in your `.env` file to the values from your Twitter app.
4. Enable 3-legged OAuth on your Twitter app dashboard, and include `http://localhost:3000/_/completetwittersignin` as one of your callback URLs.
5. Ensure your Redis server is running.
6. Start the service by running `npm run local`. This will start all the http functions (accessible from http://localhost:3000) as well as schedule the `checkForRemindersAndSend` function to run every minute.


## Tests
- Tests are written in Jest, and cover mainly the time parsing features and some end-to-end tests (with the Twitter API mocked to an extent). To run tests: `npm run tests`.


## Linting
Linting is used to help catch errors: `npm run lint`.
4 changes: 1 addition & 3 deletions README.md
Expand Up @@ -78,6 +78,4 @@ This architecture isn't perfect, and I'm open to criticism and suggestions. It's


## Development
- To run a function locally, use the `npm run invoke` script It calls `serverless invoke local`, so see the [available list of options](https://www.serverless.com/framework/docs/providers/aws/cli-reference/invoke-local/).
- Tests are written in Jest, and cover mainly the time parsing features and some end-to-end tests (with the Twitter API mocked to an extent). To run tests: `npm run tests`.
- Linting is used to help catch errors: `npm run lint`.
See the [contributing and development guide](./CONTRIBUTING.md) for details on working on this project.

0 comments on commit b4275f5

Please sign in to comment.