{"id":28401561,"url":"https://github.com/simotae14/monorepo-accounts","last_synced_at":"2026-04-19T13:32:54.547Z","repository":{"id":295644675,"uuid":"990765364","full_name":"simotae14/monorepo-accounts","owner":"simotae14","description":"Monorepo with Nestjs and Nextjs","archived":false,"fork":false,"pushed_at":"2025-05-28T22:20:05.000Z","size":1120,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-28T20:40:15.455Z","etag":null,"topics":["class-validator","jest","nestjs","nextjs","swagger"],"latest_commit_sha":null,"homepage":"","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/simotae14.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}},"created_at":"2025-05-26T15:45:22.000Z","updated_at":"2025-05-28T22:20:08.000Z","dependencies_parsed_at":"2025-05-26T17:03:27.388Z","dependency_job_id":"0d3bf265-dd5e-4b3a-98a0-bb039d920103","html_url":"https://github.com/simotae14/monorepo-accounts","commit_stats":null,"previous_names":["simotae14/monorepo-accounts"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/simotae14/monorepo-accounts","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simotae14%2Fmonorepo-accounts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simotae14%2Fmonorepo-accounts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simotae14%2Fmonorepo-accounts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simotae14%2Fmonorepo-accounts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/simotae14","download_url":"https://codeload.github.com/simotae14/monorepo-accounts/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simotae14%2Fmonorepo-accounts/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32009154,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T20:23:30.271Z","status":"online","status_checked_at":"2026-04-19T02:00:07.110Z","response_time":55,"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":["class-validator","jest","nestjs","nextjs","swagger"],"created_at":"2025-06-01T13:00:18.493Z","updated_at":"2026-04-19T13:32:54.540Z","avatar_url":"https://github.com/simotae14.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Scalapay Test - Monorepo\n\n\u003e A monorepo for the Scalapay test where the backend is built in NestJS and the frontend in NextJS\n\nThis monorepo contains two applications working together to provide account creation functionality with a clean separation between frontend and backend services.\n\n## 📋 Overview\n\n### Applications\n\n- **API (NestJS)**: Backend service running on `localhost:4000`\n  - Location: `apps/api/`\n  - Provides REST API endpoints including `POST /submit` for account creation\n- **Web (Next.js)**: Frontend application running on `localhost:3000`\n  - Location: `apps/web/`\n  - Contains form interface at `/form` for account creation\n  - Communicates with the API service\n\n## 🚀 Quick Start\n\n### Prerequisites\n\n- Node.js (version 18 or higher recommended)\n- npm package manager\n\n### Installation\n\n1. Clone the repository:\n\n```bash\ngit clone \u003crepository-url\u003e\ncd scalapay-test\n```\n\n2. Install dependencies for all workspaces:\n\n```bash\nnpm install\n```\n\nThis will install dependencies for both the API and Web applications using npm workspaces.\n\n### Running the Applications\n\n#### Development Mode (Both Apps)\n\nStart both API and Web applications simultaneously:\n\n```bash\nnpm run dev\n```\n\nThis command runs both services concurrently:\n\n- API server: http://localhost:4000\n- Web application: http://localhost:3000\n- Form interface: http://localhost:3000/form\n\n#### Individual Applications\n\nStart only the API server:\n\n```bash\nnpm run dev:api\n```\n\nStart only the Web application:\n\n```bash\nnpm run dev:web\n```\n\n### Production Mode\n\nBuild both applications:\n\n```bash\nnpm run build\n```\n\nStart both applications in production mode:\n\n```bash\nnpm run start\n```\n\n#### Individual Production Commands\n\nBuild and start API only:\n\n```bash\nnpm run build:api\nnpm run start:api:prod\n```\n\nBuild and start Web only:\n\n```bash\nnpm run build:web\nnpm run start:web\n```\n\n#### API Development Modes\n\nThe NestJS API supports different startup modes:\n\n- **Development with watch mode:**\n\n  ```bash\n  npm run start:api:dev\n  ```\n\n- **Debug mode:**\n\n  ```bash\n  npm run start:api:debug\n  ```\n\n- **Production mode:**\n  ```bash\n  npm run start:api:prod\n  ```\n\n## 🧪 Testing\n\n### All Tests\n\nRun tests for both applications:\n\n```bash\nnpm test\n```\n\n### API Testing\n\nRun API unit tests:\n\n```bash\nnpm run test:api\n```\n\nRun API tests in watch mode:\n\n```bash\nnpm run test:api:watch\n```\n\nRun API tests with coverage:\n\n```bash\nnpm run test:api:cov\n```\n\nRun API end-to-end tests:\n\n```bash\nnpm run test:api:e2e\n```\n\n### Web Testing\n\nRun Web application tests:\n\n```bash\nnpm run test:web\n```\n\nFor more Web testing options (watch mode, coverage, E2E), navigate to the web directory:\n\n```bash\ncd apps/web\nnpm run test:watch\nnpm run test:coverage\n```\n\nTo run the e2e tests you need to start the monorepo\n\n```bash\nnpm run dev\n```\n\nand then run the e2e tests from the web folder, unfortunately I add some issues to intercept the POST api so it writes to db at every submission\n\n```bash\ncd apps/web\nnpm run test:e2e:watch\n```\n\n## 🔧 Code Quality \u0026 Development Tools\n\n### Formatting\n\nFormat code in both applications:\n\n```bash\nnpm run format\n```\n\nCheck formatting without making changes:\n\n```bash\nnpm run format:check\n```\n\nFormat individual applications:\n\n```bash\nnpm run format:api\nnpm run format:web\n```\n\n### Linting\n\nLint both applications:\n\n```bash\nnpm run lint\n```\n\nLint individual applications:\n\n```bash\nnpm run lint:api\nnpm run lint:web\n```\n\nCheck API linting:\n\n```bash\nnpm run lint:api:check\n```\n\n### Type Checking\n\nRun TypeScript type checking for Web application:\n\n```bash\nnpm run type-check:web\n```\n\n## 📚 Storybook (Web App)\n\nThe Web application includes Storybook for component development:\n\n```bash\ncd apps/web\nnpm run storybook\n```\n\nStorybook will be available at http://localhost:6006\n\n## 📚 Swagger (API)\n\nWhen you run the API part you have access to the Swagger code available for example at http://localhost:4000/api#/submit/AccountController_create\n\nAlso if you want to test the APIs you can use Postman and also use this VSCode extension VSCode Rest Client[https://marketplace.visualstudio.com/items?itemName=humao.rest-client] and use the file apps/api/rest-client.http to launch the APIs\n\n## 🏗️ Project Structure\n\n```\nscalapay-test/\n├── apps/\n│   ├── api/                    # NestJS Backend Application\n│   │   ├── src/\n│   │   ├── test/\n│   │   ├── package.json\n│   │   └── ...\n│   └── web/                    # Next.js Frontend Application\n│       ├── src/\n│       ├── public/\n│       ├── __tests__/\n│       ├── .storybook/\n│       ├── package.json\n│       └── ...\n├── package.json                # Root package.json with workspace config\n└── README.md                   # This file\n```\n\n## 🛠️ Technology Stack\n\n### Backend (NestJS API)\n\n- **NestJS** - Progressive Node.js framework\n- **TypeScript** - Type safety\n- **Jest** - Testing framework\n\n### Frontend (Next.js Web)\n\n- **Next.js 15.3.2** - React framework with Turbopack\n- **React 19** - UI library\n- **TypeScript** - Type safety\n- **Tailwind CSS** - Utility-first CSS framework\n- **Zustand** - State management\n- **Zod** - Schema validation\n- **Storybook** - Component development\n\n### Development Tools\n\n- **ESLint** - Code linting\n- **Prettier** - Code formatting\n- **Jest** - Testing framework\n\n## 📡 API Endpoints\n\nThe NestJS API provides the following endpoints:\n\n- **POST** `/submit` - Create new account\n  - Used by the Web form for account creation\n- **GET** `/submit` - Get all the accounts\n  - Used to check the created accounts\n- **DELETE** `/submit/:id` - Delete a specific account\n  - Used to delete the created accounts\n\n## 🚨 Troubleshooting\n\n### Port Conflicts\n\nDefault ports used:\n\n- API: `localhost:4000`\n- Web: `localhost:3000`\n- Storybook: `localhost:6006`\n\n### Workspace Issues\n\nIf you encounter workspace-related issues:\n\n```bash\n# Clean install\nrm -rf node_modules apps/*/node_modules\nnpm install\n```\n\n### Build Issues\n\nCheck for type errors and linting issues:\n\n```bash\nnpm run lint\nnpm run type-check:web\n```\n\n### API Connection Issues\n\nEnsure the API is running before testing form submissions:\n\n```bash\nnpm run dev:api\n# Then in another terminal\nnpm run dev:web\n```\n\n## 📝 Available Scripts\n\n### Root Level Scripts\n\n| Script           | Description                                |\n| ---------------- | ------------------------------------------ |\n| `npm run dev`    | Start both API and Web in development mode |\n| `npm run build`  | Build both applications for production     |\n| `npm run start`  | Start both applications in production mode |\n| `npm test`       | Run tests for both applications            |\n| `npm run lint`   | Lint both applications                     |\n| `npm run format` | Format code in both applications           |\n\n### Individual App Scripts\n\n| Script                    | Description                   |\n| ------------------------- | ----------------------------- |\n| `npm run dev:api`         | Start API in development mode |\n| `npm run dev:web`         | Start Web application         |\n| `npm run start:api:dev`   | Start API with watch mode     |\n| `npm run start:api:debug` | Start API in debug mode       |\n| `npm run start:api:prod`  | Start API in production mode  |\n| `npm run test:api:*`      | Various API testing commands  |\n\n## 🤝 Development Workflow\n\n1. **Setup**: `npm install` (installs all workspace dependencies)\n2. **Development**: `npm run dev` (starts both services)\n3. **Testing**: `npm test` (runs all tests)\n4. **Code Quality**: `npm run lint \u0026\u0026 npm run format:check`\n5. **Build**: `npm run build` (builds both apps)\n6. **Production**: `npm run start` (starts both in production mode)\n\n## 👤 Author\n\n**Simone Taeggi**\n\n## 📄 License\n\nISC License\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimotae14%2Fmonorepo-accounts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimotae14%2Fmonorepo-accounts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimotae14%2Fmonorepo-accounts/lists"}