{"id":26692403,"url":"https://github.com/romaleev/fullinfo-task","last_synced_at":"2025-07-01T03:05:42.377Z","repository":{"id":252812854,"uuid":"821359299","full_name":"romaleev/fullinfo-task","owner":"romaleev","description":"Smart polling API | React, Node.js, Typescript, MongoDB","archived":false,"fork":false,"pushed_at":"2024-07-03T07:56:50.000Z","size":1175,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-26T17:18:13.267Z","etag":null,"topics":["mongo","node","react","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/romaleev.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":"2024-06-28T11:11:49.000Z","updated_at":"2025-02-26T12:09:36.000Z","dependencies_parsed_at":"2024-08-12T18:38:52.099Z","dependency_job_id":null,"html_url":"https://github.com/romaleev/fullinfo-task","commit_stats":null,"previous_names":["romaleev/fullinfo-test","romaleev/fullinfo-task"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/romaleev/fullinfo-task","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/romaleev%2Ffullinfo-task","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/romaleev%2Ffullinfo-task/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/romaleev%2Ffullinfo-task/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/romaleev%2Ffullinfo-task/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/romaleev","download_url":"https://codeload.github.com/romaleev/fullinfo-task/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/romaleev%2Ffullinfo-task/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262887183,"owners_count":23379767,"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":["mongo","node","react","typescript"],"created_at":"2025-03-26T17:18:16.338Z","updated_at":"2025-07-01T03:05:41.843Z","avatar_url":"https://github.com/romaleev.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fullinfo-test\n\n## Task\n\nOn https://api.citybik.es/v2/ you can find an API which can be used to retrieve data of city bike networks worldwide and the availability of bikes per network.\n\nWrite a proof of concept application which:\n\n1) Polls this api regularly for a set of pre-configured cities and stores every hour per city the average total amount of free bikes of all bike stations in that city. Note, do not poll too often, data is only refreshed once in a while. Develop a smart polling algorithm for this.\n\n2) Provides a simple but elegant web user interface which can be used to query stored data (be creative here)\n\nEnsure and proof the most essential part of your code is covered by unit tests. Use any technology you like or think is necessary.\n\nPrepare a short presentation to explain your understanding of the problem, the assumptions you worked with, your approach, technical solution and a small demo.\n\n![chart](presentation/chart.png)\n\n## Scripts\n\n### Start Server\n```sh\nnpm run server\n```\nStarts the back-end server, provides the api for the front-end as well as, schedules api poll and database store tasks.\nIf not set, smartly detects the polling interval.\nStarts in-memory MongoDB with dummy data in development mode.\n\n### Start Client\n```sh\nnpm run client\n```\nRuns the front-end app in the development mode.\\\nOpen [http://localhost:3000](http://localhost:3000) to view it in the browser.\n\nThe page will reload if you make edits.\\\nYou will also see any lint errors in the console.\n\n## Presentation\n\nRun presentation slides\n```sh\nnpm run presentation\n```\n\n## Tests\n\nRun unit tests\n```sh\nnpm test\n```\n## Database helpers\n\nFills MongoDB database with dummy data connected with Config.json mongoUrl url\n```sh\nnpm run fill-db\n```\n\nResets MongoDB database connected with Config.json mongoUrl url\n```sh\nnpm run reset-db\n```\n\n## Build\n\nBuild client\n```sh\nnpm run build-client\n```\n\nBuild server\n```sh\nnpm run build-server\n```\n\nBuild both\n```sh\nnpm run build\n```\n\nBuilds the app for production to the `build` folder.\n\nThe build is minified and the filenames include the hashes.\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n## Update\n\nUpdates libraries to the latest versions\n```sh\nnpm run update\n```\n\n## Configuration\n\nCan be adjusted in ```config.json```\n\n| Option                    | Description                                                                                                         | Default Value                            |\n|---------------------------|---------------------------------------------------------------------------------------------------------------------|------------------------------------------|\n| `cities`                  | List of cities to be monitored.                                                                                     | `[\"Barcelona\", \"Paris\"]`                 |\n| `networkCacheMinutes`     | Duration in minutes for which the network data should be cached.                                                    | `1440`                                   |\n| `storeIntervalSeconds`    | Interval in seconds at which data should be stored in the database.                                                 | `60`                                     |\n| `pollIntervalSeconds`     | Current polling interval in seconds. If set to `null`, the initial polling interval will be detected automatically. | `null`                                   |\n| `pollIntervalSecondsInit` | Initial polling interval in seconds used at the start of the monitoring process.                                    | `60`                                     |\n| `pollIntervalSecondsMin`  | Minimum allowable polling interval in seconds.                                                                      | `10`                                     |\n| `pollIntervalSecondsMax`  | Maximum allowable polling interval in seconds.                                                                      | `300`                                    |\n| `networkUrl`              | URL for connecting to the network bike API.                                                                         | `\"http://api.citybik.es/v2/networks/${network.id}?fields=stations\"`   |\n| `networksUrl`             | URL for connecting to the networks bike API.                                                                        | `\"http://api.citybik.es/v2/networks?fields=id,location\"`   |\n| `mongoUrl`                | URL for connecting to the MongoDB database.                                                                         | `\"mongodb://localhost:27017/bikedata\"`   |\n| `debug`                   | Enable or disable debug mode. When enabled, additional debug information will be logged.                            | `true`                                   |\n\n## API Endpoints\n\n### Get Bike Data\nFetch stored bike data for a specific city and date range.\n```http\nGET /api/bikedata?city=\u003ccity\u003e\u0026start=\u003cstart-date\u003e\u0026end=\u003cend-date\u003e\n```\n- **Parameters**:\n\t- `city`: The name of the city.\n\t- `start`: The start date (YYYY-MM-DD).\n\t- `end`: The end date (YYYY-MM-DD).\n\n## Possible improvements\n- UI live update\n- Add CLI/dotenv config support\n- Follow the installation and run instructions on the [MongoDB website](https://docs.mongodb.com/manual/installation/) to install MongoDB for production.\n\n## create-react-app scripts\n\n### `npm run eject-cra`\n\n**Note: this is a one-way operation. Once you `eject`, you can’t go back!**\n\nIf you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.\n\nYou don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fromaleev%2Ffullinfo-task","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fromaleev%2Ffullinfo-task","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fromaleev%2Ffullinfo-task/lists"}