{"id":21239735,"url":"https://github.com/rodrigooler/erpzinho","last_synced_at":"2026-02-18T17:02:35.135Z","repository":{"id":258445226,"uuid":"873938497","full_name":"rodrigooler/erpzinho","owner":"rodrigooler","description":null,"archived":false,"fork":false,"pushed_at":"2024-10-22T01:01:23.000Z","size":337,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-09T12:14:05.573Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rodrigooler.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-10-17T01:23:05.000Z","updated_at":"2024-10-22T03:31:27.000Z","dependencies_parsed_at":"2025-10-09T12:13:54.710Z","dependency_job_id":"c2c515d4-eb78-4cc4-84a5-508666ee05a1","html_url":"https://github.com/rodrigooler/erpzinho","commit_stats":null,"previous_names":["rodrigooler/erpzinho"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rodrigooler/erpzinho","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rodrigooler%2Ferpzinho","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rodrigooler%2Ferpzinho/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rodrigooler%2Ferpzinho/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rodrigooler%2Ferpzinho/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rodrigooler","download_url":"https://codeload.github.com/rodrigooler/erpzinho/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rodrigooler%2Ferpzinho/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29587066,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-18T16:55:40.614Z","status":"ssl_error","status_checked_at":"2026-02-18T16:55:37.558Z","response_time":162,"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":[],"created_at":"2024-11-21T00:44:58.031Z","updated_at":"2026-02-18T17:02:35.108Z","avatar_url":"https://github.com/rodrigooler.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"ERPzinho\n========\n\nERPzinho is an open-source project with the goal of teaching new developers how to work with a complete TypeScript stack, consisting of NestJS for the backend and Angular for the frontend. The focus is to learn how to build a basic ERP (Enterprise Resource Planning) system, covering everything from database modeling to building an API with JWT authentication, all running in Docker containers.\n\nRequirements\n------------\n\n* **Node.js** (version 20+)\n* **Docker** and **Docker Compose**\n* **PostgreSQL**\n* **Prisma ORM**\n* **NestJS** framework\n\nObjective\n---------\n\nThis project was created to teach new developers how a fullstack application works, focusing on API architecture with NestJS, databases with Prisma and PostgreSQL, and frontend with Angular. Each step is clearly and objectively explained, offering a hands-on learning experience.\n\nGetting Started\n---------------\n\n### 1. Creating the Backend\n\n* Install NestJS and create a new API project:\n    \n    ```bash\n    npx nest new api\n    ```\n    \n    This will create the initial structure of your backend with NestJS.\n    \n* Install Prisma ORM dependencies to work with the database:\n    \n    ```bash\n    npm install nestjs-prisma @prisma/client\n    npm i -D prisma\n    ```\n    \n    The `nestjs-prisma` integrates Prisma with NestJS, making it easier to interact with the database.\n    \n\n### 2. Configuring Prisma\n\n* Initialize Prisma in your project:\n    \n    ```bash\n    ./node_modules/.bin/prisma init\n    ```\n    \n    This will generate the necessary structure to start modeling the database.\n    \n\n### 3. Running the Database with Docker\n\n* Use Docker Compose to spin up the PostgreSQL database:\n    \n    ```bash\n    docker compose -f \"docker-compose.yaml\" up -d --build\n    ```\n    \n    This will create and run a Docker container for PostgreSQL based on the `docker-compose.yaml` file.\n    \n\n### 4. Generating and Applying Migrations\n\n* After configuring your data schema in the `prisma/schema.prisma` file, you can generate the Prisma client and apply migrations to the database:\n    \n    ```bash\n    ./node_modules/.bin/prisma generate\n    ./node_modules/.bin/prisma migrate dev\n    ```\n    \n    The first command generates the Prisma client, which makes it easier to use the ORM, and the second applies migrations to the database.\n    \n\n### 5. Populating the Database\n\n* To run an SQL script inside the Docker container and populate the database, you can use the following command:\n    \n    ```bash\n    docker exec -it erp-db bash\n    psql -U postgres -d postgres -f /docker-entrypoint-initdb.d/your-script.sh\n    ```\n    \n    This allows you to run the initialization script directly on the PostgreSQL database running inside Docker.\n    \n\n### 6. Adding JWT for Authentication\n\n* To add JWT authentication to your API, install the corresponding package:\n    \n    ```bash\n    npm install --save @nestjs/jwt\n    ```\n    \n    This enables JWT-based token authentication, required to protect your routes.\n    \n\nData Modeling\n-------------\n\nThe database modeling is done in the `prisma/schema.prisma` file. Here’s a basic schema example:\n\nRunning the Project\n-------------------\n\n1. Start the database using Docker:\n    \n    ```bash\n    docker compose -f \"docker-compose.yaml\" up -d\n    ```\n    \n2. Apply migrations:\n    \n    ```bash\n    ./node_modules/.bin/prisma migrate dev\n    ```\n    \n3. Run the NestJS API:\n    \n    ```bash\n    npm run start:dev\n    ```\n    \n\nThe API will be running and available at `http://localhost:3000`.\n\nContributions\n-------------\n\nContributions are welcome! Feel free to open an issue or submit a pull request. This project aims to help in the learning process, so constructive feedback is extremely important.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frodrigooler%2Ferpzinho","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frodrigooler%2Ferpzinho","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frodrigooler%2Ferpzinho/lists"}