A Modern, Responsive Client sided React Application for managing event RSVPs w/ realtime updates and an intuitive user interface.
This application provides a seamless event management experience with features including:
- πͺ Dynamic event listing with responsive grid layout
- π Real-time RSVP updates
- π« Smooth animations and transitions
- π¨ Modern, accessible UI with Chakra UI
- π± Full responsive design
- β‘ Optimized performance with React
- Frontend: React, Chakra UI, Framer Motion
- Backend: Express.js, MongoDB
- State Management: React Hooks
- API Communication: Axios
- Styling: Chakra UI + Custom Theme
- Animation: Framer Motion
- Lazy loading of components
- Optimized re-renders, minimizing unecessary renders
- Debounced API calls, reducing number of API calls
- Skeleton loading states
- Image optimization
App
βββ ChakraProvider (Theme)
βββ Container
βββ Header
βββ EventList
βββ LoadingSkeleton
βββ EventCard
βββ Event Details
βββ RSVP Button
graph TD
A[App] -->|Events Data| B[EventList]
A -->|RSVP Actions| B
B -->|Event Props| C[EventCard]
C -->|RSVP Toggle| A
A -->|API Calls| D[Backend]
D -->|Response| A
// Example API call implementation
const fetchEvents = async () => {
try {
const response = await axios.get("http://localhost:8080/api/events");
setEvents(response.data);
} catch (err) {
// Error handling
}
};
Response Format: Newly created event object.
Endpoint | Method | Description |
---|---|---|
/api/events |
GET | Fetch all events |
/api/events/:id/headCount/rsvp |
POST | RSVP to an event |
/api/events/:id/headCount/unrsvp |
POST | Cancel RSVP |
Events Collection
Each document in the
events
collection has the following schema:
_id
: ObjectId - Unique identifier for the event.name
: String - Name of the event.description
: String - Description of the event.date
: Date - Date when the event is scheduled.location
: String - Location where the event will take place.headCount
: Integer - Number of people who have RSVPed to the event.
Example Document:
{
"_id": ObjectId("..."),
"name": "Ithaca Farmers Market",
"description": "A gathering of local farmers and artisans. Fresh produce, handmade crafts, and more.",
"date": "2023-07-15",
"location": "Ithaca Farmers Market Pavilion",
"headCount": 0
}
## React Hooks Usage
### State Management
```javascript
// Core state hooks
const [events, setEvents] = useState([]);
const [loading, setLoading] = useState(false);
const [userRSVPs, setUserRSVPs] = useState({});
// Data fetching effect
useEffect(() => {
const fetchEvents = async () => {
setLoading(true);
try {
const response = await axios.get("http://localhost:8080/api/events");
setEvents(response.data);
} finally {
setLoading(false);
}
};
fetchEvents();
}, []);
- Theme: Custom Chakra UI theme with Inter font
- Colors: Dynamic color scheme with gradient accents
- Components: Reusable, accessible components
- Animations: Framer Motion for smooth transitions
-
Responsive Grid Layout
- Adaptive columns based on screen size
- Maintains symmetry with filler cards
-
Interactive Cards
- Hover animations
- Loading states
- RSVP status indicators
-
Accessibility
- ARIA labels
- Keyboard navigation
- Screen reader support
- User views event grid
- Hovers over event for more details
- Clicks RSVP button
- Receives confirmation toast
- Sees updated attendance count
- Node.js (v14 or higher)
- MongoDB
- Clone the repository:
git clone <repository-url>
- Install dependencies:
# Install client dependencies
cd client
npm install
# Install server dependencies
cd ../server
npm install
- Configure environment:
# Create .env file in server directory
echo "PORT=8080" > .env
- Start MongoDB:
mongosh init.mongo.js
- Start the server:
cd server
npm run dev
- Start the client:
cd client
npm start
The application will be available at http://localhost:3000
.
- Fork the repository
- Create your feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request