----
+# Code of Conduct
-## 🌟Our Pledge
----
-We as members, contributors, and leaders pledge to make participation in our
-community a harassment-free experience for everyone, regardless of age, body
-size, visible or invisible disability, ethnicity, sex characteristics, gender
-identity and expression, level of experience, education, socio-economic status,
-nationality, personal appearance, race, religion, or sexual identity
-and orientation.
+
-We pledge to act and interact in ways that contribute to an open, welcoming,
-diverse, inclusive, and healthy community.
+## Our Pledge
----
-## 🚦Our Standards
+We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
-Examples of behavior that contributes to a positive environment for our
-community include:
+## Our Standards
-* 💖Demonstrating empathy and kindness toward other people
-* 🤝Being respectful of differing opinions, viewpoints, and experiences
-* 📝Giving and gracefully accepting constructive feedback
-* 🌱Accepting responsibility and apologizing to those affected by our mistakes,
- and learning from the experience
-* 🎯Focusing on what is best not just for us as individuals, but for the
- overall community
+Examples of behavior that contributes to creating a positive environment include:
-Examples of unacceptable behavior include:
+- Using welcoming and inclusive language
+- Being respectful of differing viewpoints and experiences
+- Gracefully accepting constructive criticism
+- Focusing on what is best for the community
+- Showing empathy towards other community members
-* 🚫The use of sexualized language or imagery, and sexual attention or
- advances of any kind
-* 🛑Trolling, insulting or derogatory comments, and personal or political attacks
-* ⚠️Public or private harassment
-* 🔒Publishing others' private information, such as a physical or email
- address, without their explicit permission
-* ❌Other conduct which could reasonably be considered inappropriate in a
- professional setting
+Examples of unacceptable behavior by participants include:
----
+- The use of sexualized language or imagery and unwelcome sexual attention or advances
+- Trolling, insulting or derogatory comments, and personal or political attacks
+- Public or private harassment
+- Publishing others' private information, such as a physical or electronic address, without explicit permission
+- Other conduct which could reasonably be considered inappropriate in a professional setting
-## 👨⚖️Enforcement Responsibilities
+## Our Responsibilities
-Community leaders are responsible for clarifying and enforcing our standards of
-acceptable behavior and will take appropriate and fair corrective action in
-response to any behavior that they deem inappropriate, threatening, offensive,
-or harmful.
+Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
-Community leaders have the right and responsibility to remove, edit, or reject
-comments, commits, code, wiki edits, issues, and other contributions that are
-not aligned to this Code of Conduct, and will communicate reasons for moderation
-decisions when appropriate.
+Maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that do not align with this Code of Conduct. By adopting this Code of Conduct, project maintainers commit themselves to fairly and consistently applying these principles to every aspect of managing this project.
----
-## 🌐Scope
+## Scope
-This Code of Conduct applies within all community spaces, and also applies when
-an individual is officially representing the community in public spaces.
-Examples of representing our community include using an official e-mail address,
-posting via an official social media account, or acting as an appointed
-representative at an online or offline event.
+This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project email address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
----
-## 📋Pull Request Guidelines
+## Enforcement
-Contributions, including pull requests, must align with this Code of Conduct.
-All contributors are expected to submit work that fosters a positive and inclusive community.
-Inappropriate behavior, language, or content in pull requests may result in the rejection of
-the contribution and further enforcement actions as outlined in the guidelines.
+Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project owner. All complaints will be reviewed and investigated promptly and fairly. All project team members are obligated to respect the privacy and security of the reporter of any incident.
----
-## 🛡️Enforcement
+Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project’s leadership.
-Instances of abusive, harassing, or otherwise unacceptable behavior may be
-reported to the community leaders responsible for enforcement at
-.
-All complaints will be reviewed and investigated promptly and fairly.
+You can also tag the admin, if you find anything voilating the Code of Conduct.
-All community leaders are obligated to respect the privacy and security of the
-reporter of any incident.
+## Attribution
----
-## 📖Enforcement Guidelines
+This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org/version/2/1/code_of_conduct/), version 2.0, available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
-Community leaders will follow these Community Impact Guidelines in determining
-the consequences for any action they deem in violation of this Code of Conduct:
+Community Impact Guidelines were inspired by Mozilla's code of conduct enforcement ladder.
-### 1. ✏️Correction
-
-**Community Impact**: Use of inappropriate language or other behavior deemed
-unprofessional or unwelcome in the community.
-
-**Consequence**: A private, written warning from community leaders, providing
-clarity around the nature of the violation and an explanation of why the
-behavior was inappropriate. A public apology may be requested.
-
-### 2. ⚠️Warning
-
-**Community Impact**: A violation through a single incident or series
-of actions.
-
-**Consequence**: A warning with consequences for continued behavior. No
-interaction with the people involved, including unsolicited interaction with
-those enforcing the Code of Conduct, for a specified period of time. This
-includes avoiding interactions in community spaces as well as external channels
-like social media. Violating these terms may lead to a temporary or
-permanent ban.
-
-### 3. ⏳Temporary Ban
-
-**Community Impact**: A serious violation of community standards, including
-sustained inappropriate behavior.
-
-**Consequence**: A temporary ban from any sort of interaction or public
-communication with the community for a specified period of time. No public or
-private interaction with the people involved, including unsolicited interaction
-with those enforcing the Code of Conduct, is allowed during this period.
-Violating these terms may lead to a permanent ban.
-
-### 4. 🚫Permanent Ban
-
-**Community Impact**: Demonstrating a pattern of violation of community
-standards, including sustained inappropriate behavior, harassment of an
-individual, or aggression toward or disparagement of classes of individuals.
-
-**Consequence**: A permanent ban from any sort of public interaction within
-the community.
-
----
-## 📜Attribution
-
-This Code of Conduct is adapted from the [Contributor Covenant][homepage],
-version 2.0, available at
-https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
-
-Community Impact Guidelines were inspired by [Mozilla's code of conduct
-enforcement ladder](https://github.com/mozilla/diversity).
-
-[homepage]: https://www.contributor-covenant.org
-
-For answers to common questions about this code of conduct, see the FAQ at
-https://www.contributor-covenant.org/faq. Translations are available at
-https://www.contributor-covenant.org/translations.
+For answers to common questions about this code of conduct, see the FAQ at https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
diff --git a/README.md b/README.md
index 13715b17..ba9c6e34 100644
--- a/README.md
+++ b/README.md
@@ -302,13 +302,6 @@ We extend our heartfelt gratitude to all the amazing contributors who have made
Vishnu Prasad Korada
-
diff --git a/backend/controller/event.controller.js b/backend/controller/event.controller.js
index 36cf46aa..6b29ca6e 100644
--- a/backend/controller/event.controller.js
+++ b/backend/controller/event.controller.js
@@ -1,5 +1,4 @@
const logger = require("../config/logger");
-const Customer = require("../models/customer.model");
const Event = require("../models/events.model");
// Create a new event
@@ -68,56 +67,4 @@ const getEvents = async (req, res) => {
}
};
-
-const bookEvent = async (req, res) => {
- try {
- const { customerId, eventId } = req.body;
-
- const customer = await Customer.findById(customerId);
- const event = await Event.findById(eventId);
-
- if (!customer || !event) {
- return res.status(404).json({ message: "Customer or Event not found" });
- }
-
- if (customer.bookedEvents.includes(eventId)) {
- return res.status(400).json({ message: "Event already booked" });
- }
-
- customer.bookedEvents.push(eventId);
- await customer.save();
-
- event.bookedCustomers.push(customerId);
- await event.save();
-
- res.status(200).json({ message: "Event booked successfully!" });
- } catch (error) {
- logger.error("Error booking event:", error);
- res.status(500).json({ message: "Server error" });
- }
-};
-
-// Get all booked events for a customer
-const getBookedEvents = async (req, res) => {
- try {
- const { customerId } = req.params;
-
-
- const customer = await Customer.findById(customerId).populate("bookedEvents");
-
- if (!customer) {
- return res.status(404).json({ message: "Customer not found" });
- }
-
- res.status(200).json({ bookedEvents: customer.bookedEvents });
- } catch (error) {
- logger.error("Error fetching event:", error);
- res.status(500).json({ message: "Server error" });
- }
-};
-
-module.exports = {
- getBookedEvents,
-};
-
-module.exports = { createEvent, getEvents, deleteEvent, bookEvent, getBookedEvents };
+module.exports = { createEvent, getEvents, deleteEvent };
diff --git a/backend/index.js b/backend/index.js
index cb7df0da..76d882ac 100644
--- a/backend/index.js
+++ b/backend/index.js
@@ -3,9 +3,7 @@ require("dotenv").config();
const cors = require("cors");
const mongoose = require("mongoose");
const logger = require("./config/logger");
-
const newsletterRoute = require('./routes/newsletterRoute');
-
const errorMiddleware = require("./middlewares/errrorMiddleware"); // Corrected typo
const passport = require("passport");
const { handleGoogleOAuth } = require("./controller/googleOAuth.controller");
diff --git a/backend/models/customer.model.js b/backend/models/customer.model.js
index 6047d222..cd446f41 100644
--- a/backend/models/customer.model.js
+++ b/backend/models/customer.model.js
@@ -1,3 +1,4 @@
+/* eslint-disable no-useless-escape */
const mongoose = require("mongoose");
const Schema = mongoose.Schema;
@@ -26,10 +27,6 @@ const customerSchema = new Schema(
},
bio: String,
profilePicture: String,
- bookedEvents: [{
- type: Schema.Types.ObjectId,
- ref: "Event", // Reference to the Event model
- }],
},
{ timestamps: true },
);
diff --git a/backend/models/events.model.js b/backend/models/events.model.js
index 1c74d6de..0aebe08a 100644
--- a/backend/models/events.model.js
+++ b/backend/models/events.model.js
@@ -1,4 +1,9 @@
+/* eslint-disable no-unused-vars */
+/* eslint-disable no-useless-escape */
+// models/Event.js
+
const mongoose = require("mongoose");
+const { string } = require("zod");
// Define the Event schema
const eventSchema = new mongoose.Schema({
@@ -36,12 +41,7 @@ const eventSchema = new mongoose.Schema({
message: (props) => `${props.value} is not a valid URL!`,
},
},
- bookedCustomers: [{
- type: mongoose.Schema.Types.ObjectId,
- ref: 'Customer' // Reference to the Customer model
- }]
});
-
// Create the Event model
const Event = mongoose.model("Event", eventSchema);
diff --git a/backend/routes/eventRouter.js b/backend/routes/eventRouter.js
index c66fc401..7cdcece4 100644
--- a/backend/routes/eventRouter.js
+++ b/backend/routes/eventRouter.js
@@ -1,14 +1,9 @@
-// Add this at the top of eventRouter.js to check if it's being loaded correctly
-console.log("eventRouter loaded");
-
const express = require("express");
const logger = require("../config/logger");
const {
createEvent,
getEvents,
deleteEvent,
- bookEvent,
- getBookedEvents,
} = require("../controller/event.controller");
const router = express.Router();
@@ -21,8 +16,6 @@ router.get("/", async (req, res) => {
endpoints: {
CreateEvent: "/event/create",
GetEvents: "/event/all",
- bookEvents : "/event/book-events",
- GetBookedEvents : "/event/get-booked-events/:customerId",
},
documentation: "https://api-docs-url.com",
});
@@ -33,8 +26,6 @@ router.get("/", async (req, res) => {
});
router.post("/create", createEvent);
router.get("/all", getEvents);
-router.delete("/delete/:id", deleteEvent);
-router.post("/book-events", bookEvent);
-router.get("/get-booked-events/:customerId", getBookedEvents);
+router.get("/delete", deleteEvent);
module.exports = router;
diff --git a/frontend/package.json b/frontend/package.json
index e2a55a73..30175db5 100644
--- a/frontend/package.json
+++ b/frontend/package.json
@@ -16,7 +16,7 @@
"@splidejs/react-splide": "^0.7.12",
"@splidejs/splide": "^4.1.4",
"@splidejs/splide-extension-auto-scroll": "^0.5.3",
- "antd": "^5.21.5",
+ "antd": "^5.21.2",
"autoprefixer": "^10.4.19",
"axios": "^1.7.7",
"clsx": "^2.1.1",
diff --git a/frontend/src/components/Pages/HelpAndSupport.jsx b/frontend/src/components/Pages/HelpAndSupport.jsx
deleted file mode 100644
index a3bd1988..00000000
--- a/frontend/src/components/Pages/HelpAndSupport.jsx
+++ /dev/null
@@ -1,116 +0,0 @@
-import React, { useState } from 'react';
-import { MdKeyboardArrowDown } from 'react-icons/md';
-import { IoMdCall, IoMdMail } from 'react-icons/io';
-
-export default function HelpAndSupport() {
- const FAqs = [
- {
- question: 'How to create an account?',
- answer:
- "To create an account, click on the 'Sign Up' button on the top right corner of the page. Fill in your details and click on 'Create Account'.",
- },
- {
- question: 'How to reset password?',
- answer:
- "To reset your password, click on 'Forgot Password' on the login page. Enter your email address and follow the instructions sent to your email.",
- },
- {
- question: 'What is Sip & Play?',
- answer:
- "Sip & Play is a board game cafe in Park Slope, Brooklyn. It's a place where you can come with friends and family to play board games, enjoy coffee, boba, sandwiches, and snacks.",
- },
- {
- question: 'How does it work?',
- answer:
- "You can come in with your friends and family to play any board game from our library of 300+ games. There's no cover charge, just pay for your food and drinks.",
- },
- {
- question: 'What kind of games do you have?',
- answer:
- 'We have a wide variety of board games, including classics like Monopoly and Scrabble, as well as newer and more unique games.',
- },
- {
- question: 'Can I bring my own food and drinks?',
- answer:
- 'No, we do not allow outside food or drinks. We have a full menu of food and drinks available for purchase.',
- },
- {
- question: 'Is there parking available?',
- answer:
- ' There is limited street parking available near the cafe. You may also want to consider using public transportation.',
- },
- {
- question: 'Is there a cover charge?',
- answer:
- 'No, there is no cover charge. Just pay for your food and drinks.',
- },
- ];
-
- const [activeFAQ, setActiveFAQ] = useState(null);
-
- const handleFAQClick = (index) => {
- if (activeFAQ === index) {
- setActiveFAQ(null);
- } else {
- setActiveFAQ(index);
- }
- };
-
- return (
- <>
-
-
-
-
-
- Lost? Let's find your way.
-
-
- Explore our FAQs, tutorials, and user guides to learn how to
- make the most of our platform. If you can't find the answer
- you're looking for, don't hesitate to contact our friendly
- support team. We're always happy to help.
-
-
-
-
-
-
- {/* FAQ section */}
-
-
-
- {' '}
- Frequenty Asked Questions
-
- {FAqs.map((faq, index) => (
-
-
-
{
- handleFAQClick(index);
- }}
- >
-
- {faq.question}
-
-
-
-
- {faq.answer}
-
-
-
- ))}
-
- >
- );
-}
diff --git a/frontend/src/components/Pages/Login.jsx b/frontend/src/components/Pages/Login.jsx
index f9f9e053..7c760afa 100644
--- a/frontend/src/components/Pages/Login.jsx
+++ b/frontend/src/components/Pages/Login.jsx
@@ -1,10 +1,11 @@
import React, { useState, useEffect } from 'react';
import photo from '../../assets/login.png';
import { Link, useNavigate } from 'react-router-dom';
-import { message } from 'antd'; // Ant Design message component
+import { message } from 'antd';
import Cookies from 'js-cookie';
import { FaEye } from 'react-icons/fa';
import { FaEyeSlash } from 'react-icons/fa6';
+
const Login = () => {
const API_URL = import.meta.env.VITE_BACKEND_URL || 'http://localhost:3000';
const [data, setData] = useState({
@@ -17,19 +18,10 @@ const Login = () => {
const navigate = useNavigate();
- // Configuring the message to show at a certain top distance
- message.config({
- top: 80, // Distance from the top of the viewport
- duration: 2, // Auto close time in seconds
- maxCount: 3, // Max number of messages
- });
-
- // Function to handle changes in the form inputs
const handleChange = (e) => {
setData({ ...data, [e.target.name]: e.target.value });
};
- // Function to handle form submission (login)
const handleSubmit = async (e) => {
e.preventDefault();
setIsLoading(true);
@@ -43,40 +35,14 @@ const Login = () => {
body: JSON.stringify(data),
});
const result = await response.json();
-
if (!response.ok) {
throw new Error(result.message || 'Login failed');
}
-
- // Successful login message with a light green line below
- message.success({
- content: 'Login successful',
- className: 'success-message', // Add custom class for styling
- style: {
- fontSize: '22px',
- right: '50px', // Position it on the right side
- position: 'fixed', // Fix it to the viewport
- paddingTop: '10px', // Add padding to move the text down
- paddingBottom: '10px', // Padding for balance
- },
- });
- // Set token in cookies
Cookies.set('authToken', result.token, { expire: '1h', secure: true });
- navigate('/'); // Navigate to homepage after successful login
+ message.success('Login successful');
+ navigate('/');
} catch (err) {
- // Show error message if login fails with a red line below
- message.error({
- content: 'Something went wrong while logging in.',
- className: 'error-message', // Add custom class for styling
- style: {
- fontSize: '18px',
- right: '50px', // Position it on the right side
- position: 'fixed', // Fix it to the viewport
- paddingTop: '10px', // Add padding to move the text down
- paddingBottom: '10px', // Padding for balance
- },
- });
- setError('An error occurred. Please try again.');
+ setError(err.message || 'An error occurred. Please try again.');
} finally {
setIsLoading(false);
}
diff --git a/frontend/src/components/Pages/Signup.jsx b/frontend/src/components/Pages/Signup.jsx
index ad46915a..b10ce1c5 100644
--- a/frontend/src/components/Pages/Signup.jsx
+++ b/frontend/src/components/Pages/Signup.jsx
@@ -1,18 +1,10 @@
-import React, { useState, useEffect } from 'react';
-import { message } from 'antd'; // Import Ant Design message
+import { useState, useEffect } from 'react';
import photo from '../../assets/login.png';
import { useNavigate, Link } from 'react-router-dom';
import { FaEye } from 'react-icons/fa';
import { FaEyeSlash } from 'react-icons/fa6';
import zxcvbn from 'zxcvbn'; // Password strength checker
-
-// Configure message globally
-message.config({
- top: 80, // Align with the login page
- duration: 2, // Duration of the message visibility
-});
-
const Signup = () => {
const API_URL = import.meta.env.VITE_BACKEND_URL || 'http://localhost:3000';
const navigate = useNavigate();
@@ -33,43 +25,26 @@ const Signup = () => {
const handleSubmit = async (e) => {
e.preventDefault();
setIsLoading(true);
- setError(null); // Reset error before submission
-
- // Frontend validation
if (!data.email || !data.password || !data.name) {
- message.error({
- content: 'Please fill in all fields.',
- style: { fontSize: '18px' },
- });
+ setError('Please fill in all fields');
setIsLoading(false);
return;
}
if (data.password.length < 8) {
- message.error({
- content: 'Password must be at least 8 characters long.',
- style: { fontSize: '18px' },
- });
+ setError('Password must be at least 8 characters long');
setIsLoading(false);
return;
}
if (data.name.length < 3) {
- message.error({
- content: 'Name must be at least 3 characters long.',
- style: { fontSize: '18px' },
- });
+ setError('Name must be at least 3 characters long');
setIsLoading(false);
return;
}
if (!data.email.includes('@')) {
- message.error({
- content: 'Please enter a valid email address.',
- style: { fontSize: '18px' },
- });
+ setError('Please enter a valid email address');
setIsLoading(false);
return;
}
-
- // Submit form data
try {
const response = await fetch(`${API_URL}/api/user/register`, {
method: 'POST',
@@ -77,33 +52,16 @@ const Signup = () => {
body: JSON.stringify(data),
});
const result = await response.json();
-
if (!response.ok) {
setIsLoading(false);
- message.error({
- content: result.error || 'An error occurred during registration.',
- style: { fontSize: '18px' },
- });
+ setError(result.error);
return;
}
-
- // Successful registration message
- message.success({
- content: 'Registered successfully! Please log in.',
- style: { fontSize: '18px' },
- });
-
- // Redirect to login page
- navigate('/login');
+ alert('Registered successfully! Please log in.');
+ navigate('/');
} catch (error) {
setError(error.message);
console.error('Error:', error);
- message.error({
- content: 'An error occurred while submitting the form.',
- style: { fontSize: '18px' },
- });
- } finally {
- setIsLoading(false);
}
};
@@ -181,6 +139,11 @@ const Signup = () => {
Strength: {getPasswordStrengthText(passwordStrength)}
+ {error && (
+