This is the backend for the KYC (Know Your Customer) system. It allows managing KYC data, including users submitting their information, admins approving or rejecting submissions, and storing the status history of KYC requests.
- Docker (>= 20.x)
- Docker Compose (>= 1.29.x)
-
Clone the repository:
git clone https://github.com/danielneris/api-kyc-api.git cd api-kyc -
Configure environment variables: Create a
.envfile based on the provided.env.example:cp .env.example .env
Update the
.envfile with your configuration:DATABASE_URL= JWT_SECRET=your_secret_key BASE_URL=http://localhost:3333
-
Build and run the services:
docker-compose up --build
This will:
- Start the API server.
- Set up a PostgreSQL database.
-
Run database migrations:
docker-compose exec app npm run db:generate && npm run db:migrate
If you prefer running the project locally, follow these steps:
-
Install dependencies:
npm install
-
Start the development server:
npm run dev
POST /auth/login- User loginPOST /auth/register- User registration
GET /kyc- Get All KYCGET /kyc/:userId- Get KYC status of a userPOST /kyc/:userId/upload- Submit user KYC detailsPATCH /kyc/update-status- Update KYC status (approved or rejected)
GET /kyc/:kycId/history- Get KYC status history
POST /files/upload- Upload files (requires authentication)GET /upload/:id- View file via shareable link