{"id":22689171,"url":"https://github.com/wisekaa03/portal","last_synced_at":"2025-07-17T20:41:26.349Z","repository":{"id":37032760,"uuid":"240048159","full_name":"wisekaa03/portal","owner":"wisekaa03","description":"Nest.js, TypeORM, GraphQL, LDAP Service, Passport, Next.js (v10), React.js, Material UI (v4)","archived":false,"fork":false,"pushed_at":"2025-04-08T20:20:05.000Z","size":11380,"stargazers_count":13,"open_issues_count":54,"forks_count":6,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-12T21:52:23.243Z","etag":null,"topics":["graphql","ldap","material-ui","nestjs","nextjs","passportjs","react","reactjs","typeorm"],"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/wisekaa03.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":"2020-02-12T15:35:29.000Z","updated_at":"2024-06-23T03:07:33.000Z","dependencies_parsed_at":"2023-09-29T22:51:29.838Z","dependency_job_id":"d22b9304-2ae0-45eb-b7d2-96dd52cb9f47","html_url":"https://github.com/wisekaa03/portal","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wisekaa03%2Fportal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wisekaa03%2Fportal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wisekaa03%2Fportal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wisekaa03%2Fportal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wisekaa03","download_url":"https://codeload.github.com/wisekaa03/portal/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248637833,"owners_count":21137538,"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":["graphql","ldap","material-ui","nestjs","nextjs","passportjs","react","reactjs","typeorm"],"created_at":"2024-12-10T00:17:54.230Z","updated_at":"2025-04-12T21:52:28.605Z","avatar_url":"https://github.com/wisekaa03.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Portal\n\n[Nest.js](https://nestjs.com), [TypeORM](https://typeorm.io), [GraphQL](https://graphql.org/), [LDAP Service](https://github.com/wisekaa03/nestjs-ldap), [Passport](http://www.passportjs.org/), [Next.js (v9)](https://nextjs.org), [React.js](https://reactjs.org/), [Material UI (v4)](https://material-ui.com)\n\n## Features\n\n- [x] Cross platform - Mac, Linux and Windows\n- [x] API server - powered by [Nest](https://nestjs.com)\n- [x] Environment variables using [dotenv](https://github.com/motdotla/dotenv)\n- [x] Server Side Rendering - powered by [Next.js](https://nextjs.org)\n- [x] [Material UI](https://material-ui.com) design\n- [x] [TypeORM](https://typeorm.io)\n- [x] [GraphQL](https://graphql.org/)\n- [x] [React.js](https://reactjs.org/)\n- [x] User authentication - powered by [Passport](http://www.passportjs.org)\n- [x] LDAP through custom NestJS LDAPService\n- [x] [WebSockets](https://www.apollographql.com/docs/link/links/ws/)\n\n## Technologies\n\n- Hot reloading for the developer experience\n  - [Next.js](https://nextjs.org) - The React Framework\n- Lang\n  - [TypeScript](https://www.typescriptlang.org) - Javascript that scales\n- Linters\n  - [ESLint](https://eslint.org/) - A fully pluggable tool for identifying and reporting on patterns in JavaScript\n- Tests\n  - [Jest](https://jestjs.io/) - Delightful JavaScript Testing\n  - [Enzyme](https://airbnb.io/enzyme/) - JavaScript Testing utilities for React\n  - [@material-ui/core/test-utils](https://material-ui.com/guides/testing/)\n  - [@nestjs/testing](https://docs.nestjs.com/fundamentals/testing) - unit testing, e2e testing\n  - [Supertest](https://github.com/visionmedia/supertest) - for e2e testing\n- Server\n  - [nest](https://nestjs.com) - A progressive Node.js framework for building efficient, reliable and scalable server-side applications\n    - internally using [Express](https://expressjs.com) - Fast, unopinionated, minimalist web framework for Node.js\n    - [Nest.JS WebSockets](https://github.com/nestjs/nest/tree/master/packages/platform-ws)\n  - [Next.js](https://nextjs.org) - The React Framework\n- Environment variables\n  - [dotenv](https://github.com/motdotla/dotenv) - Loads environment variables from .env for nodejs projects\n- Database\n  - [PostgreSQL](https://www.postgresql.org) - The World's Most Advanced Open Source Relational Database\n  - [TypeORM](https://typeorm.io/) - TypeORM is an ORM that can run in NodeJS, Browser, Cordova, PhoneGap, Ionic, React Native, NativeScript, Expo, and Electron platforms and can be used with TypeScript and JavaScript (ES5, ES6, ES7, ES8)\n  - [GraphQL](https://github.com/graphql/express-graphql) - Create a GraphQL HTTP server with Express\n- User authentication\n  - [LDAP](https://github.com/wisekaa03/nestjs-ldap) - NestJS LDAP Service, internally using [ldapjs](http://ldapjs.org/)\n  - [Passport](http://www.passportjs.org) - Simple, unobtrusive authentication for Node.js\n- UI framework\n  - [Next.js](https://nextjs.org) - The React Framework\n  - [React](https://reactjs.org) - A JavaScript library for building user interfaces\n  - [Apollo GraphQL](https://www.apollographql.com/client/) - A fully-featured, production ready caching GraphQL client for every UI framework and GraphQL server\n  - [Material UI](https://material-ui.com) - React components that implement Google's Material Design.\n- WebSockets\n  - subscription\n\n## Setup\n\n### Database Setup\n\nPortal uses [PostgreSQL](https://www.postgresql.org).\n\n#### For Windows Users\n\n1. Install PostgreSQL 10 to your system.\n2. Add the bin directory of your postgresql installation to your PATH system environment variable. Warning! It must be system env, not user env!\n3. Make sure you have the latest npm installed.\n4. Start a new elevated shell (cmd.exe or powershell). E.g. \"run as administrator\". If you did not restart your system after step 2, then make sure that you can run the \"pg_config\" program from that shell.\nrun the commands below, in this order, in the same terminal. do not close and reopen the terminal between two commands!\n\n```bash\nnpm install --global --production windows-build-tools\nnpm install -g node-gyp\nnpm install -g pg-native\n```\n\nPlease note that installing node-gyp requires admin rights, so you must install it globally as admin, even if you only need it for one project. (I might be wrong, but this was my experience.)\n\n#### For Mac Users\n\n```bash\n# install postgresql\n$ brew install postgresql\n\n# if you want to start postgresql in startup, try do this\n$ brew services start postgresql\n\n# [MUST] create user \"portal\"\n$ createuser -P -l portal\n\n# [MUST] create database \"portal\" owened by \"portal\"\n$ createdb portal -O portaldb\n```\n\n#### PostgreSQL\n\n- Download an installer at \u003chttps://www.postgresql.org/download/windows\u003e\n- Run the installer with a flag `--install_runtimes 0` like this:\n\n```cmd\n\u003e postgresql-11.2-1-windows-x64.exe --install_runtimes 0\n```\n\n#### pgAdmin\n\n- Download a latest installer at \u003chttps://www.pgadmin.org/download\u003e\n- Run the pgAdmin and login with a root user\n- Right click `Login/Group Roles` and `Create \u003e Login/Group Role`\n  - `General` Panel:\n    - `Name`: `portal`\n  - `Definition` Panel:\n    - `Password`: `portalpwd`\n- Right click `Databases` and `Create \u003e Database`\n  - `General` Tab:\n    - `Database`: `portaldb`\n    - `Owner`: `portal`\n\n### Application Setup\n\n```bash\n# prepare `.env` and edit it for your own environments\n$ cp .env.example .env\n\n# install dependencies\n$ yarn\n\n# development mode\n$ yarn dev\n\n# production mode\n$ yarn build\n$ yarn start\n```\n\nThe `.env` file is like this:\n\n```bash\n# App\nPORT=4000\nDOMAIN=\"example.com\"\nDEVELOPMENT=\"true\"\n\n# Logging\nLOG_LEVEL=\"debug\"\nLOG_SERVER=\"gelf://graylog-udp.monitoring:12201?facility=local0\u0026bufferSize=1400\u0026deflate=optimal\"\n\n# DB\nDATABASE_URI=\"postgres://postgres:1234567890@postgresql.database:5432/postgres\"\nDATABASE_URI_RD=\"postgres://postgres:1234567890@postgresql-read.database:5432/postgres\"\nDATABASE_SCHEMA=\"public\"\nDATABASE_SYNCHRONIZE=\"false\"\nDATABASE_DROP_SCHEMA=\"false\"\nDATABASE_MIGRATIONS_RUN=\"true\"\nDATABASE_LOGGING=[\"error\"]\nDATABASE_REDIS_URI=\"redis://redis-master.production.svc.cluster.local:6379/0\"\n# time in milliseconds, 3000 ms = 3 seconds\nDATABASE_REDIS_TTL=\"3000\"\n\n# HTTP Redis\nHTTP_REDIS_URI=\"redis://localhost:6379/1\"\n# time in milliseconds, 600000 ms = 1000 * 60 * 10 minutes\nHTTP_REDIS_TTL=\"300\"\nHTTP_REDIS_MAX_OBJECTS=\"10000\"\n\n# Session Redis\nSESSION_REDIS_URI=\"redis://redis-master.production.svc.cluster.local:6379/2\"\n# time in milliseconds, 1200000 ms = 1000 * 60 * 20 minutes\nSESSION_COOKIE_TTL=\"1200000\"\nSESSION_SECRET=\"supersecret\"\n\n# LDAP\nLDAP={\"example.com\": {\"url\":\"ldaps://pdc.example.local:389\", \"bindDn\":\"CN=Administrator,DC=example,DC=local\", \"bindPw\":\"PaSsWoRd123\", \"searchBase\":\"DC=example,DC=local\", \"searchUser\":, \"searchGroup\":\"(\u0026(objectClass=group)(member={{dn}}))\", \"searchAllUsers\":\"(\u0026(\u0026(|(\u0026(objectClass=user)(objectCategory=person))(\u0026(objectClass=contact)(objectCategory=person)))))\", \"searchAllGroups\":\"objectClass=group\", \"newBase\":\"OU=User,DC=example,DC=local\"}}\n\n# LDAP Redis\nLDAP_REDIS_URI=\"redis://localhost:6379/3\"\n# time in milliseconds, 600000 ms = 1000 * 60 * 10 minutes\nLDAP_REDIS_TTL=\"300\"\n\n# MICROSERVICE\nMICROSERVICE_URL=\"redis://localhost:6379\"\n\n# SOAP\nTICKETS_URL=\"https://server1c\"\nTICKETS_REDIS_URI=\"redis://localhost:6379/5\"\nTICKETS_REDIS_TTL=\"60\"\nREPORTS_URL=\"https://server1c\"\nREPORTS_REDIS_URI=\"redis://localhost:6379/6\"\nREPORTS_REDIS_TTL=\"60\"\nDOCFLOW_URL=\"https://server1c\"\nDOCFLOW_REDIS_URI=\"redis://localhost:6379/7\"\nDOCFLOW_REDIS_TTL=\"60\"\n\n# OSTICKET\nOSTICKET_URL={\"auditors\": \"https://auditors-ticket.example.com/au/portal/ajax.php\", \"media\": \"https://media-ticket.example.com/mp/portal/ajax.php\"}\n\n# NEXTCLOUD\nNEXTCLOUD_URL=\"https://cloud.example.com\"\nNEXTCLOUD_REDIS_URI=\"redis://localhost:6379/4\"\nNEXTCLOUD_REDIS_TTL=\"60\"\n\n# NEWS\nNEWS_URL=\"https://news/wp/wp-json/wp/v2/posts\"\nNEWS_API_URL=\"https://news/wp/wp-content/\"\n\n# MAIL\nMAIL_URL=\"https://portal/roundcube\"\nMAIL_LOGIN_URL=\"/roundcube/login/index.php\"\n\n# MEETING\nMEETING_URL=\"https://meeting/\"\n```\n\n## Production Deployment\n\nWe use Kubernetes/Docker production.\n\n## Roadmaps\n\n- [x] Support: Mac, Linux and Windows\n- [x] Support: production usages\n- [x] Security: environment variables both server and client\n- [x] Security: production ready session store\n- [x] Security: custom auth guards\n- [x] Server: integration between [Nest](https://nestjs.com) and [Next.js](https://nextjs.org)\n- [x] UI: integration between [Next.js](https://nextjs.org) and [Material UI](https://material-ui.com)\n- [x] Authentication with LDAP\n- [x] Test: unit tests\n- [-] Test: e2e tests\n- [x] [Nest.JS WebSockets](https://github.com/nestjs/nest/tree/master/packages/platform-ws)\n- [x] [Apollo Link WebSockets](https://www.apollographql.com/docs/link/links/ws/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwisekaa03%2Fportal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwisekaa03%2Fportal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwisekaa03%2Fportal/lists"}