Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/talyssonoc/twitter-api-challenge
https://github.com/talyssonoc/twitter-api-challenge
Last synced: 19 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/talyssonoc/twitter-api-challenge
- Owner: talyssonoc
- Created: 2015-09-29T23:40:23.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2015-10-13T18:39:46.000Z (about 9 years ago)
- Last Synced: 2024-10-11T10:55:35.869Z (about 1 month ago)
- Language: JavaScript
- Size: 148 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# StackCommerce JS Twitter API Challenge
[![Build Status](https://travis-ci.org/talyssonoc/twitter-api-challenge.svg)](https://travis-ci.org/talyssonoc/twitter-api-challenge)
## App design
I choose React to create the views due to its easy way to deal with DOM changes (since the results should be rendered again everytime I did a new search).
Since Babel transpiles JSX too, I choose to use it and then could use ES6/ES2015 features like "classes", static properties, ES module system and so on.
I alse used Jest to make the tests, since it easily works with React.
The app works in a simple way: when user write some username and press enter in the search box, the client will make a AJAX request (using axios) to `/tweets` sending this username. In the server I take this username and sent to the Twitter API.
The `/tweets` route can be acessed without AJAX, I didn paid to much atention to this part since it's a front-end test, but in a real app it would be needed to protect against requests coming from outside the domain, and also only allow access via AJAX.
For the CSS I used SASS, since it's the most used nowadays.
## Setup
For local setup, you should create a copy of `.env.example` called `.env` and fill the data for the Twitter API.
It is needed that you have Node, npm and gulp installed in your machine.
You must also run `npm install` when you have all the requirements.
Then run it locally, you must run `gulp run`.
## Deploy
You must set your heroku app on the folder and then just run `git push heroku master`.
## Tests
To run the tests, just run `npm test`