Skip to content
Open

nc #59

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
212 commits
Select commit Hold shift + click to select a range
06718af
Merge pull request #30 from creativetimofficial/dev-main
sajadevo Nov 2, 2022
0dd4e23
add nepcha script
sajadevo Mar 29, 2023
1ffc362
Merge pull request #31 from creativetimofficial/feature/v2.0.1
sajadevo Mar 29, 2023
10ee108
Update README.md
sajadevo Apr 25, 2023
853d6e4
Update index.html
sajadevo Apr 25, 2023
98f1901
upgrade to Material Tailwind v2
maisamaf Oct 25, 2023
f970ed2
fix: implement upgrade changes
maisamaf Oct 25, 2023
de9dd0a
ref: update colors
maisamaf Nov 5, 2023
8aed183
fix the issues
sajadevo Nov 5, 2023
f7ed994
fix design issues
maisamaf Nov 7, 2023
9f3d204
ref: add border to components
maisamaf Nov 7, 2023
4966206
ref: signin & signup pages
maisamaf Nov 13, 2023
9b01397
update the design
sajadevo Nov 14, 2023
c1906d9
ready for release
sajadevo Nov 14, 2023
830849c
update change log
sajadevo Nov 14, 2023
1159bbd
Merge pull request #36 from maisamaf/feature/v3
sajadevo Nov 14, 2023
cfd2032
Deploy on Genezio
cristim67 Jul 15, 2024
8a04a72
Merge pull request #46 from cristim67/main
marqbeniamin Jul 15, 2024
618354d
nc
antongenis Jun 11, 2025
a95cdbb
nc
antongenis Jun 11, 2025
3a20405
paid plans
antongenis Jun 11, 2025
d9f2036
simulation
antongenis Jun 12, 2025
062f3f6
smiles string
antongenis Jun 12, 2025
f5ae84e
added files
antongenis Jun 12, 2025
d369a7c
base 3d sim
kobimic887 Jun 13, 2025
3f1d899
change
kobimic887 Jun 13, 2025
a8f23f7
index.js
kobimic887 Jun 13, 2025
c44e51d
index
kobimic887 Jun 13, 2025
5aad8e5
add
kobimic887 Jun 13, 2025
7bf440b
look better
kobimic887 Jun 13, 2025
9555d9f
make kt work
kobimic887 Jun 13, 2025
46c48e5
work?
kobimic887 Jun 13, 2025
afb46c3
delte not working file
kobimic887 Jun 13, 2025
e904c1c
final fix
kobimic887 Jun 13, 2025
0f475e4
readd files
antongenis Jun 13, 2025
da8c2eb
readd files
antongenis Jun 13, 2025
0840bcb
readd files
antongenis Jun 13, 2025
5717228
readd files
antongenis Jun 13, 2025
dd69a4f
https
antongenis Jun 14, 2025
80f7b3b
https
antongenis Jun 14, 2025
59ff9e0
change hostname
antongenis Jun 14, 2025
a60aad8
change hostname
antongenis Jun 14, 2025
c493052
change hostname
antongenis Jun 14, 2025
058b32a
change hostname
antongenis Jun 14, 2025
80e8c3c
change hostname
antongenis Jun 14, 2025
66cfcff
fix style
antongenis Jun 14, 2025
70291d1
nc
antongenis Jun 14, 2025
4624083
fix
antongenis Jun 16, 2025
f9a4587
fix https
Jun 16, 2025
f7e732c
http works
Jun 17, 2025
80663b4
Add 2D molecule viewer with SMILES input and fallback SVG viewer
lego2011 Jun 18, 2025
43a61ef
Enhance 2D molecular viewer with chemistry-aware visualization
lego2011 Jun 18, 2025
8a22cd6
doesnt work fully
lego2011 Jun 19, 2025
2170316
working payment sys
lego2011 Jun 24, 2025
fe336c7
ketcher
Jun 20, 2025
3af0653
ketcher works great
Jun 20, 2025
9f2ee72
ketcher
Jun 20, 2025
866386b
added in iframe
antongenis Jun 23, 2025
9edbe8e
Security: Remove hardcoded Stripe keys and add proper environment con…
lego2011 Jun 24, 2025
e6bf35c
Add clean Stripe server without hardcoded secrets
lego2011 Jun 24, 2025
0423567
Complete development environment setup
lego2011 Jun 24, 2025
123add2
docs: Update README with new features and setup instructions
lego2011 Jun 24, 2025
fc528f1
Update .env.example
kobimic887 Jun 24, 2025
9fec702
fix annual month
lego2011 Jun 24, 2025
124bb18
mol*
lego2011 Jun 27, 2025
94b5de6
iframe molstar
lego2011 Jun 27, 2025
95dfca4
api test
lego2011 Jun 30, 2025
085e3a9
cors
lego2011 Jun 30, 2025
2f588f2
:3000 no more
lego2011 Jun 30, 2025
28cadb9
vite 0000
Jul 3, 2025
db82510
added files
Jul 3, 2025
f3aa339
/api/hello
Jul 3, 2025
f9d1085
api
Jul 3, 2025
c879d33
remove cryptotrandom
Jul 3, 2025
9ba593d
remove cryptotrandom
Jul 3, 2025
0ff5ae1
code
Jul 3, 2025
df39551
molecule
Jul 3, 2025
9436e9c
hostname
Jul 3, 2025
608fdcf
move to https
Jul 4, 2025
f5ce240
3001
Jul 4, 2025
29bb315
added
Jul 4, 2025
6fc4bb2
3001
Jul 4, 2025
712abdb
stripe https
Jul 4, 2025
7790b5d
remove stripe servers
Jul 5, 2025
be8886c
simple
Jul 5, 2025
54f2b62
simple
Jul 5, 2025
c1f1863
simple
Jul 5, 2025
b751586
add signup
Jul 5, 2025
f02e993
with tokens
Jul 5, 2025
1225217
redirect stripe
Jul 6, 2025
7613b58
redirect stripe
Jul 6, 2025
3c8e450
with homepage
Jul 6, 2025
29783fe
new files
Jul 6, 2025
11a4a4e
fe pages
Jul 6, 2025
7ebd6a4
add images
Jul 6, 2025
84f2dcb
test
Jul 8, 2025
0799bfb
param rename
Jul 8, 2025
6436dae
styles
Jul 9, 2025
2464b4d
added
Jul 9, 2025
5b598cd
added
Jul 9, 2025
f2f4eb8
button link
Jul 9, 2025
196b1e7
sanitized
Jul 9, 2025
2e88d30
sanitize style
Jul 9, 2025
11c294c
redesign
Jul 10, 2025
701886f
redesign
Jul 10, 2025
cce3ca6
restyled
Jul 10, 2025
886baef
contact us has email
lego2011 Jul 11, 2025
385568b
temp
Jul 11, 2025
8813c61
resolved
Jul 11, 2025
343721b
emails added
Jul 11, 2025
652fce1
with text
Jul 11, 2025
b8b854c
text skimming
Jul 12, 2025
4eecfee
text skimming
Jul 12, 2025
9696753
text skimming
Jul 12, 2025
aaa800b
added component redirect
Jul 15, 2025
350ee53
with a table
Jul 16, 2025
f39d752
resize
Jul 17, 2025
5acb436
with smiles
Jul 17, 2025
5445e4c
notifications
Jul 18, 2025
8f35a11
with ui fixes
Jul 18, 2025
a6d0873
re
Jul 18, 2025
4b060c8
signup
Jul 18, 2025
421bbbf
mobile view
Jul 18, 2025
a026691
working good blog
lego2011 Jul 18, 2025
7475847
ds
Jul 19, 2025
2418b73
message
Jul 19, 2025
fa02a3e
stable with cart
Jul 19, 2025
1e0261c
redrawing process
Jul 19, 2025
3838336
adding tokens refinment
Jul 20, 2025
eadb974
full redesign
Jul 22, 2025
66c8b95
full redesign
Jul 22, 2025
10dbe85
refine shopping cart
Jul 22, 2025
a8eeb01
moved the navbar on topp
Jul 23, 2025
b2a082c
stylings
Jul 23, 2025
98ed9f0
stylings
Jul 23, 2025
f6838e0
stylings
Jul 23, 2025
2584e9c
stylings
Jul 23, 2025
5537bb9
redesigns
Jul 24, 2025
a5320d8
redesigns
Jul 24, 2025
f144017
redesigns
Jul 24, 2025
449b66c
preview
lego2011 Jul 24, 2025
cb10dc4
Merge pull request #1 from eitangenis/kobibranch2
eitangenis Jul 24, 2025
14ce7da
title change
Aug 6, 2025
2dcb11c
headers
Aug 9, 2025
0d8a53b
fix vite error
Aug 13, 2025
a023966
fix vite error
Aug 13, 2025
db9761f
with control panel
Aug 30, 2025
70f1a5d
set t
Aug 31, 2025
5fa97bc
set t
Aug 31, 2025
1374c1a
set t
Aug 31, 2025
94291fc
fix
Aug 31, 2025
91e08d8
fix
Sep 1, 2025
91b1f29
fix
Sep 1, 2025
a067d5c
show cart
Sep 3, 2025
04989f3
show cart
Sep 3, 2025
74df26d
show cart
Sep 3, 2025
e4da445
show cart
Sep 3, 2025
ca6ecce
cart fix
Sep 4, 2025
d4aac00
cart fix
Sep 6, 2025
ea21a2b
added checkbox on molecules
Sep 6, 2025
29802d5
nc
Sep 6, 2025
d056a37
nc
Sep 6, 2025
244946b
refine view
Sep 10, 2025
acfc232
add admet
Sep 13, 2025
e23ba81
add admet
Sep 13, 2025
2c5543b
texts
Sep 13, 2025
a34b8b8
texts
Sep 19, 2025
15866b6
fix cart
Sep 19, 2025
f57a56a
Update simulation page layout: resize Ketcher editor and reorganize c…
Sep 19, 2025
4680b99
Merge branch 'main' into updatedbuttons
Sep 20, 2025
9907746
new version
Sep 20, 2025
e600e2d
add post
antong-creator Oct 3, 2025
62d39d5
add post
antong-creator Oct 4, 2025
6119f8d
change stripe key
antong-creator Oct 5, 2025
ccc437a
test again
antong-creator Oct 6, 2025
4bab81a
test again
antong-creator Oct 6, 2025
1e2d4bd
test again
antong-creator Oct 6, 2025
671f624
native added
antong-creator Oct 11, 2025
f19d73b
native added
antong-creator Oct 11, 2025
7c67f95
redirect to home
antong-creator Oct 28, 2025
7d02899
new search
antong-creator Oct 29, 2025
a835f23
added similarity
antong-creator Oct 31, 2025
f2b5504
added similarity
antong-creator Oct 31, 2025
d455c6b
add checkout
antong-creator Nov 5, 2025
16131f8
fix pat
antong-creator Nov 5, 2025
407e85f
lock
antong-creator Nov 6, 2025
63c432e
lock
antong-creator Nov 9, 2025
138bdf2
lock
antong-creator Nov 9, 2025
4473287
tester
antong-creator Dec 19, 2025
0598893
change to api4
antong-creator Dec 22, 2025
b01c070
change calculation
antong-creator Dec 26, 2025
f36d0ae
add tester logic
antong-creator Dec 27, 2025
6a8d4e0
add tester logic
antong-creator Dec 29, 2025
078adf9
stylking
antong-creator Jan 16, 2026
c104a73
dd
antong-creator Jan 17, 2026
05c44c2
render diffdock
antong-creator Jan 23, 2026
dd47204
render diffdock
antong-creator Jan 23, 2026
fd35620
fix clear cache of diffdock
antong-creator Feb 6, 2026
4716d46
fix clear cache of diffdock
antong-creator Feb 6, 2026
97cb06a
fix error
antong-creator Feb 6, 2026
8714577
add molmim
antong-creator Feb 26, 2026
43e1032
adding new page
antong-creator Feb 26, 2026
8cb7fcd
adding new page
antong-creator Feb 26, 2026
7763cd5
add support for
antong-creator Mar 2, 2026
17e363f
protein
lego2011 Mar 3, 2026
ee3e79c
Merge pull request #2 from eitangenis/nvidaapi
eitangenis Mar 3, 2026
a7800ac
deep similarity
antong-creator Mar 13, 2026
eae593d
readd
antong-creator Mar 13, 2026
cab0311
error fix try
antong-creator Mar 14, 2026
ad1e660
feat: Add fingerprint and metric options to deep similarity search
lego2011 Mar 26, 2026
58ad4cb
Merge pull request #4 from eitangenis/feature/deep-similarity-options
eitangenis Mar 26, 2026
60072cb
chore: drop unused deploy/test junk from the rollback tree
lego2011 Aug 23, 2026
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
9 changes: 9 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Stripe Configuration
# Get these from your Stripe Dashboard (https://dashboard.stripe.com/apikeys)

# Stripe Publishable Key (starts with pk_test_ or pk_live_)
VITE_STRIPE_PUBLISHABLE_KEY=pk_test_your_publishable_key_here

# Stripe Secret Key (starts with sk_test_ or sk_live_)
# WARNING: Keep this secret! Never commit this to version control
STRIPE_SECRET_KEY=sk_test_your_secret_key_here
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@ dist
dist-ssr
*.local

# Environment variables
.env
.env.local
.env.development.local
.env.test.local
.env.production.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
Expand Down
33 changes: 0 additions & 33 deletions CHANGELOG.md

This file was deleted.

13 changes: 0 additions & 13 deletions ISSUE_TEMPLATE.md

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2022 Creative Tim
Copyright (c) 2023 Creative Tim

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
71 changes: 66 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,30 @@
# [Material Tailwind Dashboard React](http://demos.creative-tim.com/material-tailwind-dashboard-react/#/?ref=readme-mtdr) [![Tweet](https://img.shields.io/twitter/url/http/shields.io.svg?style=social&logo=twitter)](https://twitter.com/intent/tweet?url=https://www.creative-tim.com/product/material-tailwind-dashboard-react&text=Check%20Material%20Tailwind%20Dashboard%20React%20made%20by%20@CreativeTim%20#webdesign%20#kit%20#materialdesign%20#react%20#materialtailwind%20#tailwindcss%20https://www.creative-tim.com/product/material-tailwind-dashboard-react)

![version](https://img.shields.io/badge/version-2.0.0-blue.svg) [![GitHub issues open](https://img.shields.io/github/issues/creativetimofficial/material-tailwind-dashboard-react.svg)](https://github.com/creativetimofficial/material-tailwind-dashboard-react/issues?q=is%3Aopen+is%3Aissue) [![GitHub issues closed](https://img.shields.io/github/issues-closed-raw/creativetimofficial/material-tailwind-dashboard-react.svg)](https://github.com/creativetimofficial/material-tailwind-dashboard-react/issues?q=is%3Aissue+is%3Aclosed)
![version](https://img.shields.io/badge/version-2.1.0-blue.svg) [![GitHub issues open](https://img.shields.io/github/issues/creativetimofficial/material-tailwind-dashboard-react.svg)](https://github.com/creativetimofficial/material-tailwind-dashboard-react/issues?q=is%3Aopen+is%3Aissue) [![GitHub issues closed](https://img.shields.io/github/issues-closed-raw/creativetimofficial/material-tailwind-dashboard-react.svg)](https://github.com/creativetimofficial/material-tailwind-dashboard-react/issues?q=is%3Aissue+is%3Aclosed)

![Image](https://s3.amazonaws.com/creativetim_bucket/products/488/original/material-tailwind-react-dashboard.jpg)
## 🚀 New Features Added

This fork includes additional professional features:

### 🧪 **2D Molecule Viewer & Drawing Tool**
- Professional chemical drawing interface with accurate molecular geometry
- CPK color scheme for atoms and proper bond visualization
- Interactive molecule editing and drawing capabilities
- Export functionality for molecular structures

### 💳 **Stripe Payment Integration**
- Modern pricing page design inspired by pyxis-discover.com
- Secure Stripe payment processing with pre-built checkout forms
- Monthly/yearly billing toggle with "Most Popular" plan highlighting
- Complete payment flow with success/failure handling

### 🔧 **Development Features**
- Unified development workflow with single `npm run dev` command
- Secure environment variable configuration
- No secrets in repository - all sensitive data in `.env` file
- Ready for production deployment

![Image](https://s3.amazonaws.com/creativetim_bucket/products/488/original/material-tailwind-dashboard-react.jpg)

Material Tailwind Dashboard React is our newest free Material Tailwind Admin Template based on Tailwind CSS and React. If you’re a developer looking to create an admin dashboard that is developer-friendly, rich with features, and highly customisable, here is your match. Our innovative Material Tailwind, Tailwind CSS & React dashboard comes with a beautiful design inspired by Google's Material Design and it will help you create stunning websites & web apps to delight your clients.

Expand Down Expand Up @@ -38,6 +60,7 @@ During the development of this dashboard, we have used many existing resources f
- [Material Tailwind](https://material-tailwind.com/) - Material Tailwind is an easy to use components library for Tailwind CSS and Material Design.
- [Hero Icons](https://heroicons.com/) - Beautiful hand-crafted SVG icons.
- [Apex Charts](https://apexcharts.com/) - Modern & Interactive open-source Charts.
- [Nepcha Analytics](https://nepcha.com?ref=readme) for the analytics tool. Nepcha is already integrated with Material Tailwind Dashboard React. You can use it to gain insights into your sources of traffic.

Let us know your thoughts below. And good luck with development!

Expand All @@ -46,6 +69,7 @@ Let us know your thoughts below. And good luck with development!
- [Versions](#versions)
- [Demo](#demo)
- [Quick Start](#quick-start)
- [Deploy](#deploy)
- [Documentation](#documentation)
- [File Structure](#file-structure)
- [Browser Support](#browser-support)
Expand All @@ -62,7 +86,7 @@ Let us know your thoughts below. And good luck with development!
| React |
| ----- |

| [![Material Tailwind Dashboard React](https://s3.amazonaws.com/creativetim_bucket/products/488/thumb/material-tailwind-react-dashboard.jpg)](http://demos.creative-tim.com/material-tailwind-dashboard-react/#/?ref=readme-mtdr)
| [![Material Tailwind Dashboard React](https://s3.amazonaws.com/creativetim_bucket/products/488/thumb/material-tailwind-dashboard-react.jpg)](http://demos.creative-tim.com/material-tailwind-dashboard-react/#/?ref=readme-mtdr)

## Demo

Expand All @@ -79,13 +103,49 @@ Let us know your thoughts below. And good luck with development!

Quick start options:

- Downdload from [Creative Tim](https://www.creative-tim.com/product/material-tailwind-dashboard-react?ref=readme-mtdr).
- Download from [Creative Tim](https://www.creative-tim.com/product/material-tailwind-dashboard-react?ref=readme-mtdr).

## Deploy

:rocket: You can deploy your own version of the template to Genezio with one click:

[![Deploy to Genezio](https://raw.githubusercontent.com/Genez-io/graphics/main/svg/deploy-button.svg)](https://app.genez.io/start/deploy?repository=https://github.com/creativetimofficial/material-tailwind-dashboard-react&utm_source=github&utm_medium=referral&utm_campaign=github-creativetim&utm_term=deploy-project&utm_content=button-head)

## Terminal Commands

1. Download and Install NodeJs LTS version from [NodeJs Official Page](https://nodejs.org/en/download/).
2. Navigate to the root ./ directory of the product and run `npm install` or `yarn install` or `pnpm install` to install our local dependencies.

## 🔧 Additional Setup for New Features

### Environment Configuration
1. Copy the environment template:
```bash
cp .env.example .env
```

2. Add your Stripe API keys to `.env`:
```
VITE_STRIPE_PUBLISHABLE_KEY=pk_test_your_publishable_key_here
STRIPE_SECRET_KEY=sk_test_your_secret_key_here
```

### Development Commands
- **Start everything**: `npm run dev` (starts both frontend and Stripe server)
- **Frontend only**: `npm run build` then `npm run preview`
- **Stripe server only**: `npm run stripe-server`

### Testing Payments
- Use Stripe test card: `4242 4242 4242 4242`
- Any future expiry date and CVC will work
- Visit `/dashboard/paid-plans` to test the payment flow

### New Pages Available
- **Molecule Viewer**: `/dashboard/molecule-viewer` - Professional 2D chemical drawing tool
- **Paid Plans**: `/dashboard/paid-plans` - Stripe-integrated pricing page

For complete setup instructions, see `DEVELOPMENT_SETUP_COMPLETE.md`.

## Documentation

The documentation for the Material Tailwind Dashboard React is hosted at our [website](https://material-tailwind.com/?ref=readme-mtdr).
Expand Down Expand Up @@ -137,6 +197,7 @@ At present, we officially aim to support the last two versions of the following
- [License Agreement](https://www.creative-tim.com/license?ref=readme-mtdr)
- [Support](https://www.creative-tim.com/contact-us?ref=readme-mtdr)
- Issues: [Github Issues Page](https://github.com/creativetimofficial/material-tailwind-dashboard-react/issues)
- [Nepcha Analytics](https://nepcha.com?ref=readme) - Analytics tool for your website

## Reporting Issues

Expand All @@ -152,7 +213,7 @@ If you have questions or need help integrating the product please [contact us](h

## Licensing

- Copyright 2022 [Creative Tim](https://www.creative-tim.com?ref=readme-mtdr)
- Copyright 2023 [Creative Tim](https://www.creative-tim.com?ref=readme-mtdr)
- Creative Tim [license](https://www.creative-tim.com/license?ref=readme-mtdr)

## Useful Links
Expand Down
137 changes: 126 additions & 11 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<!--
=========================================================
* Material Tailwind Dashboard React - v2.0.0
* Material Tailwind Dashboard React - v2.1.0
=========================================================
* Product Page: https://www.creative-tim.com/product/material-tailwind-dashboard-react
* Copyright 2022 Creative Tim (https://www.creative-tim.com)
* Copyright 2023 Creative Tim (https://www.creative-tim.com)
* Licensed under MIT (https://github.com/creativetimofficial/material-tailwind-dashboard-react/blob/main/LICENSE.md)
* Coded by Creative Tim
=========================================================
Expand All @@ -15,21 +15,136 @@
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/img/favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Material Tailwind Dashboard React | By Creative Tim</title>
<title>Pyxis-Discovery | Macrocycles</title>
<link
href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700;900&display=swap"
rel="stylesheet"
/>
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.2.0/css/all.min.css"
integrity="sha512-xh6O/CkQoPOWDdYTDqeRdPCVd1SpvCA9XXcUnZS2FmJNp1coAFzvtCN9BmamE+4aHK8yyUHUSCcJHgXloTyT2A=="
crossorigin="anonymous"
referrerpolicy="no-referrer"
/>
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.8/dist/umd/popper.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">

<script defer data-site="YOUR_DOMAIN_HERE" src="https://api.nepcha.com/js/nepcha-analytics.js"></script>

<!-- 3Dmol.js for 3D visualization -->
<script src="https://3dmol.csb.pitt.edu/build/3Dmol-min.js"></script>

<!-- RDKit.js initialization with proper error handling -->
<script>
// Global variables to track RDKit state
window.rdkitModule = null;
window.rdkitLoaded = false;
window.rdkitError = null;

// Function to initialize RDKit module
window.initRDKitModule = function() {
return new Promise((resolve, reject) => {
// Return cached module if already loaded
if (window.rdkitModule) {
resolve(window.rdkitModule);
return;
}

// Return cached error if previously failed
if (window.rdkitError) {
reject(window.rdkitError);
return;
}

// Try to load RDKit script dynamically
const loadRDKitScript = () => {
const script = document.createElement('script');
script.src = 'https://unpkg.com/@rdkit/rdkit/dist/RDKit_minimal.js';

script.onload = () => {
console.log('RDKit script loaded successfully');
initializeRDKit();
};

script.onerror = () => {
console.warn('Failed to load RDKit from unpkg, trying alternative...');
// Try alternative CDN
const altScript = document.createElement('script');
altScript.src = 'https://cdn.jsdelivr.net/npm/@rdkit/rdkit/dist/RDKit_minimal.js';

altScript.onload = () => {
console.log('RDKit script loaded from alternative CDN');
initializeRDKit();
};

altScript.onerror = () => {
const error = new Error('Failed to load RDKit from all sources');
window.rdkitError = error;
reject(error);
};

document.head.appendChild(altScript);
};

document.head.appendChild(script);
};

// Function to initialize RDKit once script is loaded
const initializeRDKit = () => {
let attempts = 0;
const maxAttempts = 50; // 10 seconds timeout

const checkAndInit = () => {
attempts++;

if (window.RDKit && typeof window.RDKit === 'function') {
console.log('RDKit function available, initializing...');

window.RDKit().then(rdkit => {
console.log('RDKit initialized successfully');
window.rdkitModule = rdkit;
window.rdkitLoaded = true;
resolve(rdkit);
}).catch(error => {
console.error('RDKit initialization failed:', error);
window.rdkitError = error;
reject(error);
});
} else if (attempts < maxAttempts) {
setTimeout(checkAndInit, 200);
} else {
const error = new Error('RDKit failed to load within timeout');
window.rdkitError = error;
reject(error);
}
};

checkAndInit();
};

// Check if RDKit is already available
if (window.RDKit && typeof window.RDKit === 'function') {
initializeRDKit();
} else {
// Load RDKit script if not already present
loadRDKitScript();
}
});
};

// Pre-load RDKit when DOM is ready
document.addEventListener('DOMContentLoaded', () => {
console.log('DOM ready, pre-loading RDKit...');
window.initRDKitModule().then(() => {
console.log('RDKit pre-loaded successfully');
}).catch(error => {
console.log('RDKit pre-loading failed:', error.message);
console.log('Components can still use fallback methods');
});
});
</script>
<link
href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css"
rel="stylesheet"
/>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.jsx"></script>
</body>
</html>
</html>
Loading