Conversation
… README Co-authored-by: Romaric-py <141680466+Romaric-py@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR replaces the generic NestJS boilerplate README_EN.md with a comprehensive, project-specific English README that thoroughly documents the Register Manager API application. The French README.md remains unchanged.
Changes:
- Replaced 98 lines of NestJS boilerplate with 428 lines of detailed project documentation
- Added complete feature overview, architecture documentation, and API endpoint reference
- Included automated (init.sh) and manual setup instructions with environment configuration examples
- Documented testing, deployment, troubleshooting, and operational procedures
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| - 📝 **Registration system** with status tracking | ||
| - 💳 **Payment processing** with multi-currency support (USD, EUR, XOF) via FedaPay | ||
| - 📧 **Email service** for notifications, verification, and password resets | ||
| - 🔄 **WhatsApp integration** for communications |
There was a problem hiding this comment.
The README claims "🔄 WhatsApp integration for communications" as a key feature (line 25) and lists it in the module structure (line 58), but the actual WhatsApp service file at src/whatsapp/whatsapp.service.ts is empty (0 lines). This feature appears to be a placeholder or planned feature rather than an implemented one. The README should clarify that this is a planned/stub feature or remove it from the list of current features.
| - 🔄 **WhatsApp integration** for communications | |
| - 🔄 **Planned WhatsApp integration** for communications (coming soon) |
| # With PM2 (recommended) | ||
| pm2 start dist/main.js --name register-manager-api |
There was a problem hiding this comment.
The deployment section recommends using PM2 with the command "pm2 start dist/main.js --name register-manager-api" (line 366). However, the package.json build configuration doesn't specify the output format. NestJS typically builds to CommonJS by default and the entry point would be at "dist/main.js" or "dist/src/main.js" depending on configuration. Consider verifying this path works correctly or providing the actual path based on the build output. You may also want to mention installing PM2 first with "npm install -g pm2".
| # With PM2 (recommended) | |
| pm2 start dist/main.js --name register-manager-api | |
| # With PM2 (recommended) | |
| # Install PM2 globally (if not already installed) | |
| npm install -g pm2 | |
| # Start with PM2 | |
| # Use the correct build output path for your setup: | |
| # - dist/main.js (common NestJS output) | |
| # - dist/src/main.js (if your build nests files under src/) | |
| pm2 start dist/main.js --name register-manager-api | |
| # pm2 start dist/src/main.js --name register-manager-api |
| # Create database and update DATABASE_URL in .env | ||
| createdb mydb | ||
| ``` | ||
|
|
There was a problem hiding this comment.
In the manual setup instructions, the command "createdb mydb" (line 171) is provided for creating the database. However, the example DATABASE_URL shown in the Configuration section (line 127) references "mydb" as the database name, but the docker-compose.yml file creates a database named "mydb" (line 7) with user "user" and password "password". The instructions are consistent and correct. However, it would be helpful to note that these credentials match the Docker setup for convenience, and users with local PostgreSQL should adjust them accordingly.
| > Note: The example `DATABASE_URL` and the credentials used in `docker-compose.yml` (database `mydb`, user `user`, password `password`) are aligned for convenience. If you use a different local PostgreSQL setup, create the database/user as needed and update `DATABASE_URL` in your `.env` file accordingly. |
| | Method | Endpoint | Description | Auth | | ||
| |--------|-------------------------------|------------------------------|------| | ||
| | POST | `/payment/generate-link` | Generate a payment link | JWT | | ||
| | GET | `/payment/available-amounts` | Get available payment amounts| JWT | |
There was a problem hiding this comment.
The /payment/available-amounts endpoint is documented as a GET request, but in the actual implementation at src/payment/payment.controller.ts line 30, it uses the @Get decorator and expects a @Body parameter, which is unusual for GET requests. GET requests typically use query parameters, not request bodies. This appears to be a potential API design issue in the code rather than just documentation, but the documentation should accurately reflect what's implemented.
| | GET | `/payment/available-amounts` | Get available payment amounts| JWT | | |
| | POST | `/payment/available-amounts` | Get available payment amounts| JWT | |
| ## 🔧 Configuration | ||
|
|
||
| ### Environment Variables | ||
|
|
||
| Copy `.env.example` to `.env` and configure the values: | ||
|
|
||
| ```bash | ||
| # Database | ||
| DATABASE_URL=postgresql://user:password@localhost:5434/mydb | ||
|
|
||
| # JWT | ||
| JWT_SECRET=your-super-secret-jwt-key | ||
| JWT_ACCESS_TOKEN_EXPIRY=1800000 # 30 minutes (ms) | ||
| JWT_REFRESH_TOKEN_EXPIRY=604800000 # 7 days (ms) | ||
|
|
||
| # Email (SMTP) | ||
| MAIL_HOST=smtp.gmail.com | ||
| MAIL_USER=your-email@gmail.com | ||
| MAIL_PASSWORD=your-app-password | ||
|
|
||
| # Frontend URL (used in email links) | ||
| FRONTEND_URL=http://localhost:3001 | ||
|
|
||
| # Super Admin credentials (used during seeding) | ||
| SUPER_ADMIN_EMAIL=admin@registerManager.com | ||
| SUPER_ADMIN_PASSWORD=AdminPassword123! | ||
| ``` | ||
|
|
||
| 📖 **Full documentation**: See [ENVIRONMENT_VARIABLES.md](./ENVIRONMENT_VARIABLES.md) |
There was a problem hiding this comment.
The README states that FedaPay integration is included for "multi-currency support (USD, EUR, XOF) via FedaPay" (line 23), but the required FedaPay environment variables (FEDAPAY_API_KEY, FEDAPAY_API_URL, FEDAPAY_CURRENCY, FEDAPAY_COUNTRY, FEDAPAY_CALLBACK) are not documented in the Configuration section or mentioned in the .env.example file. These are critical for payment processing. The configuration section should include these required variables or at least reference where to find them.
| | Technology | Version | Purpose | | ||
| |----------------|----------|--------------------------------| | ||
| | **NestJS** | ^11.0.1 | Node.js TypeScript framework | | ||
| | **Prisma** | ^6.15.0 | Database ORM | | ||
| | **PostgreSQL** | 15 | Relational database | | ||
| | **JWT** | ^11.0.0 | Token-based authentication | | ||
| | **Bcrypt** | ^6.0.0 | Password hashing | | ||
| | **Nodemailer** | ^7.0.6 | Email delivery service | | ||
| | **Jest** | ^29.7.0 | Testing framework | | ||
| | **Docker** | - | Database containerization | |
There was a problem hiding this comment.
In the Tech Stack table, the Nodemailer version is listed as "^7.0.6". However, checking the package.json dependencies (line 44), the actual version is "^7.0.6" which is correct. But "@nestjs-modules/mailer" (version "^2.0.2" in package.json line 24) is not mentioned in the tech stack table, even though it's the primary email service used in the application. Consider adding this to the table or clarifying that Nodemailer is used indirectly via the NestJS mailer module.
| | Technology | Version | Purpose | | |
| |----------------|----------|--------------------------------| | |
| | **NestJS** | ^11.0.1 | Node.js TypeScript framework | | |
| | **Prisma** | ^6.15.0 | Database ORM | | |
| | **PostgreSQL** | 15 | Relational database | | |
| | **JWT** | ^11.0.0 | Token-based authentication | | |
| | **Bcrypt** | ^6.0.0 | Password hashing | | |
| | **Nodemailer** | ^7.0.6 | Email delivery service | | |
| | **Jest** | ^29.7.0 | Testing framework | | |
| | **Docker** | - | Database containerization | | |
| | Technology | Version | Purpose | | |
| |-------------------|----------|-------------------------------------------------| | |
| | **NestJS** | ^11.0.1 | Node.js TypeScript framework | | |
| | **Prisma** | ^6.15.0 | Database ORM | | |
| | **PostgreSQL** | 15 | Relational database | | |
| | **JWT** | ^11.0.0 | Token-based authentication | | |
| | **Bcrypt** | ^6.0.0 | Password hashing | | |
| | **NestJS Mailer** | ^2.0.2 | Email service module (built on Nodemailer) | | |
| | **Nodemailer** | ^7.0.6 | Underlying email transport (used via NestJS Mailer) | | |
| | **Jest** | ^29.7.0 | Testing framework | | |
| | **Docker** | - | Database containerization | |
| ``` | ||
| src/ | ||
| ├── auth/ # Authentication module | ||
| │ ├── dto/ # Data transfer objects | ||
| │ ├── guards/ # Security guards | ||
| │ └── services/ # Business logic | ||
| ├── user/ # User management | ||
| ├── admin/ # Admin operations | ||
| ├── course/ # Course management | ||
| ├── registration/ # Registration system | ||
| ├── payment/ # Payment processing | ||
| ├── mail/ # Email service | ||
| ├── whatsapp/ # WhatsApp integration | ||
| ├── common/ # Shared utilities, filters, interfaces | ||
| └── main.ts # Application entry point |
There was a problem hiding this comment.
In the Module Structure section starting at line 46, the directory tree shows "src/common/" with the description "Shared utilities, filters, interfaces" (line 59). While this is accurate, it would be helpful to be consistent with the detail level - other modules show subdirectories (like auth showing dto/, guards/, services/), but common doesn't show its internal structure. Consider either showing subdirectories for all modules or none, for consistency.
| |--------|-------------------------------|------------------------------|------| | ||
| | POST | `/payment/generate-link` | Generate a payment link | JWT | | ||
| | GET | `/payment/available-amounts` | Get available payment amounts| JWT | | ||
| | POST | `/payment/callback` | Payment callback handler | – | |
There was a problem hiding this comment.
The /payment/callback endpoint documentation states it has "–" (no auth), but the actual code in src/payment/payment.controller.ts shows it has JWT authentication applied both at the controller level (line 10) and at the method level (line 37). This endpoint requires JWT authentication and should be documented as such.
| | POST | `/payment/callback` | Payment callback handler | – | | |
| | POST | `/payment/callback` | Payment callback handler | JWT | |
| # JWT | ||
| JWT_SECRET=your-super-secret-jwt-key | ||
| JWT_ACCESS_TOKEN_EXPIRY=1800000 # 30 minutes (ms) | ||
| JWT_REFRESH_TOKEN_EXPIRY=604800000 # 7 days (ms) | ||
|
|
||
| # Email (SMTP) | ||
| MAIL_HOST=smtp.gmail.com | ||
| MAIL_USER=your-email@gmail.com | ||
| MAIL_PASSWORD=your-app-password | ||
|
|
||
| # Frontend URL (used in email links) | ||
| FRONTEND_URL=http://localhost:3001 | ||
|
|
||
| # Super Admin credentials (used during seeding) | ||
| SUPER_ADMIN_EMAIL=admin@registerManager.com | ||
| SUPER_ADMIN_PASSWORD=AdminPassword123! | ||
| ``` |
There was a problem hiding this comment.
The JWT environment variable names in the configuration example don't match the actual variables used in .env.example. The example shows JWT_ACCESS_TOKEN_EXPIRY and JWT_REFRESH_TOKEN_EXPIRY, which match the .env.example file. However, the .env.example file also includes additional JWT-related variables not mentioned here: EMAIL_VERIFICATION_TOKEN_EXPIRY and PASSWORD_RESET_TOKEN_EXPIRY. Consider including these important security-related variables in the configuration section for completeness.
| - 📧 **Email service** for notifications, verification, and password resets | ||
| - 🔄 **WhatsApp integration** for communications | ||
| - 🛡️ **Rate limiting** and advanced security | ||
| - 🧪 **Comprehensive tests** with 100% coverage on core modules |
There was a problem hiding this comment.
The claim "Comprehensive tests with 100% coverage on core modules" needs clarification. The current coverage section states "Auth module: 100% coverage" but doesn't provide specific coverage metrics. Without running the actual test suite, this claim cannot be verified. Consider being more specific about which modules have 100% coverage or qualify the statement with "as of the latest test run" with a reference to actual coverage reports.
| - 🧪 **Comprehensive tests** with 100% coverage on core modules | |
| - 🧪 **Extensive automated tests**, with 100% line coverage on the core auth module as of the latest Jest run (see `coverage/lcov-report`) |
README_EN.mdcontained the stock NestJS starter boilerplate — no project-specific content at all.Replaced with a full English README covering:
./init.sh) and manual step-by-step installENVIRONMENT_VARIABLES.mdfor full reference/auth,/course,/registration,/paymentwith HTTP method and auth requirementsThe French
README.mdis unchanged.Original prompt
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.