Getting Started¶
This guide will help you set up the CurioPay API development environment on your local machine.
Prerequisites¶
- Node.js (v16 or later)
- npm or yarn
- Docker and Docker Compose (for local database)
- Git
Clone the Repository¶
Install Dependencies¶
Environment Setup¶
- Copy the example environment file:
- Edit the
.envfile with your local settings.
Database Setup¶
Option 1: Local PostgreSQL Instance¶
If you have PostgreSQL installed locally, update the database connection string in your .env file:
Option 2: Docker (Recommended)¶
Run a PostgreSQL instance using Docker:
Database Migration¶
Apply the database migrations:
Seed the database with initial data:
Running the Application¶
Development Mode¶
The API will be available at: http://localhost:3000
Production Build¶
API Documentation¶
Once the application is running, you can access the Swagger documentation at:
http://localhost:3000/api-docs
Testing¶
Running Unit Tests¶
Running E2E Tests¶
Test Coverage¶
Helpful Commands¶
- Generate a new module:
nest g module module-name - Generate a new controller:
nest g controller controller-name - Generate a new service:
nest g service service-name - Generate a migration:
npx prisma migrate dev --name migration-name
Development Workflow¶
- Create a new feature branch from
main - Make your changes
- Write tests
- Ensure all tests pass
- Submit a pull request
Coding Standards¶
Follow the project's coding standards defined in the ESLint and Prettier configurations:
- Run linting:
npm run lint - Run formatting:
npm run format