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

submission-Exun #16

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
78 changes: 78 additions & 0 deletions Exun/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# NuxLand - Collaboration tools for all

**Team Name**: Exun

**Problem Statement**: A Marketplace for Open Science Projects

**Project Link**: https://github.com/nux-land/nuxland

**Team Leader Email**: [email protected]

## A Brief of the Prototype:

This section must include UML Diagrams and prototype description

## Tech Stack:

## 🗃 Tech Stack

<div align="left">
<table>
<thead>
<td><strong>Technology</strong></td>
<td><strong>Purpose</strong></td>
</thead>
<tbody>
<tr>
<td>Next JS</td>
<td>Frontend</td>
</tr>
<tr>
<td>Flask</td>
<td>Backend</td>
</tr>
<tr>
<td>Web Sockets</td>
<td>Realtime collaboration</td>
</tr>
<tr>
<td>Next UI</td>
<td>UI Components</td>
</tr>
<tr>
<td>Mongo DB</td>
<td>Database</td>
</tr>
<tr>
<td>Huddle01</td>
<td>Video conferencing</td>
</tr>
<tr>
<td>WAGMI</td>
<td>Contact integration</td>
</tr>
<tr>
<td>Rainbow Kit</td>
<td>Wallet connection</td>
</tr>
</tbody>
</table>
</div>

## Step-by-Step Code Execution Instructions:

Two files need to be added:

**mongo_url**: Add MongoDB URL

**ngrok_token**: Add NGROK Token

### Future Scope:

Add more tools like jamboard for better collaboration

Implementation of Git Version history -like feature

Multiple social Authentication system like twitter, apple id

Certification and NFT badges which would be used for on-chain reputation
Binary file added Exun/nuxland.pdf
Binary file not shown.
4 changes: 4 additions & 0 deletions Exun/nuxland/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"presets": ["next/babel"],
"plugins": []
}
3 changes: 3 additions & 0 deletions Exun/nuxland/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": ["next/babel","next/core-web-vitals"]
}
41 changes: 41 additions & 0 deletions Exun/nuxland/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*

# local env files
.env*.local

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts
node_modules/
.env

mongo_url
ngrok_token
34 changes: 34 additions & 0 deletions Exun/nuxland/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).

## Getting Started

First, run the development server:

```bash
npm run dev
# or
yarn dev
```

Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.

You can start editing the page by modifying `pages/index.js`. The page auto-updates as you edit the file.

[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.js`.

The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages.

## Learn More

To learn more about Next.js, take a look at the following resources:

- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.

You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!

## Deploy on Vercel

The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.

Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
Binary file added Exun/nuxland/__pycache__/litedb.cpython-311.pyc
Binary file not shown.
70 changes: 70 additions & 0 deletions Exun/nuxland/components/ConnectWalletButton.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
import React, { useState, useEffect } from 'react';
import { ConnectButton } from '@rainbow-me/rainbowkit';
import { Button } from '@nextui-org/react';

export default function ConnectWalletButton() {

return (
<ConnectButton.Custom>
{({
account,
chain,
openAccountModal,
openChainModal,
openConnectModal,
authenticationStatus,
mounted,
}) => {
const ready = mounted && authenticationStatus !== 'loading';
const connected =
ready &&
account &&
chain &&
(!authenticationStatus ||
authenticationStatus === 'authenticated');

return (
<div
{...(!ready && {
'aria-hidden': true,
'style': {
opacity: 0,
pointerEvents: 'none',
userSelect: 'none',
},
})}
>
{(() => {
if (!connected) {
return (
<Button color="primary" onClick={openConnectModal}>
Connect Wallet
</Button>
);
}

if (chain.unsupported) {
return (
<Button color="primary" onClick={openChainModal}>
Wrong network
</Button>
);
}

return (
<div style={{ display: 'flex', gap: 12 }}>
<Button color="primary" onClick={openAccountModal} type="button" title={account.address}>
account.displayName
{account.displayBalance
? ` (${account.displayBalance})`
: ''}
</Button>
</div>
);
})()}
</div>
);
}}
</ConnectButton.Custom>
)
}
11 changes: 11 additions & 0 deletions Exun/nuxland/components/WalletFallback.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import React from 'react'
import ConnectWalletButton from './ConnectWalletButton'

export default function WalletFallback() {
return (
<div className='walletFallback'>
<p>Please connect your wallet to continue!</p>
<ConnectWalletButton />
</div>
)
}
Binary file added Exun/nuxland/fonts/Groteska-Bold.otf
Binary file not shown.
Binary file added Exun/nuxland/fonts/Groteska-Book.otf
Binary file not shown.
Binary file added Exun/nuxland/fonts/Groteska-Heavy.otf
Binary file not shown.
Binary file added Exun/nuxland/fonts/Groteska-Light.otf
Binary file not shown.
Binary file added Exun/nuxland/fonts/Groteska-Medium.otf
Binary file not shown.
Binary file added Exun/nuxland/fonts/Groteska-Regular.otf
Binary file not shown.
Binary file added Exun/nuxland/fonts/Groteska-Thin.otf
Binary file not shown.
65 changes: 65 additions & 0 deletions Exun/nuxland/litedb.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
from pymongo.mongo_client import MongoClient
import pymongo,time,json
from pymongo.database import Database as db_type
uri = open("mongo_url").read()

client = MongoClient(uri)

try:
client.admin.command('ping')
print("Pinged your deployment. You successfully connected to MongoDB!")
except Exception as e:
print(e)
exit()

class connection:
def __init__(self,collection) -> None:
self.collection=collection
def get(self,key):
return collection_get(self.collection,key)
def set(self,key,content):
return collection_set(self.collection,key,content)
def delete(self,key):
return collection_delete(key,self.collection)
def clear_collection(self):
return collection_clear_all(self.collection)
def get_all(self):
return collection_get_all(self.collection)
def append(self,key,string):
return append_string(self.collection,key,string)

def append_string(database: db_type,key,string):
database.update_one(
{"_id" :key},[{"$set":{"val":{"$concat":["$val",string]}}}]
)

def get_conn(database):
db=client[database.replace(".db","")]
collection=db["keyval"]
return connection(collection)

def collection_set(collection,key,val):
if collection_get(collection,key)==None:
collection.insert_one({"_id":key,"val":json.dumps(val)})
else:
collection.update_one({"_id":key},{"$set":{"val":json.dumps(val)}})

def collection_get(collection,key):
res=collection.find_one({"_id":key})
if res==None:
return None
val=res["val"]
try:
return json.loads(val)
except:
return val

def collection_get_all(collection):
collection_find=list(collection.find())
return collection_find

def collection_clear_all(collection):
collection.delete_many({})

def collection_delete(key,collection):
collection.delete_many({"_id":key})
Loading