{"id":16222154,"url":"https://github.com/hugodf/happy-or-sad","last_synced_at":"2026-05-06T19:03:06.525Z","repository":{"id":85774014,"uuid":"82918421","full_name":"HugoDF/happy-or-sad","owner":"HugoDF","description":"Happy or Sad?","archived":false,"fork":false,"pushed_at":"2017-02-27T12:14:41.000Z","size":58,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-14T01:39:34.751Z","etag":null,"topics":["ava","livereload","react","react-components","redux"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/HugoDF.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-02-23T10:59:57.000Z","updated_at":"2017-03-07T15:57:17.000Z","dependencies_parsed_at":null,"dependency_job_id":"8e5a24a4-a3bc-4ea4-86de-3acedaf82af8","html_url":"https://github.com/HugoDF/happy-or-sad","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HugoDF%2Fhappy-or-sad","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HugoDF%2Fhappy-or-sad/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HugoDF%2Fhappy-or-sad/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HugoDF%2Fhappy-or-sad/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HugoDF","download_url":"https://codeload.github.com/HugoDF/happy-or-sad/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247755588,"owners_count":20990626,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ava","livereload","react","react-components","redux"],"created_at":"2024-10-10T12:11:28.120Z","updated_at":"2025-10-19T07:14:03.706Z","avatar_url":"https://github.com/HugoDF.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Happy or Sad\n\nImplementation of the Happy or Sad App using React, Redux and Express.\n\nAs suggested, Dan Abramov's [`react-hot-boilerplate` v2](https://github.com/gaearon/react-hot-boilerplate) is used as a starting point (includes webpack config and a dev express server).\n\nThe dependencies have been updated since this project is not maintained any more.\n\n## Setup\n\nYou need Node v6 as minimum to run this project (ES6 features are used without transpilation in the API server). Ideally use [Yarn](https://yarnpkg.com) so that you get locked dependencies.\n\nTo run the project, make sure all the dependencies are installed using `npm install` or `yarn install`. Then run `npm start` or `yarnpkg start`.\n\nTo run the project in livereload mode use `npm run dev` or `yarnpkg run dev`.\n\nTo run the tests use `npm test` or `yarn test`. If you would like more verbose output use `npm test -- --verbose` or `yarn test -- --verbose`.  \nYou can use AVA (test runner) in watch mode by passing it the `-w` flag (which gives `npm test -- -w` or `yarn test -- -w`).\n\n## Structure\n\nIn the `src` directory you will find the `api` and `client` directories. They contain the API app to rate whether text is happy or sad and the React frontend app respectively.\n\nThe tests are colocated with the application code and are named `fileContainingCodeBeingTested.test.js` following the AVA default blob (`**/*.test.js`).\n\n## Technologies\n\n[Redux](http://redux.js.org/) is used to managed state in the React app. Although it would have been possible to do everything through component state (and `setState`), \nusing Redux allows us to test the React components more easily (since we leverage props).\n\nAs an HTTP client, we use [axios](https://github.com/mzabriskie/axios) which is a promise-based client that works both with Node and in the browser.\n\nOn the backend, we use a simple Express API server that has a single POST `rateMood` endpoint.\nIt is served as a separate HTTP server and therefore has CORS enabled.\n\nFor testing we use [AVA](https://github.com/avajs/ava), for its low config and watch system and [Enzyme](https://github.com/airbnb/enzyme) to test React components.\nWe use [sinon](http://sinonjs.org/) for function stubbing.\n\nIn terms of development environment, we leverage [node-dev](https://github.com/fgnass/node-dev) to livereload the API server (and webpack dev server) when code changes.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhugodf%2Fhappy-or-sad","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhugodf%2Fhappy-or-sad","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhugodf%2Fhappy-or-sad/lists"}