{"id":18718326,"url":"https://github.com/worldbrain/notifications-server","last_synced_at":"2025-10-29T16:18:55.636Z","repository":{"id":97337487,"uuid":"101929409","full_name":"WorldBrain/Notifications-Server","owner":"WorldBrain","description":"My project contribution for 2017 Rails Girls Summer of Code.  I built a Node/Express server with a React dashboard displaying notifications for WorldBrain chrome extension users.","archived":false,"fork":false,"pushed_at":"2017-09-19T13:04:32.000Z","size":2388,"stargazers_count":0,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-30T04:29:56.468Z","etag":null,"topics":[],"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/WorldBrain.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}},"created_at":"2017-08-30T21:13:40.000Z","updated_at":"2018-03-15T14:04:02.000Z","dependencies_parsed_at":"2023-06-30T00:15:14.558Z","dependency_job_id":null,"html_url":"https://github.com/WorldBrain/Notifications-Server","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/WorldBrain%2FNotifications-Server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WorldBrain%2FNotifications-Server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WorldBrain%2FNotifications-Server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WorldBrain%2FNotifications-Server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WorldBrain","download_url":"https://codeload.github.com/WorldBrain/Notifications-Server/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239581789,"owners_count":19662958,"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":[],"created_at":"2024-11-07T13:20:38.410Z","updated_at":"2025-10-29T16:18:50.598Z","avatar_url":"https://github.com/WorldBrain.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Notifications-Server\nThe Notification Server repo is meant to provide Worldbrain Admins to create and send notifications to their users.  In this case, users are those who have downloaded the chrome extension.  The notifications can then be viewed in their browser.\n\nExamples of possible notifications could include system updates, security notices and general updates to Worldbrain users.   \n\nThe Notifications Server is a MERN stack web app using Mongo-Express-React and Node.  The Notifications API is a list of notifications in JSON format which can be viewed at [https://salty-fjord-43561.herokuapp.com/api/notifications]\n\nNotifications are created and then posted and saved to a mongodb. On the front end, a react form posts new notifications to the database and the list maps all of the notifications.  A proxy API handles requests from the React app to the Node/Express server.  This is important because using a proxy ensures that we only need one port open, since Heroku doesn't allow multiple open ports to be deployed.\n\n## Getting Started\nThe deployed webapp can be viewed at [https://salty-fjord-43561.herokuapp.com/]\n\n## Installing\nAfter cloning the repo from [https://github.com/WorldBrain/Notifications-Server] please add these dependences:\n\nExpress: framework to set up and handle requests to our Node.js Server\nBody-Parser: parses incoming request bodies of new Notifications in JSON format\ncors: allow cross-origin requests for GET \u0026 POST json data\nNodemon: automatically restarts server each time a file is saved\nMongoose: provides methods and schema to interact with mongodb.  Note use version 4.10.8 to avoid deprecation warnings with promises.st\n\nInitialize the project:  \n$ npm init -y  \n\nInstall using:  \n$ npm i express body-parser cors nodemon mongoose --saved    \n\nStart the server and express api app:  \n$ npm start  \n(should be running on localhost:4001/api/notifications)  \n\nStart the client react app - cd into /client:  \n$ npm start  \n(should be running on localhost:3000)  \n\n## Testing routes\nTo create, read, update and delete notifications, using the routes specified in (./routes/api.js) we can use Postman.\n\n## Viewing mongodb data\nTo interact with MongoDB, you can either use Robomongo or Studio 3t (download whichever is most convenient).  It should automatically connect with mongo and you can create view the Notifications collection\n\n## Deploying\nThis project was created and deployed with Heroku.  First, the node server and mongo db were configured to show the notifications API.  The server and db were then deployed to Heroku.  In our heroku deploy commands, we also need a .gitignore file to ignore node_modules.\n\nDeploy commands (after logging into Heroku):  \n$ git init\n$ echo node_modules \u003e .gitignore  \n$ git add .  \n$ git commit -m \"Initial Commit\"  \n$ heroku create  \n$ git push heroku master  \n\nOnce deployed, a client folder for the front end react app is generated at the project's root directory.  The react app contains the react notification form and notification list components. These form saves new notifications to the database and API, and the list maps all of the notifications from the API.\n\n\ncd to client folder:  \n$ create-react-app client  \n\nA proxy script in the package.json ensures that a proxy API handles requests from the React app to the server. To create a proxy API, we add a proxy key in client/ package.json:\n\n\"proxy\": \"http://localhost:4002\"\n\nAfter creating our react components, we then need to re-deploy the webapp. We want to check in our new client code, build create-react-app, install dependencies and production dependencies.  For this, we require the following post-build script in root package.json:\n\n\"scripts\": {  \n  \"start\": \"node index.js\",  \n  \"heroku-postbuild\": \"cd client \u0026\u0026 npm install --only=dev \u0026\u0026 npm install \u0026\u0026 npm run build\"  \n}  \n\nThen for the final deploy to Heroku:  \n$ git add .  \n$ git commit -m \"ready to deploy react app\"  \n$ git push heroku master   \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fworldbrain%2Fnotifications-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fworldbrain%2Fnotifications-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fworldbrain%2Fnotifications-server/lists"}