Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
98 commits
Select commit Hold shift + click to select a range
17ce1ba
DB schema
SanchitEsMagico Oct 19, 2023
95e2c95
Added Admin APIs
kh4l1d64 Oct 25, 2023
4aab811
Added admin APIs
kh4l1d64 Oct 25, 2023
228f84f
provider apis
SanchitEsMagico Oct 26, 2023
f36cb3d
Added credit APIs
kh4l1d64 Oct 27, 2023
ee028ac
init
SanchitEsMagico Oct 30, 2023
2ac5cd6
Debug
kh4l1d64 Oct 30, 2023
703006e
Added sample data, constraints for dtos
kh4l1d64 Oct 31, 2023
245bc5c
Removed migrations, node_modules
kh4l1d64 Oct 31, 2023
56e2b62
seed data
SanchitEsMagico Oct 31, 2023
9d209aa
fixes and refactoring
SanchitEsMagico Oct 31, 2023
6cf9c15
isJson removed
SanchitEsMagico Oct 31, 2023
8e9b6c5
Resolved merge conflicts
kh4l1d64 Oct 31, 2023
ef5a9bf
provider status validation
SanchitEsMagico Nov 1, 2023
d6cb52b
json fix
SanchitEsMagico Nov 2, 2023
7d1bc2c
search changes
SanchitEsMagico Nov 2, 2023
8e74485
Merge branch 'dev' into BPP-API
SanchitEsMagico Nov 2, 2023
1e750f2
Resolve merge conflicts
kh4l1d64 Nov 5, 2023
2f58210
Added additional apis
kh4l1d64 Nov 6, 2023
61fe529
course module fixes
SanchitEsMagico Nov 7, 2023
68e30f2
refactoring
SanchitEsMagico Nov 7, 2023
d12335a
Addressed review
kh4l1d64 Nov 14, 2023
5d8e160
debug
kh4l1d64 Nov 14, 2023
7912219
fixed enums
kh4l1d64 Nov 14, 2023
232ab59
logger and error handling
SanchitEsMagico Nov 14, 2023
5ad53af
Merge branch 'dev' of https://github.com/COMPASS-DPG/course-manager i…
SanchitEsMagico Nov 14, 2023
279c046
review bug fixes
SanchitEsMagico Nov 14, 2023
2e32815
Addressed Code review
kh4l1d64 Nov 14, 2023
4594648
Addressed code review
kh4l1d64 Nov 14, 2023
9537afa
Debug
kh4l1d64 Nov 14, 2023
177909d
Added rejectionReason for provider and course
kh4l1d64 Nov 16, 2023
3ac6101
minor changes and fixes
SanchitEsMagico Nov 20, 2023
0e3019c
Added comments
kh4l1d64 Nov 20, 2023
f8edf57
course transactions
SanchitEsMagico Nov 22, 2023
7aec438
api changes
SanchitEsMagico Nov 24, 2023
1333a70
chage course status
SanchitEsMagico Nov 24, 2023
aadfd9f
Bug fixes
SanchitEsMagico Nov 27, 2023
bd0b8a8
add course dates
SanchitEsMagico Nov 27, 2023
003198b
purchase changes
SanchitEsMagico Nov 28, 2023
b334dca
Added course filter
kh4l1d64 Nov 28, 2023
a0d2a41
settlement updates
SanchitEsMagico Nov 28, 2023
327dad2
seed update
SanchitEsMagico Nov 28, 2023
c6f0a4e
Added API for the reset password (#10)
prashantesmagico Nov 28, 2023
ed3901c
cqf score optional
SanchitEsMagico Nov 29, 2023
98eb09f
course creation date
SanchitEsMagico Nov 29, 2023
e41d841
Revert "Added API for the reset password (#10)" (#11)
SanchitEsMagico Nov 29, 2023
43f18e8
Modified search response type
kh4l1d64 Nov 29, 2023
fb7e178
provider name in search
SanchitEsMagico Nov 29, 2023
05e2363
remove password in update profile
SanchitEsMagico Nov 29, 2023
adaf861
schema fixes
SanchitEsMagico Nov 30, 2023
c5cfb9a
purchase update
SanchitEsMagico Nov 30, 2023
0468f00
seed update
SanchitEsMagico Dec 1, 2023
d4c8348
duration removed
SanchitEsMagico Dec 1, 2023
78d111f
error handling
SanchitEsMagico Dec 1, 2023
218b6a7
seed update
SanchitEsMagico Dec 1, 2023
66ee8a0
bug fix
SanchitEsMagico Dec 1, 2023
af3d9cd
Merge branch 'UI_Integration' into dev
SanchitEsMagico Dec 1, 2023
11d8ee0
Added API for reset password (#12)
prashantesmagico Dec 1, 2023
67a9559
merge fixes
SanchitEsMagico Dec 1, 2023
5f04475
courseId uuid
SanchitEsMagico Dec 5, 2023
ede21d3
minio and onest changes
SanchitEsMagico Dec 7, 2023
b9ec84c
login name and image
SanchitEsMagico Dec 7, 2023
bcd9675
seed changes
SanchitEsMagico Dec 7, 2023
5be5d15
json , image link fix
SanchitEsMagico Dec 7, 2023
63edb50
admin create wallet
SanchitEsMagico Dec 8, 2023
c48c01d
admin sign up change
SanchitEsMagico Dec 8, 2023
0014627
uuid fix
SanchitEsMagico Dec 8, 2023
a859137
public image
SanchitEsMagico Dec 8, 2023
330ef48
competency fix
SanchitEsMagico Dec 8, 2023
cf49cd5
provider logo
SanchitEsMagico Dec 8, 2023
25bbde1
image Link fix
SanchitEsMagico Dec 11, 2023
9c350e0
seeed change
SanchitEsMagico Dec 11, 2023
2cc9411
most popular courses
SanchitEsMagico Dec 13, 2023
6deeea4
Competency search fix
kh4l1d64 Dec 13, 2023
5fb5c0c
Dockerfile completed
Dec 13, 2023
d9e5907
recommended courses
SanchitEsMagico Dec 14, 2023
b41fc24
Merge branch 'onest_changes' of https://github.com/COMPASS-DPG/course…
SanchitEsMagico Dec 14, 2023
537f01a
Merge branch 'dev' into onest_changes
SanchitEsMagico Dec 14, 2023
1204a0b
courseLink fix
SanchitEsMagico Dec 14, 2023
daf0060
remove old image
SanchitEsMagico Dec 15, 2023
ca01761
updating env file
Dec 15, 2023
467e651
adding new migration file
Dec 15, 2023
eb1ca39
seed
SanchitEsMagico Dec 15, 2023
7d7604a
seed change
SanchitEsMagico Dec 15, 2023
cec8ef7
Merge branch 'dev' of https://github.com/COMPASS-DPG/course-manager i…
SanchitEsMagico Dec 15, 2023
6da4433
Merge branch 'dev' into feature/competency-levels
SanchitEsMagico Dec 18, 2023
23ff6a6
course completion fix
SanchitEsMagico Dec 18, 2023
9394192
endpoint fix
SanchitEsMagico Dec 18, 2023
1d83bfa
Changes to integrate user service
kh4l1d64 Apr 3, 2024
875115e
minor change
kh4l1d64 Apr 4, 2024
7a2b88a
update env vars
kh4l1d64 Apr 5, 2024
a119340
Max upload image size
kh4l1d64 Apr 8, 2024
b445c0b
Merge pull request #13 from COMPASS-DPG/user-service-integration
kh4l1d64 Apr 8, 2024
4098fe9
Added log messages and seed data
kh4l1d64 Apr 17, 2024
4aa722f
Update env-example
kh4l1d64 Apr 17, 2024
1515a3b
Sync seed data with marketplace-portal
kh4l1d64 Apr 19, 2024
5597acd
Creating views for data visualization.
Jul 17, 2024
7833f02
Merge pull request #15 from COMPASS-DPG/feature/create-views
VamshiBatta07 Jul 22, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ lerna-debug.log*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
!.vscode/extensions.json
29 changes: 5 additions & 24 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,3 @@
# RUN apk add --no-cache bash
# RUN npm i -g @nestjs/cli typescript ts-node

# COPY package*.json /tmp/app/
# RUN cd /tmp/app && npm install

# COPY . /usr/src/app
# RUN cp -a /tmp/app/node_modules /usr/src/app
# COPY ./wait-for-it.sh /opt/wait-for-it.sh
# COPY ./startup.dev.sh /opt/startup.dev.sh
# RUN sed -i 's/\r//g' /opt/wait-for-it.sh
# RUN sed -i 's/\r//g' /opt/startup.dev.sh

# WORKDIR /usr/src/app
# RUN cp env-example .env

# RUN npm run build

# CMD ["/opt/startup.dev.sh"]

# Use the official Node.js 18 image as a base
FROM node:18.16.1-alpine
Expand All @@ -36,20 +17,20 @@ COPY package*.json ./
# Copy the Prisma configuration and migration files
# This line copies the "prisma" directory from your project's root into the Docker container's working directory.
COPY prisma ./prisma/

# Install project dependencies
RUN npm install

# Copy the rest of the application code to the container
COPY . .
COPY env-example ./.env

# Expose the PORT environment variable (default to 4000 if not provided)
ENV PORT=4030
EXPOSE $PORT
# Build your Nest.js application
RUN npm run build

# Expose the PORT environment variable (default to 4000 if not provided)
ARG PORT=4000
ENV PORT=$PORT
EXPOSE $PORT


# Start the Nest.js application using the start:prod script
CMD ["npm", "run", "start:prod"]
29 changes: 28 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,28 @@
# Microservice boilerplate
# Course Manager

[Compass Product Flow](https://miro.com/app/board/uXjVMkv3bh4=/?share_link_id=179469421530)
[Compass Services Diagram](https://app.diagrams.net/#G1ZcWAg558z88DcWNC4b2NKt1Q3MAPHSZu)

## About
This repository is a part of the Compass Marketplace where consumers and purchase courses and upskill their competencies and third party course providers and onboard and add their courses. It handles the backend server dealing with the use cases of the course providers and partially the admin. Particularly, the entire provider flow on the marketplace which would include adding and updating courses and admin use cases of verifying the providers and courses and settling provider wallet balances.
The tech stack used is NestJS with Prisma ORM and PostgreSQL.

The Course managermodule is dependent on the modules Marketplace portal and Marketplace Wallet Service.

## Installation
1. Install the necessary package dependencies
`npm i`
2. Set up a PostgreSQL in your local environment
3. Set up the environment variables as suggested in the example file
4. Generate Prisma migrations
`npx prisma migrate dev`
If seed data is required, it can be populated by running
`npx prisma db seed`
or
`npx prisma migrate reset`
(The latter will also reset the database and delete all previous data)

## Running A Local Development Server
An auto compiled running server can then be initialized using,
`npm run start:dev`
The Swagger API documentation could be found at `YOUR_APP_PORT/api/docs`
48 changes: 17 additions & 31 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,38 +1,24 @@
services:
postgres:
image: postgres:15.3-alpine
ports:
- ${DATABASE_PORT}:5432
volumes:
- ./.data/db:/var/lib/postgresql/data
environment:
POSTGRES_USER: ${DATABASE_USERNAME}
POSTGRES_PASSWORD: ${DATABASE_PASSWORD}
POSTGRES_DB: ${DATABASE_NAME}

# maildev:
# build:
# context: .
# dockerfile: maildev.Dockerfile
# ports:
# - ${MAIL_CLIENT_PORT}:1080
# - ${MAIL_PORT}:1025

# adminer:
# image: adminer
# restart: always
# ports:
# - 8080:8080
# postgres:
# image: postgres:15.3-alpine
# ports:
# - ${DATABASE_PORT}:5432
# volumes:
# - ./.data/db:/var/lib/postgresql/data
# environment:
# POSTGRES_USER: ${DATABASE_USERNAME}
# POSTGRES_PASSWORD: ${DATABASE_PASSWORD}
# POSTGRES_DB: ${DATABASE_NAME}

# Uncomment to use redis
# redis:
# image: redis:7-alpine
# ports:
# - 6379:6379

api:
course_manager:
build:
context: .
dockerfile: Dockerfile
ports:
- ${APP_PORT}:${APP_PORT}
networks:
- samagra_compass

networks:
samagra_compass:
external: true
20 changes: 16 additions & 4 deletions env-example
Original file line number Diff line number Diff line change
@@ -1,10 +1,22 @@
NODE_ENV=development
APP_PORT=4000
APP_NAME="Service API"
APP_PORT=
APP_NAME="Course Manager API"
API_PREFIX=api

DATABASE_USERNAME=
DATABASE_PASSWORD=
DATABASE_NAME=
DATABASE_PORT=5432
DATABASE_URL=
TELEMETRY_DATABASE_NAME=
DATABASE_PORT=
DATABASE_URL=postgresql://${DATABASE_USERNAME}:${DATABASE_PASSWORD}@172.17.0.1:5432/${DATABASE_NAME}?schema=public
WALLET_SERVICE_URL=
MARKETPLACE_PORTAL_URL=
USER_SERVICE_URL=
USER_SERVICE_TOKEN=
USER_SERVICE_COOKIE=

# MINIO
MINIO_ACCESS_KEY=
MINIO_SECRET_KEY=
MINIO_ENDPOINT=
MINIO_BUCKET_NAME=
Loading