{"id":17930931,"url":"https://github.com/nilsriga/currency","last_synced_at":"2026-05-01T22:31:42.330Z","repository":{"id":259122724,"uuid":"874760030","full_name":"nilsriga/currency","owner":"nilsriga","description":"NestJs NextJs Typescript SSR PWA","archived":false,"fork":false,"pushed_at":"2024-10-28T19:14:30.000Z","size":1908,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-03T10:28:44.834Z","etag":null,"topics":["cicd","mysql","nestjs","next-pwa","nextjs14","nginx","pwa","ssr","typeorm"],"latest_commit_sha":null,"homepage":"https://nilsriga.github.io/currency/","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/nilsriga.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}},"created_at":"2024-10-18T12:14:36.000Z","updated_at":"2024-10-28T19:14:34.000Z","dependencies_parsed_at":"2024-12-16T06:53:52.244Z","dependency_job_id":null,"html_url":"https://github.com/nilsriga/currency","commit_stats":null,"previous_names":["nilsriga/currency"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/nilsriga/currency","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nilsriga%2Fcurrency","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nilsriga%2Fcurrency/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nilsriga%2Fcurrency/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nilsriga%2Fcurrency/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nilsriga","download_url":"https://codeload.github.com/nilsriga/currency/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nilsriga%2Fcurrency/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32515837,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"online","status_checked_at":"2026-05-01T02:00:05.856Z","response_time":64,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["cicd","mysql","nestjs","next-pwa","nextjs14","nginx","pwa","ssr","typeorm"],"created_at":"2024-10-28T21:18:39.888Z","updated_at":"2026-05-01T22:31:42.311Z","avatar_url":"https://github.com/nilsriga.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Currency Rate Conversion Chart\nLive demo available at [https://nilsriga.ddns.net](https://nilsriga.ddns.net)\n\nThis repository contains the completed test project for **Trodo**, implementing a currency rate conversion chart using an external API. The project includes a **NestJS** backend, a **NextJS** SSR frontend, and is designed to run with a CI/CD pipeline, **Nginx** reverse proxy, and **PM2** process management. It is fully documented at [https://nilsriga.github.io/currency/](https://nilsriga.github.io/currency/) and includes setup instructions, detailed API documentation, and testing protocols.\n\n## Project Overview\n\n- **Backend**: NestJS API with MySQL database and TypeORM, with Sentry for monitoring.\n- **Frontend**: Next.js (SSR) PWA with Redux and 100% Lighthouse score.\n- **CI/CD**: GitHub Actions configured for unit, integration, and e2e testing.\n- **Production Setup**: Nginx reverse proxy, PM2 process management, self-hosted runner.\n- **Documentation**: Full project documentation hosted via Jekyll in `/docs`.\n\n## Table of Contents\n1. [Project Structure](#project-structure)\n2. [Setup Instructions](#setup-instructions)\n3. [Development Commands](#development-commands)\n4. [Testing](#testing)\n5. [Production Setup](#production-setup)\n6. [CI/CD Pipeline](#cicd-pipeline)\n7. [Documentation](#documentation)\n\n## Project Structure\n\n```\n.\n├── .github              # GitHub Actions for CI/CD\n├── admin                # Admin tools, including database dump and ecosystem config for PM2\n├── back                 # Backend API (NestJS)\n├── docs                 # Jekyll documentation for full project overview\n├── front                # Main frontend (Next.js, SSR, PWA)\n└── front-vanilla        # Alternate frontend in vanilla React (is working)\n```\n\n## Setup Instructions\n\n### 1. Repository and Dependencies\nFirst, download the repository and install the dependencies for each section:\n\n```bash\ngit clone \u003crepository-url\u003e\ncd \u003crepository-directory\u003e\n```\n\n### 2. Backend Setup (NestJS)\n\n1. **Navigate to the backend directory**:\n   ```bash\n   cd back\n   ```\n\n2. **Install MySQL** (if not installed). Then create a new MySQL database.\n\n3. **Configure Environment Variables**:\n   - Duplicate `example.env` as `.env` in the `back` folder.\n   - Fill out `.env` with your MySQL connection details.\n\n4. **Install dependencies**:\n   ```bash\n   npm install\n   ```\n\n5. **Run Database Migrations**:\n   ```bash\n   npm run typeorm migration:run\n   ```\n\n6. **Load Initial Data**:\n   - Navigate to the `admin` folder and load the `currencies.sql` file to populate the database with initial values:\n     ```bash\n     mysql -u \u003cusername\u003e -p \u003cdatabase_name\u003e \u003c admin/currencies.sql\n     ```\n\n7. **Start Development Server**:\n   ```bash\n   npm run start:dev\n   ```\n\n\u003e **Note**: For testing environments, you may need to install MySQL and SQLite3 globally to avoid any errors:\n\u003e ```bash\n\u003e npm install -g mysql sqlite3\n\u003e ```\n\n### 3. Frontend Setup (Next.js)\n\n1. **Navigate to the frontend directory**:\n   ```bash\n   cd ../front\n   ```\n\n2. **Configure Environment Variables**:\n   - Duplicate `example.env` as `.env` and customize as needed.\n\n3. **Install dependencies**:\n   ```bash\n   npm install\n   ```\n\n4. **Start Development Server**:\n   ```bash\n   npm run dev\n   ```\n\n## Development Commands\n\n### Backend Commands\n\n- **Run Development Server**: `npm run start:dev`\n- **Run Database Migrations**: `npm run typeorm migration:run`\n- **Run Backend Tests**: `npm run test`\n\n### Frontend Commands\n\n- **Start Frontend Dev Server**: `npm run dev`\n- **Build for Production**: `npm run build`\n- **Start Production Server**: `npm start`\n\n## Testing\n\nThis project uses a comprehensive suite of tests, including unit, integration, and end-to-end (e2e) tests. **GitHub Actions** handles automated testing in the CI/CD pipeline, and tests can also be run locally.\n\n- **Run Backend Tests**:\n  ```bash\n  cd back\n  npm run test\n  ```\n\n- **Run Frontend Tests**:\n  ```bash\n  cd ../front\n  npm run test\n  ```\n\n## Production Setup\n\n### 1. PM2 Process Management\nUse PM2 to manage Node processes for a zero-downtime setup.\n\n1. **Navigate to the `admin` folder** and use the provided PM2 ecosystem file:\n   ```bash\n   cd ../admin\n   pm2 start ecosystem.config.js\n   ```\n\n2. **Monitor with PM2**:\n   ```bash\n   pm2 monit\n   ```\n\n### 2. Nginx Configuration\nTo serve the application with Nginx, use the provided configuration file in the `admin` folder:\n\n1. **Copy Nginx Configuration**:\n   Place the `nginx.conf` from `admin` into your Nginx configuration directory (usually `/etc/nginx/sites-available`), and create a symbolic link in `/etc/nginx/sites-enabled`.\n\n2. **Reload Nginx**:\n   ```bash\n   sudo systemctl reload nginx\n   ```\n\n## CI/CD Pipeline\n\nGitHub Actions are configured to handle automated testing and deployment. A self-hosted runner can be set up to speed up testing:\n\n1. **Set Up Self-Hosted Runner**:\n   Follow the instructions in `.github/workflows/` to create a self-hosted runner for faster testing during development.\n\n2. **Use GitHub Actions Commands**:\n   - Refer to the `.pipeline.yml` file in `admin` for CI/CD setup.\n   - The pipeline automates build, testing, and deployment steps as defined in GitHub Actions workflows.\n\n## Documentation\n\nFull documentation is generated with **Jekyll** and is available in the `docs` folder. To view documentation locally:\n\n1. **Navigate to `docs`**:\n   ```bash\n   cd ../docs\n   ```\n\n2. **Serve Documentation**:\n   ```bash\n   bundle exec jekyll serve\n   ```\n\n   Documentation will be available at `http://localhost:4000`.\n\nFor live documentation, visit [https://nilsriga.github.io/currency/](https://nilsriga.github.io/currency/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnilsriga%2Fcurrency","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnilsriga%2Fcurrency","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnilsriga%2Fcurrency/lists"}