A Node.js application that serves as an event planning and reminder system. Users can create events, assign them to different categories, set reminder notifications, and view upcoming events based on various criteria.
- Event Creation: Create events with name, description, date, and time
- Event Categorization: Assign events to different categories (e.g., Meetings, Birthdays, Appointments)
- Reminder System: Set reminders for events and receive email notifications
- View Events: View upcoming events sorted by date, category, or reminder status
- User Authentication: Basic user authentication to manage events independently
-
Clone the repository
-
Install dependencies:
npm install -
Create a
.envfile in the root directory with the following variables:PORT=3000 JWT_SECRET=your_jwt_secret EMAIL_USER=your_gmail_account@gmail.com EMAIL_PASS=your_gmail_app_passwordNote: For EMAIL_PASS, you need to use an app password if you have 2FA enabled on your Google account.
-
Start the server:
npm startFor development with auto-reload:
npm run dev
-
POST
/auth/register- Register a new user- Body:
{ "username": "user1", "email": "user1@example.com", "password": "password123" }
- Body:
-
POST
/auth/login- Login and get authentication token- Body:
{ "email": "user1@example.com", "password": "password123" } - Response:
{ "token": "jwt_token" }
- Body:
All event endpoints require Authorization header: Authorization: Bearer jwt_token
-
POST
/events- Create a new event- Body:
{ "name": "Team Meeting", "description": "Weekly team sync-up", "date": "2023-04-15", "time": "10:00 AM", "category": "Meetings", "reminderTime": "2023-04-15T09:45:00Z" }
- Body:
-
GET
/events- Get all events for the authenticated user- Query parameters:
sort=date- Sort by datecategory=Meetings- Filter by categoryreminder=true- Filter events with reminders
- Query parameters:
-
PUT
/events/:id- Update an event- Body: Include fields to update
-
DELETE
/events/:id- Delete an event
Run the test suite with:
npm test
``` #