An open API service indexing awesome lists of open source software.

https://github.com/fif0o/twitterapp

🐧 app using twitter api built in javascript and using webpack to bundle files, bootstrap-sass is used front-end
https://github.com/fif0o/twitterapp

es6 express javascript oauth2-flow pug twitter-api webpack

Last synced: 3 months ago
JSON representation

🐧 app using twitter api built in javascript and using webpack to bundle files, bootstrap-sass is used front-end

Awesome Lists containing this project

README

          

# Twitter app

##[Twitter feed app](https://twitterapp-kxtpaplvot.now.sh)

Static website using the Twitter API to return a tweet feed.
We are using `/search/tweets` twitter endpoint - [search/tweets endpoint](https://dev.twitter.com/rest/reference/get/search/tweets).
App runs on node port or `:8889`.
Static assets served on port `:8888` if needed.

Dev mode:

```
npm run dev
```

The app is bootstrapped with [create-react-app](https://github.com/facebookincubator/create-react-app).

## Prerequisites

### Routes
- `/` route
- `/tweets` route

### API calls with OAuth2 flow.
[OAUTH2 flow](https://dev.twitter.com/oauth/reference/post/oauth2/token). Bearer token needed - [Obtain a bearer token](https://dev.twitter.com/oauth/application-only) - to access Twitter API endpoints.
Proxy handling OAUTH and Twitter API request is running on node port or `:8889`.
`npm run proxy` and its route is `/search/token`.

### Want your own token to extend the app?
Register to the twitter API website.
create a `token.js` file in the `config` dir exposing your App token `accessToken`, `consumerToken`, `consumerTokenSecret` and `accessTokenSecret` keys from your Twitter API:
```
module.exports = {
accessToken: "",
accessTokenSecret: "",
consumerToken: "",
consumerTokenSecret: """,
}
```

## Scripts
`npm run build` to bundle the app.
`npm run dev` for development mode.
`npm run lint` to lint your code.

## Deploy
Deployed with [now](https://zeit.co/docs/)
`npm run deploy`, and make sure to add your now secret keys - `now secret add ` - before deploying.
Run `now secret list` to show your secret variables - will be passed in your npm scripts as `@yourkey`.

## Improvements
- tests
- pug js templates compiled on client side
- switch builds scripts from `webpack` to `gulp`
- user sessions

### Notes
#### Debug:
In dev mode `/test/controller` route is available to render a pug template serverside via DOM injection on clientside.