Backend Development with Express, TypeScript, and PostgreSQL
- Node.js ≥ 18
- npm (or pnpm/yarn)
- Docker + Docker Compose
- Postman (optional, for testing)
git clone <REPO_URL>
cd <PROJECT_DIR>
npm installdocker compose up -dnpx prisma migrate dev --name init
npm run prisma:seedYou should see something like: Seed ready: admin@example.com / admin123
npm run devUse the Postman collection to test the /health url.
In Postman, sent POST request:
POST http://localhost:3000/api/auth/signin
Body:
{
"email": "admin@example.com",
"password": "admin123"
}
Response:
{
"token": "eyJhbGciOiJIUzI1..."
}Copy this token and replace in every routes in the Authorization header.
Then the token will leave you to make request for 1h to the following routes:
TOKEN: For all this request you should add the Bearer Token in Authentication section.
Auth:
POST {{base_url}}/auth/signin To signin and get the token.
POST {{base_url}}/auth/signout
Users:
GET {{base_url}}/users/ to list users
GET {{base_url}}/users/:id to get user by id in params attach the id
POST {{base_url}}/users/ to create a new user
PUT {{base_url}}/users/:id in params attach the id to update the user
DELETE {{base_url}}/users/:id in params attach the id to delete the user
Example:
{
"email": "user1@example.com",
"password": "secret123"
}
Wallet
GET {{base_url}}/wallets/ to list wallets
Example:
{
"tag": "btc-wallet",
"chain": "bitcoin",
"address": "bc1qar0srrr7xfkvy5l643lydnw9re59gtzzwf5mdq"
}
GET {{base_url}}/wallets/:id to get wallet by id in params attach the id
POST {{base_url}}/wallets/ to create a new wallet
PUT {{base_url}}/wallets/:id in params attach the id to update the wallet
Example:
{
"tag": "eth-wallet-main",
"chain": "ethereum",
"address": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e"
}
DELETE {{base_url}}/wallets/:id in params attach the id to delete the walletIn Postman I already create two variables {{base_url}} = http://localhost:3000/api pointing to your server {{TokenFromAdmin}} is the Bearer token obtained from the first request to signin route. Should be something like: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiJiZjkzMGIwZC05M2QwLTQwZjctYTQ1NS1iYmFmOWZkNmE2YWYiLCJlbWFpbCI6ImFkbWluQGV4YW1wbGUuY29tIiwiaWF0IjoxNzU1Mzc4NzY3LCJleHAiOjE3NTUzODIzNjd9.Vynr7XdKd__l8gj7TzCJvGZePKrhC-Ax8n2EfiSbl_g