All Projects โ†’ gobeam โ†’ truthy

gobeam / truthy

Licence: MIT license
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.

Programming Languages

typescript
32286 projects
Pug
443 projects
CSS
56736 projects
javascript
184084 projects - #8 most used programming language
Dockerfile
14818 projects
shell
77523 projects

Projects that are alternatives of or similar to truthy

ack-nestjs-mongoose
NestJs Boilerplate. Authentication (OAuth2), Mongoose, MongoDB , Configuration, Multi Languages (i18n), etc. Advance Example ๐Ÿฅถ. NestJs v8 ๐Ÿฅณ๐ŸŽ‰. Production Ready ๐Ÿš€๐Ÿ”ฅ
Stars: โœญ 81 (-59.5%)
Mutual labels:  nestjs, nestjs-backend, nestjs-boilerplate
nestjs-api-mongoose
Collection example apps with NestJS and Typeorm, Sequelize, Mongodb, PostgreSQL, MySQL, GraphQL, Mercurius, etc. for the NestJS community ๐Ÿ˜ป
Stars: โœญ 153 (-23.5%)
Mutual labels:  api-rest, nestjs, nestjs-backend
prime-nestjs
A production-ready NestJS boilerplate using Typescript, Postgres, TypeORM, and Docker.
Stars: โœญ 140 (-30%)
Mutual labels:  nestjs, nestjs-backend, nestjs-boilerplate
kanban-project-management
Web Application to manage software development projects.
Stars: โœญ 39 (-80.5%)
Mutual labels:  nestjs, nestjs-backend
nest-admin
NestJs CRUD for RESTful APIไฝฟ็”จ nestjs + mysql + typeorm + redis + jwt + swagger ไผไธšไธญๅŽๅฐ็ฎก็†็ณป็ปŸ้กน็›ฎRBACๆƒ้™็ฎก็†(็ป†็ฒ’ๅบฆๅˆฐๆŒ‰้’ฎ)ใ€ๅฎž็Žฐๅ•็‚น็™ปๅฝ•็ญ‰ใ€‚
Stars: โœญ 165 (-17.5%)
Mutual labels:  nestjs, nestjs-backend
daruma-backend
๐ŸŽŽ Shared Expense Manager (Backend) - NestJS+DDD+CQRS+Event Sourcing ๐ŸŽŽ
Stars: โœญ 70 (-65%)
Mutual labels:  nestjs, nestjs-backend
MyAPI
A template to create awesome APIs easily โšก๏ธ
Stars: โœญ 117 (-41.5%)
Mutual labels:  nestjs, nestjs-backend
framework
The target of this framework is to help in all the needs of a full featured API REST, from top to bottom, and at the same time having the best possible performance and security.
Stars: โœญ 88 (-56%)
Mutual labels:  api-rest, headless-cms
Cockpit
Add content management functionality to any site - plug & play / headless / api-first CMS
Stars: โœญ 5,173 (+2486.5%)
Mutual labels:  api-rest, headless-cms
nestjs-api-example
NestJS Example
Stars: โœญ 60 (-70%)
Mutual labels:  nestjs, nestjs-boilerplate
serverless-nestjs-typeorm
Example how to nestjs using the serverless framework with TypeORM
Stars: โœญ 99 (-50.5%)
Mutual labels:  nestjs, nestjs-backend
nestjs-pdf
Nest js pdf generator
Stars: โœญ 55 (-72.5%)
Mutual labels:  nestjs, nestjs-backend
buscador-ao
Ponto de obtenรงรฃo de informaรงรตes pรบblicas de Angola
Stars: โœญ 21 (-89.5%)
Mutual labels:  api-rest, nestjs
nuxtjs-nestjs-starter
Starter project for nuxtjs and nestjs all in one integrated.
Stars: โœญ 56 (-72%)
Mutual labels:  nestjs
graphql-utils
Utilities and helpers to make working with GraphQL.js based APIs simpler.
Stars: โœญ 42 (-79%)
Mutual labels:  nestjs
nest-serve
ไฝฟ็”จ Nestjs 8.x ไปฅๅพฎๆœๅŠกๆ–นๅผๅผ€ๅ‘็š„ๅŸบ็ก€็ฎก็†ๅŽๅฐๆœๅŠก๏ผŒๅนถๆญ้… React ๅผ€ๅ‘็š„็ฎก็†ๅŽๅฐๅ‰็ซฏ๏ผˆๅฏ่‡ช่กŒๆ นๆฎ swagger ็š„ๆŽฅๅฃๅผ€ๅ‘ๅฏนๅบ”็š„็ฎก็†ๅŽๅฐๅ‰็ซฏ๏ผ‰
Stars: โœญ 97 (-51.5%)
Mutual labels:  nestjs
mpcast-minapp-uni
ๆ’ญ(ๅฎข)่ฏพๅฐ็จ‹ๅบ
Stars: โœญ 14 (-93%)
Mutual labels:  nestjs
mkm-sdk
Python SDK for Magickartenmarkt API
Stars: โœญ 33 (-83.5%)
Mutual labels:  api-rest
nestjs-extensions
[WIP] A bunch of useful and opinionated filters, modules, pipes... to use with Nest framework. ๐Ÿ˜ป
Stars: โœญ 43 (-78.5%)
Mutual labels:  nestjs
azure-serverless-deprecated
[Deprecated] Azure Serverless module for Nest framework (node.js) ๐ŸŒฉ
Stars: โœญ 44 (-78%)
Mutual labels:  nestjs
Truthy Logo

Truthy CMS (NestJS Headless API)

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.


GitHub package.json version Workflow test GitHub Lines of code Open Source Helpers

Buy Me A Coffee

Created by Roshan Ranabhat (gobeam) and maintained with โค๏ธ by an amazing team of awesome developers.

Check Live code deployed here: Backend API Docs: Swagger Docs Frontend: Truthy CMS

Truthy CMS

Table of Contents


Getting Started

This 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.
If 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.


Prerequisites

NodeJS https://nodejs.org/en/

Typescript https://www.typescriptlang.org/

PostgresQL https://www.postgresql.org/

Redis https://redis.io/


Available Scripts

npx truthy-api

This commands downloads the latest version of truthy i.e NestJS Truthy CMS backend API.

In the project directory, you can run:

yarn start:dev

Runs the app in the development & watch mode.
Open http://localhost:7777/api-docs to view swagger API docs in browser (only available in development mode).
You will also see any lint errors in the console.

yarn build

Builds the app for production to the build folder.

yarn lint

Lints all the files inside src,apps,libs,test folders and shows the results.

yarn format

Formats all the files inside src using prettier with config provided in .prettierrc

yarn format

Formats all the files inside src using prettier with config provided in .prettierrc

yarn coverage

Runs coverage test command and creates coverage folder with detail report which can be checked with:

yarn coveralls

yarn orm-create migration_file_name

Uses Type ORM to create a migration file. migration_file_name is Migration file name to be created.

yarn migrate

This command is used to migrate existing migration file.

yarn migration:rollback

This command is used to rollback migration.

yarn seed

This command is used to run existing seeders.


Setup

First, you need to install the project using npx command

npx truthy-api

or clone it using

git clone https://github.com/gobeam/truthy.git

You also need to run PostgresQL for database and Redis for key-val storage which will be used for queue and throttling. After cloning the make changes in configuration file that exists in config folder which exists in root of project. File 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. Please keep in mind environment variables always overrides the config.

If you want to run locally,

yarn start

If you want to view swagger docs on development open http://localhost:7777/api-docs (assuming you are running application on 7777 port)

Run Migration

yarn migrate

Run Seeders

yarn seed

Rollback Migration

yarn migration:rollback

Docker Setup

If you want to run project without docker you will not need to create .env file

If you want to use Docker to deploy it on production or development stage First 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

SERVER_PORT=7777
DB_PASSWORD=root
DB_USERNAME=postgres
DB_DATABASE_NAME=truthy
DB_PORT=5488
REDIS_PORT=6399

After creating env file make changes in configuration in accordance with you development environment. Follow setup guide in case you missed it.

Now to run containers do

docker-compose build .
docker-compose up -d

These commands will run 3 containers for PostgresQL, Redis and Main API.

To run migration on docker container

docker exec -it <container_id_or_name> yarn migrate

To run seeder on docker container

docker exec -it <container_id_or_name> yarn seed

File Structure

This project follows the following file structure:

truthy
โ”œโ”€โ”€ config                                  * Contains all configuration files
โ”‚   โ””โ”€โ”€ default.yml                         * Default configuration file.
โ”‚   โ””โ”€โ”€ development.yml                     * Configuration file for development environment.
โ”‚   โ””โ”€โ”€ production.yml                      * Configuration file for production environment.
โ”‚   โ””โ”€โ”€ test.yml                            * Configuration file for test environment.    
โ”œโ”€โ”€ coverage                                * Coverage reports after running `yarn coverage` command. 
โ”œโ”€โ”€ dist                                    * Optimized code for production after `yarn build` is run.
โ”œโ”€โ”€ images                                  * this folder is where uploaded profile images are stored. This folder is git ignored.
โ”œโ”€โ”€ src                  
โ”‚   โ””โ”€โ”€ <module>                            * Folder where specific modules all files are stored
โ”‚       โ””โ”€โ”€ dto                             * Data Transfer Objects.
โ”‚       โ””โ”€โ”€ entity                          * Models for module.
โ”‚       โ””โ”€โ”€ pipes                           * Includes validation pipes for NestJS modules.
โ”‚       โ””โ”€โ”€ serializer                      * Includes serializer for model data.
โ”‚       โ””โ”€โ”€ <module>.controller.ts          * Controller file.
โ”‚       โ””โ”€โ”€ <module>.module.ts              * root module file for module.
โ”‚       โ””โ”€โ”€ <module>.service.ts             * Service file for <module>.
โ”‚       โ””โ”€โ”€ <module>.service.spec.ts        * Test file for service.
โ”‚       โ””โ”€โ”€ <module>.repository.ts          * Repository file for <module>.
โ”‚       โ””โ”€โ”€ <module>.repository.spec.ts     * Test file for repository.
โ”‚   โ””โ”€โ”€ common                              * Common helpers function, dto, entity, exception, decorators etc.
โ”‚   โ””โ”€โ”€ config                              * Configuration variables files.
โ”‚   โ””โ”€โ”€ database                            * Database folders that includes migration and seeders file
โ”‚       โ””โ”€โ”€ migrations                      * Migration folder includes all migration files.
โ”‚       โ””โ”€โ”€ seeds                           * Seeds folder includes all seeders files.
โ”‚   โ””โ”€โ”€ exception                           * Exception folder includes custom exceptions.
โ”‚   โ””โ”€โ”€ app.module.ts                       * Root module of the application.
โ”‚   โ””โ”€โ”€ main.ts                             * The entry file of the application which uses the core function NestFactory to create a Nest application instance.
โ”œโ”€โ”€ test                                    * Contains E2E tests 

Some important root files

.
โ”œโ”€โ”€ .editorconfig                           * Coding styles (also by programming language).
โ”œโ”€โ”€ .env                                    * Environment variables for docker.
โ”œโ”€โ”€ .prettierrc.js                          * Formatting Prettier options.
โ”œโ”€โ”€ .eslintrc.js                            * ESLint configuration and rules.
โ”œโ”€โ”€ .docker-compose.yml                     * Docker compose configuration.
โ”œโ”€โ”€ Dockerfile                              * Docker file for prod environment.
โ”œโ”€โ”€ Dockerfile.dev                          * Docker file for dev environment.
โ”œโ”€โ”€ tsconfig.json                           * Typescript configuration for application.

Application Security

Throttle

By 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.

Two Factor Authentication (2FA)

User 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, 1Password, Authy 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.


Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. Please make sure to update tests as appropriate. - see CONTRIBUTING.md for details. 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.


Sponsors


License

Released under the MIT License - see LICENSE.md for details.


Acknowledgement

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].