diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000..01ef2ddb0 --- /dev/null +++ b/.gitignore @@ -0,0 +1,12 @@ +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +__pycache__ +__pycache__/ +.__pycache__ \ No newline at end of file diff --git a/backend/requirements.txt b/backend/requirements.txt index b7eafc398..6ceb5b4a1 100644 --- a/backend/requirements.txt +++ b/backend/requirements.txt @@ -5,4 +5,11 @@ python-jose python-multipart SQLAlchemy uvicorn -passlib \ No newline at end of file +passlib +langchain +langchain-core +langchain-community +langchain-experimental +langchain_openai +psycopg2 +neo4j \ No newline at end of file diff --git a/web/.env.example b/web/.env.example new file mode 100644 index 000000000..037f287c3 --- /dev/null +++ b/web/.env.example @@ -0,0 +1,9 @@ +# YOUR SURFDENSE BACKEND API SECRET KEY +NEXT_PUBLIC_API_SECRET_KEY="ANY STRING VALUE MAKE SURE IT MACHES THE VALUE IN BACKEND" + +#YOUR SURFSENSE BACKEND URL +NEXT_PUBLIC_BACKEND_URL="http://localhost:8000" + +# Recaptcha v2 to prevent Registration spam +NEXT_PUBLIC_RECAPTCHA_SITE_KEY="" +RECAPTCHA_SECRET_KEY="" \ No newline at end of file diff --git a/web/app/chat/page.tsx b/web/app/chat/page.tsx index 25c605c56..693a26992 100644 --- a/web/app/chat/page.tsx +++ b/web/app/chat/page.tsx @@ -102,7 +102,7 @@ function ProtectedPage() { }), }; - fetch(`${process.env.NEXT_PUBLIC_BACKEND_URL!}`, requestOptions) + fetch(`${process.env.NEXT_PUBLIC_BACKEND_URL!}/`, requestOptions) .then(res=>res.json()) .then(data=> { let cur = currentChat; diff --git a/web/components/logins/RegisterForm.tsx b/web/components/logins/RegisterForm.tsx index 185100b80..a18e4885d 100644 --- a/web/components/logins/RegisterForm.tsx +++ b/web/components/logins/RegisterForm.tsx @@ -17,6 +17,10 @@ export const RegisterForm = () => { const validateForm = () => { if (!username || !password || !confpassword) { + if(password !== confpassword){ + setError('Password and Confirm Password doesnt match'); + return false; + } setError('Username and password are required'); return false; } @@ -65,6 +69,7 @@ export const RegisterForm = () => { } } else { + setLoading(false); setError('Recaptcha Failed'); } } @@ -82,9 +87,9 @@ export const RegisterForm = () => {
- + setUsername(e.target.value)} type="username" name="username" id="username" className="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-primary-600 focus:border-primary-600 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500" placeholder="name@company.com" /> + onChange={(e) => setUsername(e.target.value)} type="username" name="username" id="username" className="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-primary-600 focus:border-primary-600 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500" placeholder="username" />
@@ -95,7 +100,7 @@ export const RegisterForm = () => { setConfPassword(e.target.value)} - type="confirm-password" name="confpassword" id="confpassword" placeholder="••••••••" className="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-primary-600 focus:border-primary-600 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500" /> + type="password" name="confpassword" id="confpassword" placeholder="••••••••" className="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-primary-600 focus:border-primary-600 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500" />