Aplikasi ini adalah aplikasi yang bertujuan untuk membantu dan mempermudah UMKM dalam menjalankan dan mengembangkan usaha yang mereka miliki. Produk ini dibuat agar pelaku usaha bisa mengembangkan usahanya dengan mengajukan pinjaman jika mengalami kesulitan finansial maupun kekurangan modal
- Git clone the project using
git clone ....
- run
pnpm install
- run
pnpm set-up api
This might not work if you're using windows due to how windows process commands. You will need to setup manually using git bash with:- run
docker-compose up
- run
./scripts/migrate latest
- run
- run
nx serve api
to run the backend API You can check the swagger documentation athttp://127.0.0.1:9000/docs
- run
nx serve wang-ku
to run the landing page website - run
pnpm mobile get mobile
andpnpm mobile get shared
topub get
for flutter packages - create a
.env
inapps/mobile/.env
and fill it with
API_URL="http://10.0.2.2:9000/api/v1" # if you are using emulator
API_URL="http://{Local IP4}:9000/api/v1" # if you are using physical device replacing {Local IP4} with your device local network ip4 that is running the API
- run
nx run mobile:run
to run the mobile application or you could just vs code flutter extension
Let's say we want to create new library/application for new feature, we can do that with this command:
# this will create new application in path apps/new-app
pnpm exec nx g @nrwl/node:app new-app
# this will create new library in path libs/api/features/new-lib
pnpm exec nx g @nrwl/node:lib new-lib --directory=api/features
Let's say we just created new library/application, make sure targeted folder is not depended to other lib/app we can delete those new folder with this command:
# deleting app
pnpm exec nx g @nrwl/workspace:remove new-app
# when deleting lib, path is included
pnpm exec nx g @nrwl/workspace:remove api-features-new-lib
- Create your database migration file, e.g.:
# Make sure to use underscore instead of space for table name
pnpm migrate create <name_of_table>
pnpm migrate create user_role
- Migrate latest migrations to your local database
pnpm migrate latest
- Rollback your local database migrations
pnpm migrate rollback
To refresh the database without terminate the docker container, we can use:
pnpm migrate refresh
Everytime we create schema for API, it will be converted to dart model with quicktype
Generate new lib schema with:
pnpm exec nx g @nrwl/node:lib schema/new-schema --directory=api/shared
after that you can create new shared schema like example libs/api/shared/schema/user/src/lib/user.schema.ts
, you can generate it automatically with
pnpm nx build generate-dart-models && node dist/apps/generate-dart-models/main.js
and it will generate the dart models to apps/mobile/lib/src/generated_models