{"id":15020854,"url":"https://github.com/giuliano-marinelli/app-server","last_synced_at":"2026-01-31T16:01:14.533Z","repository":{"id":219348150,"uuid":"748813048","full_name":"giuliano-marinelli/app-server","owner":"giuliano-marinelli","description":"Template for web app based on Angular and Nest. This is the back-end.","archived":false,"fork":false,"pushed_at":"2025-10-16T04:31:56.000Z","size":1793,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-17T07:15:21.326Z","etag":null,"topics":["apollo","casl","device-detector-js","express","graphql","jwt","nest","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/giuliano-marinelli.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-01-26T19:54:50.000Z","updated_at":"2025-10-16T04:32:00.000Z","dependencies_parsed_at":"2024-05-13T15:31:48.483Z","dependency_job_id":"2175e72e-a75d-4ed8-84c1-53b0a85c1547","html_url":"https://github.com/giuliano-marinelli/app-server","commit_stats":{"total_commits":13,"total_committers":1,"mean_commits":13.0,"dds":0.0,"last_synced_commit":"183d0bb2c1f731e8dd951734a90c173210295cd8"},"previous_names":["giuliano-marinelli/app-server"],"tags_count":0,"template":true,"template_full_name":null,"purl":"pkg:github/giuliano-marinelli/app-server","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/giuliano-marinelli%2Fapp-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/giuliano-marinelli%2Fapp-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/giuliano-marinelli%2Fapp-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/giuliano-marinelli%2Fapp-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/giuliano-marinelli","download_url":"https://codeload.github.com/giuliano-marinelli/app-server/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/giuliano-marinelli%2Fapp-server/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28947567,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-31T14:26:55.697Z","status":"ssl_error","status_checked_at":"2026-01-31T14:26:52.545Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["apollo","casl","device-detector-js","express","graphql","jwt","nest","typeorm"],"created_at":"2024-09-24T19:55:46.112Z","updated_at":"2026-01-31T16:01:14.528Z","avatar_url":"https://github.com/giuliano-marinelli.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# App _2025_\n\n_This repository contains the **backend**._\n\nIt's a [Nest](https://nestjs.com/) project that serves the [app-client](https://github.com/giuliano-marinelli/app-client) via [Express](https://expressjs.com). It uses [GraphQL](https://graphql.org/) + [Apollo](https://www.apollographql.com/) for query the application endpoints, [JWT](https://jwt.io/) for authentication via token, with [device-detector-js](https://github.com/etienne-martin/device-detector-js) for secure sessions, [CASL](https://casl.js.org/) for authorization management, [TypeORM](https://typeorm.io/) for database schema and queries, and [class-validator](https://github.com/typestack/class-validator) for specific attributes validations. By default it's conneted to a [PostgreSQL](https://www.postgresql.org/) datasource, but it can be used with most databases (including [MySQL](https://www.mysql.com/), [MongoDB](https://www.mongodb.com/), [SQLServer](https://www.microsoft.com/es-es/sql-server), [MariaDB](https://mariadb.org/), etc).\n\nAdditionally, it uses [GraphQL Filters](https://github.com/giuliano-marinelli/nestjs-graphql-filter) for easily create and use Where and Order input types and Selection Set management.\n\n## Setup\n\n1. Install [Node.js](https://nodejs.org)\n2. Install the DBMS you want, by default install [PostgreSQL](https://www.postgresql.org/)\n3. From project root folder install all the dependencies: `npm install`\n4. For serve [app-client](https://github.com/giuliano-marinelli/app-client), it must be located at sibling folder of this project, as shown:\n\n```\napp\n└─ app-client\n└─ app-server\n   └─ uploads (this is where server saves users uploaded files)\n```\n\n## Run\n\n### Development\n\nRun `npm run start:dev` or `npm run start:watch`: execute [nest start](https://docs.nestjs.com/cli/usages#nest-start) that compiles and runs the server in watch mode (if corresponding command is used) and put it listening at [localhost:3000](http://localhost:3000) where [app-client](https://github.com/giuliano-marinelli/app-client) is hosted and accessible. Any change on source code automatically creates a new bundle if in watch mode.\n\nRun `npm run start:debug`: execute [nest start](https://docs.nestjs.com/cli/usages#nest-start) in debug and watch mode for showing debug information on console, including breakpoints and stack traces.\n\n### Production\n\nRun `npm run build`: execute [nest build](https://docs.nestjs.com/cli/usages#nest-build) that compiles to **dist** folder at the project root folder for been used with [node](https://nodejs.org).\n\nRun `npm run start:prod`: execute [node](https://nodejs.org) command over **dist/main** folder to start server at [localhost:3000](http://localhost:3000).\n\n### Format and Lint\n\nRun `npm run format`: formats the code using [Prettier](https://prettier.io/), which enforces a consistent style.\n\nRun `npm run lint`: runs [ESLint](https://eslint.org/) to lint the code, for catching potential errors and enforcing coding standards.\n\nRun `npm run lint:fix`: runs [ESLint](https://eslint.org/) to lint the code, and automatically fix linting errors and warnings.\n\n### Test\n\nRun `npm run test` or `npm run test:watch`: executes [jest](https://jestjs.io/) to run the unit tests in watch mode (if corresponding command is used). Any change on source code automatically creates a new bundle if in watch mode.\n\nRun `npm run test:cov`: executes [jest](https://jestjs.io/) to run the unit tests and generate a code coverage report.\n\nRun `npm run test:e2e`: executes [jest](https://jestjs.io/) to run the end-to-end tests.\n\n## Progressive Web App (PWA)\n\nBoth client and server are configured to support PWA features, allowing for a more app-like experience on the web. This includes service workers for offline support, as well as manifest files for home screen installation.\n\nFor allow PWA features, the application must be served over HTTPS, which is already configured in the server. Also, it is necessary to provide a valid SSL certificate.\n\nFor development, self-signed certificates can be used. Use [mkcert](https://github.com/FiloSottile/mkcert) to create and install a local CA (Certificate Authority) and generate locally trusted certificates.\n\nFirstly, install mkcert by following the instructions in the [mkcert repository](https://github.com/FiloSottile/mkcert#installation).\n\nThen, run the following commands to create and install the local CA:\n\n```bash\nmkcert -install\n```\n\nAfter the CA is installed, you can generate a certificate and key for your local server:\n\n```bash\ncd ./src/ssl # navigate to the ssl folder\nmkcert -key-file key.pem -cert-file cert.pem localhost 127.0.0.1 ::1 192.168.1.40\n# replace the IP address with your host IP in the LAN for access in other devices\n```\n\nThis will create two files: `cert.pem` (the certificate) and `key.pem` (the private key). These files will be used by the server to establish secure HTTPS connections.\n\nIf you want to access the PWA features from other devices in your local network, make sure to use the host IP address (e.g., `192.168.1.40`) in the `mkcert` command. **And more important**, you have to copy and set the `rootCA.pem` file into your device's trusted CA store.\n\nYou can find the `rootCA.pem` file by using the next command after **mkcert** has been installed in your host:\n\n```bash\nmkcert -CAROOT\n```\n\nIn **Android** you have to go to `Settings \u003e Security \u0026 Privacy \u003e Advanced (sometimes)  \u003e Install certificate from storage` and add the copied `rootCA.pem`.\n\nSee more about this at [mkcert documentation](https://github.com/FiloSottile/mkcert?tab=readme-ov-file#installing-the-ca-on-other-systems)\n\n## Scaffolding\n\nOn this project are included resource scaffolding templates, that can be used for create new resources (module, service, resolver, entities) using [Plop](https://plopjs.com/) as generator.\n\nIt will use the entities defined in a .erd file like the included at **docs/model.erd**.\n\nER Model can be edited using [BigER Modeling Tool Extension](https://marketplace.visualstudio.com/items?itemName=BIGModelingTools.erdiagram) for [VSCode](https://code.visualstudio.com/).\n\nTo create a new resource, first install plop globally if you haven't already:\n\n```bash\nnpm install -g plop\n```\n\nThen, run the following command in the project root folder:\n\n```bash\nplop resource\n```\n\nThis will prompt you to enter the **.erd file location** _(by default docs/model.erd)_. The **name of the entity** you want to create (it should match one of the entities defined in your .erd file, e.g.: _User_). Any **embedded entities** that you want to include into the main entity (e.g.: _Profile_ in _User_). And if you want to **import the resource** in the main app module.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgiuliano-marinelli%2Fapp-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgiuliano-marinelli%2Fapp-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgiuliano-marinelli%2Fapp-server/lists"}