REST API server that handles users, products, wallets, transactions, and related features. The system includes roles for managing access (ADMIN and USER), user wallets for transactions, and a product system where users can buy products through their wallets. Redis cache is integrated to optimize performance by caching frequently accessed data, such as product listings and transaction statuses
Live demo here
- NodeJS - version 18.17.0
- Redis - version 7.2.4
- Postgresql - version 14.13.0
- User Management
- Product Management
- Wallet Management
- Transaction Handling
- Soft Delete
- Role-based Access Control
To run this project in local, follow the steps below:
-
Clone this repository:
git clone https://github.com/mch-fauzy/voca-commerce-server.git
-
Navigate to the project directory:
cd voca-commerce-server
-
Install the required dependencies:
npm install
-
Edit the database and Redis configuration in
.env.development
with your credentials:Note: Please create new database or schema
DATABASE_URL='postgresql://johndoe:mypassword@localhost:5432/mydb?schema=public' REDIS_URL='redis://:@localhost:6379'
-
Migrate the database:
npm run prismamigrate:dev
-
Generate Prisma client:
npm run prismagenerate
-
Compile Typescript into Javascript code:
npm run build
-
Start the server:
npm run dev
-
By default, the server will run in:
http://localhost:3000