{"id":18603783,"url":"https://github.com/dyzio18/selfcodehero","last_synced_at":"2025-05-06T19:06:28.355Z","repository":{"id":128092040,"uuid":"452037746","full_name":"Dyzio18/selfcodehero","owner":"Dyzio18","description":"Engage user with gamification engine. Gamification REST API.","archived":false,"fork":false,"pushed_at":"2022-03-20T18:21:47.000Z","size":484,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-31T01:51:22.486Z","etag":null,"topics":["docker","eslint","express","gamification","gamification-platform","gamification-service","mongodb","mongoose","nodejs","rest-api","selfcodehero"],"latest_commit_sha":null,"homepage":"https://selfcodehero.com","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Dyzio18.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-01-25T20:50:15.000Z","updated_at":"2024-10-13T22:34:38.000Z","dependencies_parsed_at":null,"dependency_job_id":"969a84a3-a9f3-4882-80e6-fd0ee6f08be8","html_url":"https://github.com/Dyzio18/selfcodehero","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/Dyzio18%2Fselfcodehero","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dyzio18%2Fselfcodehero/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dyzio18%2Fselfcodehero/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dyzio18%2Fselfcodehero/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Dyzio18","download_url":"https://codeload.github.com/Dyzio18/selfcodehero/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252751937,"owners_count":21798721,"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":["docker","eslint","express","gamification","gamification-platform","gamification-service","mongodb","mongoose","nodejs","rest-api","selfcodehero"],"created_at":"2024-11-07T02:15:31.512Z","updated_at":"2025-05-06T19:06:28.346Z","avatar_url":"https://github.com/Dyzio18.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SELFCODEHERO - easy gamification engine\n\nGamification engine based on REST API. Easy and reusable service to track user progress, badges, missions and other cool things.\n\n## Quick Start\n\nIf you would still prefer to do the installation manually, follow these steps:\n\nClone the repo:\n\n```bash\ngit clone https://github.com/dyzio18/selfcodehero.git\ncd selfcodehero\nrm -rf ./.git\n```\n\nInstall the dependencies:\n\n```bash\nyarn install \n# or\nnpm install\n```\n\nSet the environment variables:\n\n```bash\ncp .env.example .env\n\n# open .env and modify the environment variables (if needed)\n```\n\n## Table of Contents\n\n- [Features](#features)\n- [Commands](#commands)\n- [Environment Variables](#environment-variables)\n- [Project Structure](#project-structure)\n- [API Documentation](#api-documentation)\n- [Linting](#linting)\n- [Contributing](#contributing)\n\n## Features\n\n- **NoSQL database**: [MongoDB](https://www.mongodb.com) object data modeling using [Mongoose](https://mongoosejs.com)\n- **Authentication and authorization**: using [passport](http://www.passportjs.org)\n- **Validation**: request data validation using [Joi](https://github.com/hapijs/joi)\n- **Logging**: using [winston](https://github.com/winstonjs/winston) and [morgan](https://github.com/expressjs/morgan)\n- **Testing**: unit and integration tests using [Jest](https://jestjs.io)\n- **Error handling**: centralized error handling mechanism\n- **API documentation**: with [swagger-jsdoc](https://github.com/Surnet/swagger-jsdoc) and [swagger-ui-express](https://github.com/scottie1984/swagger-ui-express)\n- **Process management**: advanced production process management using [PM2](https://pm2.keymetrics.io)\n- **Dependency management**: with [Yarn](https://yarnpkg.com)\n- **Environment variables**: using [dotenv](https://github.com/motdotla/dotenv) and [cross-env](https://github.com/kentcdodds/cross-env#readme)\n- **Security**: set security HTTP headers using [helmet](https://helmetjs.github.io)\n- **Santizing**: sanitize request data against xss and query injection\n- **CORS**: Cross-Origin Resource-Sharing enabled using [cors](https://github.com/expressjs/cors)\n- **Compression**: gzip compression with [compression](https://github.com/expressjs/compression)\n- **CI**: continuous integration with [Travis CI](https://travis-ci.org)\n- **Docker support**\n- **Code coverage**: using [coveralls](https://coveralls.io)\n- **Code quality**: with [Codacy](https://www.codacy.com)\n- **Git hooks**: with [husky](https://github.com/typicode/husky) and [lint-staged](https://github.com/okonet/lint-staged)\n- **Linting**: with [ESLint](https://eslint.org) and [Prettier](https://prettier.io)\n- **Editor config**: consistent editor configuration using [EditorConfig](https://editorconfig.org)\n\n## Commands\n\nRunning locally:\n\n```bash\nyarn dev\n```\n\nRunning in production:\n\n```bash\nyarn start\n```\n\nTesting:\n\n```bash\n# run all tests\nyarn test\n\n# run all tests in watch mode\nyarn test:watch\n\n# run test coverage\nyarn coverage\n```\n\nDocker:\n\n```bash\n# run docker container in development mode\nyarn docker:dev\n\n# run docker container in production mode\nyarn docker:prod\n\n# run all tests in a docker container\nyarn docker:test\n```\n\nLinting:\n\n```bash\n# run ESLint\nyarn lint\n\n# fix ESLint errors\nyarn lint:fix\n\n# run prettier\nyarn prettier\n\n# fix prettier errors\nyarn prettier:fix\n```\n\n## Environment Variables\n\nThe environment variables can be found and modified in the `.env` file. They come with these default values:\n\n```bash\n# Port number\nPORT=3000\n\n# URL of the Mongo DB\nMONGODB_URL=mongodb://127.0.0.1:27017/node-boilerplate\n\n# JWT\n# JWT secret key\nJWT_SECRET=thisisasamplesecret\n# Number of minutes after which an access token expires\nJWT_ACCESS_EXPIRATION_MINUTES=30\n# Number of days after which a refresh token expires\nJWT_REFRESH_EXPIRATION_DAYS=30\n\n# SMTP configuration options for the email service\n# For testing, you can use a fake SMTP service like Ethereal: https://ethereal.email/create\nSMTP_HOST=email-server\nSMTP_PORT=587\nSMTP_USERNAME=email-server-username\nSMTP_PASSWORD=email-server-password\nEMAIL_FROM=support@yourapp.com\n```\n\n## Project Structure\n\n```\nsrc\\\n |--config\\         # Environment variables and configuration related things\n |--controllers\\    # Route controllers (controller layer)\n |--docs\\           # Swagger files\n |--middlewares\\    # Custom express middlewares\n |--models\\         # Mongoose models (data layer)\n |--routes\\         # Routes\n |--services\\       # Business logic (service layer)\n |--utils\\          # Utility classes and functions\n |--validations\\    # Request data validation schemas\n |--app.js          # Express app\n |--index.js        # App entry point\n```\n\n## API Documentation\n\nTo view the list of available APIs and their specifications, run the server and go to `http://localhost:3000/v1/docs` in your browser. This documentation page is automatically generated using the [swagger](https://swagger.io/) definitions written as comments in the route files.\n\n### API Endpoints\n\nList of available routes:\n\n**Auth routes**:\\\n`POST /v1/auth/register` - register\\\n`POST /v1/auth/login` - login\\\n`POST /v1/auth/refresh-tokens` - refresh auth tokens\\\n`POST /v1/auth/forgot-password` - send reset password email\\\n`POST /v1/auth/reset-password` - reset password\\\n`POST /v1/auth/send-verification-email` - send verification email\\\n`POST /v1/auth/verify-email` - verify email\n\n**User routes**:\\\n`POST /v1/users` - create a user\\\n`GET /v1/users` - get all users\\\n`GET /v1/users/:userId` - get user\\\n`PATCH /v1/users/:userId` - update user\\\n`DELETE /v1/users/:userId` - delete user\n\n**Game routes**:\\\n`POST /v1/games` - create a game\\\n`GET /v1/games` - get all games\\\n`GET /v1/games/:gameId` - get game\\\n`PATCH /v1/games/:gameId` - update game\\\n`DELETE /v1/games/:gameId` - delete game\n\n\n## Linting\n\nLinting is done using [ESLint](https://eslint.org/) and [Prettier](https://prettier.io).\n\nIn this app, ESLint is configured to follow the [Airbnb JavaScript style guide](https://github.com/airbnb/javascript/tree/master/packages/eslint-config-airbnb-base) with some modifications. It also extends [eslint-config-prettier](https://github.com/prettier/eslint-config-prettier) to turn off all rules that are unnecessary or might conflict with Prettier.\n\nTo modify the ESLint configuration, update the `.eslintrc.json` file. To modify the Prettier configuration, update the `.prettierrc.json` file.\n\nTo prevent a certain file or directory from being linted, add it to `.eslintignore` and `.prettierignore`.\n\nTo maintain a consistent coding style across different IDEs, the project contains `.editorconfig`\n\n\u003c!-- ## Contributing\n\nContributions are more than welcome! Please check out the [contributing guide](CONTRIBUTING.md). --\u003e\n\n## Credits\n\n- [hagopj13/node-express-boilerplate](https://github.com/hagopj13/node-express-boilerplate)\n\n## License\n\n[CC BY-NC-SA 4.0](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdyzio18%2Fselfcodehero","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdyzio18%2Fselfcodehero","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdyzio18%2Fselfcodehero/lists"}