{"id":13406324,"url":"https://github.com/gobeam/truthy","last_synced_at":"2025-08-31T16:36:11.176Z","repository":{"id":38533849,"uuid":"334804961","full_name":"gobeam/truthy","owner":"gobeam","description":"Open source headless CMS API written using NestJS, that has pre built modules like User Management, Role Management, Permission Management, Email Module, Account Settings, OTP, Throttling, RBAC support, Localization, and many more. ","archived":false,"fork":false,"pushed_at":"2025-02-01T06:08:59.000Z","size":1126,"stargazers_count":539,"open_issues_count":0,"forks_count":99,"subscribers_count":9,"default_branch":"main","last_synced_at":"2025-03-31T20:07:13.593Z","etag":null,"topics":["api","api-rest","awesome-nestjs-boilerplate","boilerplate","cms","demo","headless-cms","nestjs","nestjs-api","nestjs-api-starter","nestjs-backend","nestjs-boilerplate","nestjs-demo","nodejs","postgresql","rbac-authorization","realworld-backend","throttle-requests","typescript","user-role-permission"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/gobeam.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2021-02-01T02:11:57.000Z","updated_at":"2025-03-27T02:36:42.000Z","dependencies_parsed_at":"2024-09-25T01:51:27.038Z","dependency_job_id":"6616f20a-f4d4-4b52-a21d-a49c9ce1dc54","html_url":"https://github.com/gobeam/truthy","commit_stats":{"total_commits":176,"total_committers":2,"mean_commits":88.0,"dds":0.005681818181818232,"last_synced_commit":"4a624a3209395ed5bc13c7c207e29e12df47c6bd"},"previous_names":[],"tags_count":5,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gobeam%2Ftruthy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gobeam%2Ftruthy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gobeam%2Ftruthy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gobeam%2Ftruthy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gobeam","download_url":"https://codeload.github.com/gobeam/truthy/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247730068,"owners_count":20986404,"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":["api","api-rest","awesome-nestjs-boilerplate","boilerplate","cms","demo","headless-cms","nestjs","nestjs-api","nestjs-api-starter","nestjs-backend","nestjs-boilerplate","nestjs-demo","nodejs","postgresql","rbac-authorization","realworld-backend","throttle-requests","typescript","user-role-permission"],"created_at":"2024-07-30T19:02:27.227Z","updated_at":"2025-04-07T21:11:58.906Z","avatar_url":"https://github.com/gobeam.png","language":"TypeScript","funding_links":["https://www.buymeacoffee.com/gobeam"],"categories":["TypeScript","Resources","boilerplate"],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\u003cimg src=\"./public/images/logo.svg\" alt=\"Truthy Logo\"\u003e\n\u003c/div\u003e\u003cbr\u003e\n\u003ch1 align=\"center\"\u003e\n  Truthy CMS (NestJS Headless API)\n\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e This repository is Backend API part of Truthy CMS written in NestJS. For Frontend please visit https://github.com/gobeam/truthy-react-frontend. This project includes API for Authentication, User Management, Role Management, Permission Management, Email Module, Account Settings, OTP, RBAC support, Localization, and many more. \u003c/p\u003e\n\u003cbr\u003e\n\u003cp align=\"center\"\u003e\n\u003cimg alt=\"GitHub package.json version\" src=\"https://img.shields.io/github/package-json/v/gobeam/truthy\"\u003e\n\u003cimg alt=\"Workflow test\" src=\"https://github.com/gobeam/truthy/actions/workflows/ci.yml/badge.svg\"\u003e\n\u003cimg alt=\"GitHub\" src=\"https://img.shields.io/github/license/gobeam/truthy\"\u003e\n\u003cimg alt=\"Lines of code\" src=\"https://img.shields.io/tokei/lines/github/gobeam/truthy\"\u003e\n\u003cimg src='https://www.codetriage.com/gobeam/truthy/badges/users.svg' alt='Open Source Helpers' /\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n\u003ca href=\"https://www.buymeacoffee.com/gobeam\" target=\"_blank\"\u003e\u003cimg src=\"https://cdn.buymeacoffee.com/buttons/v2/default-green.png\" alt=\"Buy Me A Coffee\" style=\"height: 60px !important;width: 217px !important;\" \u003e\u003c/a\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n  \u003csub\u003eCreated by \u003ca href=\"https://www.linkedin.com/in/roshan-ranabhat/\"\u003eRoshan Ranabhat (gobeam)\u003c/a\u003e and maintained with ❤️ by an amazing \u003ca href=\"https://github.com/gobeam/truthy-contributors\"\u003eteam of awesome developers\u003c/a\u003e.\u003c/sub\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003csub\u003eCheck Live code deployed here:  Backend API Docs: \u003ca href=\"http://157.245.148.131:7777/api-docs/\"\u003eSwagger Docs\u003c/a\u003e\n  Frontend: \u003ca href=\"http://157.245.148.131:3000\"\u003eTruthy CMS\u003c/a\u003e\n  \u003c/sub\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://gobeam.github.io/truthy-contributors/truthy.gif\" alt=\"Truthy CMS\" \u003e\n\u003c/p\u003e\n\n## Table of Contents\n\n- [Getting Started](#getting-started)\n- [Prerequisites](#Prerequisites)\n- [Available Scripts](#available-scripts)\n- [Setup](#setup)\n- [Docker Setup](#docker-setup)\n- [File Structure](#file-structure)\n- [Application Security](#application-security)\n- [Contributing](#contributing)\n- [Sponsors](#sponsors)\n- [License](#license)\n- [Acknowledgement](#acknowledgement)\n\n---\n\n## Getting Started\n\nThis project was created to help developers by bootstrapping basic modules that need to be present while creating a standard CMS. The main motto of this project was to save precious time while developing CMS and focus more on the core part. This project is trying to follow the best possible standard to make it optimized and production-ready. Hope you like it. \u003cbr\u003e\nIf you love it don't forget to share your experience. If you want to contribute to the Truthy CMS in any way like API, Frontend, Design, Logo you're more than welcome to do so. Our plan is to make this no. 1 CMS maintained by opensource community.\n\n---\n\n## Prerequisites\n\nNodeJS\nhttps://nodejs.org/en/\n\nTypescript\nhttps://www.typescriptlang.org/\n\nPostgresQL\nhttps://www.postgresql.org/\n\nRedis\nhttps://redis.io/\n\n---\n\n## Available Scripts\n\n### npx truthy-api\n\nThis commands downloads the latest version of truthy i.e NestJS Truthy CMS backend API.\n\nIn the project directory, you can run:\n\n### `yarn start:dev`\n\nRuns the app in the development \u0026 watch mode.\u003cbr\u003e\nOpen [http://localhost:7777/api-docs](http://localhost:7777/api-docs) to view swagger API docs in browser (only available in development mode).\u003cbr\u003e\nYou will also see any lint errors in the console.\n\n### `yarn build`\n\nBuilds the app for production to the `build` folder.\u003cbr\u003e\n\n### `yarn lint`\n\nLints all the files inside src,apps,libs,test folders and shows the results.\n\n### `yarn format`\n\nFormats all the files inside src using prettier with config provided in .prettierrc\n\n### `yarn coverage`\n\nRuns coverage test command and creates coverage folder with detail report which can be checked with:\n```bash\nyarn coveralls\n```\n\n### `yarn orm-create migration_file_name`\n\nUses Type ORM to create a migration file. `migration_file_name` is Migration file name to be created.\n\n### `yarn migrate`\n\nThis command is used to migrate existing migration file.\n\n### `yarn migration:rollback`\n\nThis command is used to rollback migration.\n\n### `yarn seed`\n\nThis command is used to run existing seeders.\n\n---\n\n## Setup\n\nFirst, you need to install the project using npx command\n\n```bash\nnpx truthy-api\n```\n\nor clone it using\n\n```bash\ngit clone https://github.com/gobeam/truthy.git\n```\n**You also need to run PostgresQL for database and Redis for key-val storage which will be used for queue and throttling.**\nAfter cloning the make changes in configuration file that exists in config folder which exists in root of project.\nFile names are named in accordance with environment you run project with. For example if you're running project in development environment you should make change in configuration of development.yml file. \n**Please keep in mind environment variables always overrides the config.**\n\nIf you want to run locally,\n```bash\nyarn start\n```\n*If you want to view swagger docs on development open http://localhost:7777/api-docs (assuming you are running application on 7777 port)*\n\nRun Migration\n```bash\nyarn migrate\n```\n\nRun Seeders\n```bash\nyarn seed\n```\n\nRollback Migration\n```bash\nyarn migration:rollback\n```\n\n---\n\n## Docker Setup\n\n**If you want to run project without docker you will not need to create .env file**\n\nIf you want to use **Docker** to deploy it on production or development stage\nFirst create a .env file copying from .env.example and add environment for below parameters only since it will be used for building container using docker-compose\n\n```env\nSERVER_PORT=7777\nDB_PASSWORD=root\nDB_USERNAME=postgres\nDB_DATABASE_NAME=truthy\nDB_PORT=5488\nREDIS_PORT=6399\n```\n\nAfter creating env file make changes in configuration in accordance with you development environment. Follow setup guide in case you missed it.\n \nNow to run containers do\n```bash\ndocker-compose build .\ndocker-compose up -d\n```\nThese commands will run 3 containers for PostgresQL, Redis and Main API.\n\nTo run migration on docker container\n```bash\ndocker exec -it \u003ccontainer_id_or_name\u003e yarn migrate\n```\n\nTo run seeder on docker container\n```bash\ndocker exec -it \u003ccontainer_id_or_name\u003e yarn seed\n```\n\n---\n\n## File Structure\n\nThis project follows the following file structure:\n\n```text\ntruthy\n├── config                                  * Contains all configuration files\n│   └── default.yml                         * Default configuration file.\n│   └── development.yml                     * Configuration file for development environment.\n│   └── production.yml                      * Configuration file for production environment.\n│   └── test.yml                            * Configuration file for test environment.    \n├── coverage                                * Coverage reports after running `yarn coverage` command. \n├── dist                                    * Optimized code for production after `yarn build` is run.\n├── images                                  * this folder is where uploaded profile images are stored. This folder is git ignored.\n├── src                  \n│   └── \u003cmodule\u003e                            * Folder where specific modules all files are stored\n│       └── dto                             * Data Transfer Objects.\n│       └── entity                          * Models for module.\n│       └── pipes                           * Includes validation pipes for NestJS modules.\n│       └── serializer                      * Includes serializer for model data.\n│       └── \u003cmodule\u003e.controller.ts          * Controller file.\n│       └── \u003cmodule\u003e.module.ts              * root module file for module.\n│       └── \u003cmodule\u003e.service.ts             * Service file for \u003cmodule\u003e.\n│       └── \u003cmodule\u003e.service.spec.ts        * Test file for service.\n│       └── \u003cmodule\u003e.repository.ts          * Repository file for \u003cmodule\u003e.\n│       └── \u003cmodule\u003e.repository.spec.ts     * Test file for repository.\n│   └── common                              * Common helpers function, dto, entity, exception, decorators etc.\n│   └── config                              * Configuration variables files.\n│   └── database                            * Database folders that includes migration and seeders file\n│       └── migrations                      * Migration folder includes all migration files.\n│       └── seeds                           * Seeds folder includes all seeders files.\n│   └── exception                           * Exception folder includes custom exceptions.\n│   └── app.module.ts                       * Root module of the application.\n│   └── main.ts                             * The entry file of the application which uses the core function NestFactory to create a Nest application instance.\n├── test                                    * Contains E2E tests \n```\n\n**Some important root files**\n\n```text\n.\n├── .editorconfig                           * Coding styles (also by programming language).\n├── .env                                    * Environment variables for docker.\n├── .prettierrc.js                          * Formatting Prettier options.\n├── .eslintrc.js                            * ESLint configuration and rules.\n├── .docker-compose.yml                     * Docker compose configuration.\n├── Dockerfile                              * Docker file for prod environment.\n├── Dockerfile.dev                          * Docker file for dev environment.\n├── tsconfig.json                           * Typescript configuration for application.\n```\n\n---\n\n## Application Security\n\n### Throttle\n\nBy default Throttle has been implemented for all API's. Redis is default driver to record throttle state data. You can easily change configuration from config files.\n\n### Two Factor Authentication (2FA)\n\nUser Will have 2FA authentication option available to be turned on or off. For 2FA time-based one-time password is used. A time-based one-time password (TOTP) application automatically generates an authentication code that changes after a certain period of time. Applications like [Authenticator](https://play.google.com/store/apps/details?id=com.azure.authenticator\u0026hl=en\u0026gl=US), [1Password](https://support.1password.com/one-time-passwords/), [Authy](https://authy.com/guides/github/) etc. can be used to generate TOTP. When you enable 2FA, you will be sent a QR code in your email which should be scanned from above mentioned application and TOTP will be generated by those applications.\n\n---\n\n## Contributing\n\nPull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.\nPlease make sure to update tests as appropriate. - see `CONTRIBUTING.md` for details.\n**If you want to be featured in contributors list on our home page please add PR on https://github.com/gobeam/truthy-contributors to provide your details.**\n\n---\n\n## License\n\nReleased under the MIT License - see `LICENSE.md` for details.\n\n---\n\n## Acknowledgement\n\n- [NestJS](https://github.com/nestjs/nest)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgobeam%2Ftruthy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgobeam%2Ftruthy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgobeam%2Ftruthy/lists"}