{"id":23991211,"url":"https://github.com/sayed94h/hear-my-story","last_synced_at":"2025-06-25T17:03:08.163Z","repository":{"id":54986991,"uuid":"322955288","full_name":"Sayed94h/Hear-My-Story","owner":"Sayed94h","description":"The final project of Hack Your Future Belgium. We as a strong and energic team, work on a full stack project.","archived":false,"fork":false,"pushed_at":"2021-01-19T20:29:27.000Z","size":27925,"stargazers_count":2,"open_issues_count":9,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-07T19:29:53.298Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://hear-my-story.herokuapp.com/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Sayed94h.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-12-19T23:15:40.000Z","updated_at":"2021-02-19T16:30:42.000Z","dependencies_parsed_at":"2022-08-14T08:11:05.760Z","dependency_job_id":null,"html_url":"https://github.com/Sayed94h/Hear-My-Story","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/Sayed94h%2FHear-My-Story","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sayed94h%2FHear-My-Story/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sayed94h%2FHear-My-Story/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sayed94h%2FHear-My-Story/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Sayed94h","download_url":"https://codeload.github.com/Sayed94h/Hear-My-Story/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240605711,"owners_count":19827981,"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":"2025-01-07T19:30:01.868Z","updated_at":"2025-02-25T04:44:01.663Z","avatar_url":"https://github.com/Sayed94h.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Organized for Deployment\n\nA model of how you can set up your project for development, testing \u0026 deployment.\n\n### Contents\n\n* [General](#general)\n  * [Configuration](#configuration)\n* [Development](#development)\n  * [Getting started](#getting-started)\n  * [API](#api)\n  * [Client](#client)\n  * [Full App](#full-app)\n* [Deployment](#deployment)\n  * [Mock](#mock)\n  * [Manual](#manual)\n  * [Automated](#automated)\n* [Testing](#testing)\n  * [Frontend](#Frontend)\n  * [Backend](#backend)\n* [Helpful Links](#helpful-links)\n\n## General\n\n### Configuration\n\nThis application reads the secrets from a `.env` [file](https://en.wikipedia.org/wiki/Environment_variable) at the root of this project. A secret is something you don't want to commit to a public repository. The password for your database for instance. A node package [dotenv](https://github.com/motdotla/dotenv) is used to read and parse this file and provides an interface we can use.\n\nCreate a file called `.env` to the root. \n\n\n```\nDB_HOST=YOUR_IP_OR_DOMAIN\nDB_NAME=YOUR_DATABASE_NAME\nDB_USER=YOUR_DATABASE_USER\nDB_PASSWORD=YOUR_DATABASE_USER_PASSWORD\nJWT_SECRET=A_JWT_SECRET_A_RANDOM_STRING_OF_CHARACTERS\n```\n\n`DB_HOST` A domain or IP the host of your database.\n\n`DB_NAME` The name of your database. The application will connect to this database.\n\n`DB_USER` User used to authenticate to the database. Typically a user called `root` is created in MySQL. Although it is not recommend to use that user in production.\n\n`JWT_SECRET` Within the app a standard called [JWT](https://jwt.io/introduction/) is used to manage authorization. This requires a random complicated password like string to sign tokens.\n\n## Development\n\n### Getting started\n\nMake sure you configure your secrets in line with your development environment. See the [configuration section](#configuration).\n\nInstall backend dependencies.\n\n```\nnpm install\n```\n\nInstall frontend dependencies\n\n```\nyarn install\n```\n\n#### Database\n\nYour application will need to persist data. The interaction with the database is abstracted by an [ORM (Object role modelling)](https://nl.wikipedia.org/wiki/Object_role_modeling) called [Sequalize](https://sequelize.org/) . \n\nMake sure you configure your secrets in line with your development environment. See the [configuration section](#configuration).\nYou can create the database and tables by running the `sync.js` script.\n\n```\nnode api/scripts/sync.js\n```\n\nOptionally you can seed the tables with some test data by running:\n\n```\nnode api/scripts/seed.js\n```\n\n### API (Backend)\n\nTo develop just the API separately from the frontend run:\n\n```bash\nnpm run dev-api\n```\n\nThis will run your api as though it were part of the full live project.  All routes will be have `api/` appended before them and a get request to `/` will return the string `\"frontend\"`\n\n### Client (Frontend)\n\nTo develop just the frontend separately from the API run:\n\n```bash\nnpm run dev-client\n```\n\n\u003e DISCLAIMER!  this will only work if you have set up a mock-api\n\n### Full App\n\nYou can also develop the frontend and API in parallel by running:\n\n```bash\nnpm run dev\n```\n\nThis script will run the frontend and backend on separate ports, the backend on `localhost:5000` with [nodemon](https://nodemon.io/). The frontend will be run using [create-react-app's](https://github.com/facebook/create-react-app) `start` script, redirecting all API calls to `localhost:5000`.\n\n[TOP](#organized-for-deployment)\n\n---\n\n## Deployment\n\nThe main `index.js` in this directory is for deployment. It provides access to your api behind `/api` and statically serves the client from `/client/build`.  You can copy-paste this file directly, there should be need to modify it for your project.\n\nIn order for your project to run on Heroku, the main `package.json` needs a `start` command.  This is already taken care of for you.\n\n### Mock\n\nTo mock deployment on your local machine you can run these commands.  The app will build and run the same as it will on Heroku to help you troubleshoot your deployed project locally.\n\n```bash\nnpm run heroku-postbuild\nnpm run start\n```\n\n### Getting started\n\nCreate a [Heroku account](https://signup.heroku.com/) and install the [Heroku cli](https://devcenter.heroku.com/articles/heroku-cli).\nVerify the installation with\n```bash\nheroku status\n```\n\nInitialize Heroku inside the project folder by using:\n\n```bash\nheroku create\n```\n\n\u003e Note it is likely you want to create the app with some options, a useful for the project.\n\n### Manual\n\nYou can deploy your project from your local machine by pushing to the Heroku master repository.\n\n```\ngit push heroku master\n```\n\n[TOP](#organized-for-deployment)\n\n---\n\n## Testing\nTo locally execute your tests, run the following commands\n\n### Frontend\n\n```bash\ncd client\nnpm install\nnpm run test:watch\n```\n\n### Backend\n\n```bash\ncd api\nnpm install\nnpm run test:watch\n```\n\n### Continuous integration\n\nTest run on each commit on the master branch using [Github actions](https://docs.github.com/en/free-pro-team@latest/actions). The configuration can be found in `.github/workflows/node.js.yml`.\n\n[TOP](#organized-for-deployment)\n\n---\n\n## Helpful Links\n\n* [Heroku devhints](https://devhints.io/heroku)\n* [Heroku DevCenter: Node.js Support](https://devcenter.heroku.com/articles/nodejs-support)\n* [Heroku DevCenter: Advanced Automation](https://devcenter.heroku.com/articles/multiple-environments#advanced-linking-local-branches-to-remote-apps)\n\n[TOP](#organized-for-deployment)\n\n---","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsayed94h%2Fhear-my-story","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsayed94h%2Fhear-my-story","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsayed94h%2Fhear-my-story/lists"}