Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migration update. #18

Merged
merged 62 commits into from
Jan 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
257a99f
Working on Github Actions.
abhik-wil Dec 31, 2024
401a0d2
Working on Deployment.
abhik-wil Jan 3, 2025
2c706b5
Merge branch 'ONDC-Official:master' into master
abhik-wil Jan 3, 2025
163ecbe
Fix: Github Actions.
abhik-wil Jan 3, 2025
c68410c
Merge branch 'master' of github.com:abhik-wil/deeplink-resolver-server
abhik-wil Jan 3, 2025
ef3a1e4
Fixed username.
abhik-wil Jan 3, 2025
68e9112
Working on deployment.
abhik-wil Jan 3, 2025
490c32e
Update clone-and-setup.yml
abhik-wil Jan 3, 2025
99db722
Update clone-and-setup.yml
abhik-wil Jan 3, 2025
21740d9
Update clone-and-setup.yml
abhik-wil Jan 3, 2025
0b80181
sanity commit.
abhik-wil Jan 3, 2025
e965288
snaity commit.
abhik-wil Jan 3, 2025
3a28e32
s.
abhik-wil Jan 3, 2025
2c81c4a
sc.
abhik-wil Jan 3, 2025
136a005
logging.
abhik-wil Jan 3, 2025
4b373fe
Update app-deployment.yml
abhik-wil Jan 3, 2025
8d4ec04
Update app-deployment.yml
abhik-wil Jan 3, 2025
fd4adf9
Update db-operations.yml
abhik-wil Jan 3, 2025
53fd13f
Update db-operations.yml
abhik-wil Jan 3, 2025
a0ee0a4
Update db-operations.yml
abhik-wil Jan 3, 2025
a4ec0f7
Update db-operations.yml
abhik-wil Jan 3, 2025
32a51d7
Update db-operations.yml
abhik-wil Jan 3, 2025
e9a09f1
Removing unused classes.
abhik-wil Jan 3, 2025
ff1744b
Merge branch 'master' of github.com:abhik-wil/deeplink-resolver-server
abhik-wil Jan 3, 2025
4e50cb5
Update db-operations.yml
abhik-wil Jan 3, 2025
3235bcf
Update db-operations.yml
abhik-wil Jan 3, 2025
f2496cd
Update app-deployment.yml
abhik-wil Jan 3, 2025
8918ed5
Update app-deployment.yml
abhik-wil Jan 3, 2025
db358d3
Working on deployment.
abhik-wil Jan 3, 2025
3ada068
Update db-operations.yml
abhik-wil Jan 3, 2025
00c636c
Update db-operations.yml
abhik-wil Jan 3, 2025
dc111df
Update package.json
abhik-wil Jan 3, 2025
d6e5692
Working on Deployment migration runner.
abhik-wil Jan 5, 2025
0a6b066
merging master into local.
abhik-wil Jan 5, 2025
556fa24
Fixing docker network.
abhik-wil Jan 5, 2025
e5eaf5a
sc
abhik-wil Jan 5, 2025
b04da0b
Working on UI fixes.
abhik-wil Jan 6, 2025
c8e7e56
Working on QR Download and schema changes.
abhik-wil Jan 6, 2025
d93f7d2
Working on decoupling action from formData.
abhik-wil Jan 6, 2025
69acf93
Minor changes.
abhik-wil Jan 6, 2025
2f53c5e
Merge branch 'master' of github.com:ONDC-Official/deeplink-resolver-s…
abhik-wil Jan 6, 2025
4ec9f57
Logging the migrations.
abhik-wil Jan 7, 2025
1c73edc
Debugging.
abhik-wil Jan 7, 2025
f4ac96a
changing env name.
abhik-wil Jan 7, 2025
4465473
Update app-deployment.yml
abhik-wil Jan 7, 2025
e7bb242
Working on UI changes.
abhik-wil Jan 8, 2025
af06c55
Merge branch 'master' of github.com:abhik-wil/deeplink-resolver-server
abhik-wil Jan 8, 2025
3aab7ac
Dev (#13)
abhik-wil Jan 13, 2025
8e9a5a3
Dev (#1)
abhik-wil Jan 13, 2025
12e645a
Merging upstream dev-server
abhik-wil Jan 13, 2025
b6ac52d
Merge branch 'master' of github.com:abhik-wil/deeplink-resolver-server
abhik-wil Jan 13, 2025
03a325b
Removing caching for docker.
abhik-wil Jan 13, 2025
7f2ee35
bug fix.
abhik-wil Jan 13, 2025
f3f004d
Breadcrumbs.
abhik-wil Jan 14, 2025
f201844
New migrations,UI changes and bug fixes.
abhik-wil Jan 14, 2025
590f4c7
Merge branch 'master' of github.com:ONDC-Official/deeplink-resolver-s…
abhik-wil Jan 14, 2025
ed06049
Removing caching from migrations runner.
abhik-wil Jan 14, 2025
48c6053
Merge branch 'master' of github.com:ONDC-Official/deeplink-resolver-s…
abhik-wil Jan 15, 2025
24726ab
Build fix.
abhik-wil Jan 15, 2025
f135031
Merge branch 'master' of github.com:ONDC-Official/deeplink-resolver-s…
abhik-wil Jan 15, 2025
58e6b37
Updated migrations.
abhik-wil Jan 15, 2025
55ad46b
moving readme.
abhik-wil Jan 15, 2025
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
52 changes: 51 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,51 @@
# ondc-deeplink-2.0
# Deep Link v2
This repo holds the code for Deep Link v2 App. It is a utility provided to generate usecases from predefined templates. There are 3 personas concerned in this app. These personas are:
1. Admin
2. User
3. Consumer

Out of these, currently, the User flow has been enabled. Remaining flows are under development and will be introduced in future releases.

## Admin
The admin is responsible to **creating** templates. These templates inherit schema from the Base Beckn template. The admin can then add fields to the template. There are 3 types of fields:
1. Pre-filled - These fields are defined and their values are provided by the admin. These fields are not editable by the user. So any usecase created with these templates will have the same values for these fields.
2. User-filled - The admin can mark a field as "user-filled". This field will be editable by the user. The user can provide their own values for these fields during usecase generation.
3. PG - These fields are filled during consumption phase. The usecase created with the template will have these fields marked and the resolver server will communicate with the agent to fill these fields.

## User
The user is responsible to **creating** usecases. The user can select a template and then add fields to the template. The user can then generate the usecase. The usecase will be generated in the form of a JSON file. The user can then use this JSON file to create a usecase on the Beckn network.

The usecases may be kept private or public (saveed to GitHub). Additionally, when the usecase is either published privately (submitted) or published, the usecase QR is saved on Github. This QR contains the ID of the usecase. The resolver server can then use this ID to fetch the usecase.

## Consumer
The consumer is responsible to **consuming** usecases. The consumer can scan the QR of the usecase and the resolver server will fetch the usecase. The resolver server will then communicate with the "consuming" agent to fill the fields marked as PG. The resolver server will then return the usecase to the consumer. The consumer can then use this usecase to create a usecase on the Beckn network.

Currently, hitting `/api/resolver/{usecase_id}` will resolve the usecase. *Note*: While this returns the usecase, it does not resolve the usecase. The usecase is resolved when the resolver server communicates with the agent and all the post-generation fields are filled. **Post Generation fields are denoted with `{{<value>}}`.

## Developer Guide

This section is meant for developers who want to contribute to the project. The project is built using NextJS and PostgreSQL. Prisma ORM has been used.

### Prerequisites
Knowledge of NextJS 15, TypeScript, PostgreSQL, Docker, Docker Compose, Prisma ORM, and Beckn Protocol is required.

You need to have the following before you can start developing:
1. NodeJS (^22.0)
2. Docker & Docker Compose

### Steps to start the project
1. Clone the repo
2. RUN `cd deeplink-generator`
3. Run `npm install`
4. Copy the `example.env` file to `.env` and update the values as needed.
5. Copy the `docker-compose.local.yml` to `docker-compose.yml`.
6. RUN `docker compose up ondc_deep_link_db -d`. This will start the database in a docker container.
7. RUN `npx prisma migrate dev` followed by `npx prisma seed` to seed the database.
8. RUN `npm run dev` to start the project.

### Seeding the database
The database comes pre-seeded with the templates defined inside the `seeding` directory once step 7 in the previous sub-section is completed. The seeding script automatically picks up on the usecase category and sub-category as defined in the templates and seeds them accordingly.

## Contributors:
1. [Abhik Banerjee](https://github.com/abhik-wil)
2. [Sonali Shakya](https://github.com/sonalishakya)
51 changes: 0 additions & 51 deletions deeplink-generator/README.md

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ CREATE TABLE "Usecase" (
"description" TEXT,
"creatorName" TEXT,
"qrPdfLink" TEXT,
"usecaseDeepLink" TEXT,
"usecaseStage" "UsecaseStage" NOT NULL,

CONSTRAINT "Usecase_pkey" PRIMARY KEY ("id")
Expand Down
Loading