Skip to content

Pythagora-io/digitaloceaninnocorner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pythagora x Digital Ocean Vibe Coders Inno Corner

A modern event registration platform where users can sign up for upcoming Pythagora x Digital Ocean events and receive automatic calendar invites. Users can also optionally submit their app ideas for review through an integrated admin dashboard.

License Node MongoDB


🎯 Features

For Users

  • Event Registration: Browse and register for 4 upcoming Pythagora x Digital Ocean events in October 2025
  • Automatic Calendar Integration: Receive email confirmations with calendar invites that automatically add events to your calendar (Google Calendar, Outlook, Apple Calendar, etc.)
  • Flexible Selection: Choose which events you want to attend (all events are pre-selected by default)
  • Optional Idea Submission: Optionally share your app idea with the Pythagora team
  • Responsive Design: Beautiful, mobile-friendly interface built with modern UI components

For Admins

  • Secure Admin Dashboard: Protected login system for reviewing submissions
  • Submission Management: View all event registrations and idea submissions
  • Detailed Insights: See user emails, submission dates, selected events, and idea descriptions
  • Expandable View: Click to expand and read full idea submissions

🛠️ Technology Stack

Frontend

  • React 18 with TypeScript
  • Vite - Lightning-fast development server
  • Tailwind CSS - Utility-first styling
  • shadcn/ui - High-quality React components
  • React Hook Form - Performant form handling
  • Zod - TypeScript-first schema validation
  • React Router DOM - Client-side routing

Backend

  • Node.js with Express
  • TypeScript - Type-safe server code
  • MongoDB with Mongoose - Document database
  • Nodemailer - Email sending with calendar invites
  • JWT - Secure authentication
  • bcrypt - Password hashing

DevOps

  • Concurrently - Run client and server simultaneously
  • ESLint - Code linting and quality

📋 Prerequisites

Before running this project, make sure you have the following installed:


🚀 Installation & Setup

1. Clone the Repository

git clone <repository-url>
cd IdeaSubmitApp

2. Install Dependencies

The project uses a monorepo structure. Install all dependencies at once:

npm install

This will automatically install dependencies for:

  • Root project
  • Client (React app)
  • Server (Express API)
  • Shared utilities

3. Configure Environment Variables

Navigate to the server directory and create a .env file:

cd server
touch .env

Add the following environment variables to server/.env:

# Server Configuration
PORT=3000

# Database Configuration
DATABASE_URL=mongodb://localhost/IdeaSubmitApp

# JWT Secrets (generate your own secure random strings)
JWT_SECRET=your_jwt_secret_here
REFRESH_TOKEN_SECRET=your_refresh_token_secret_here

# Email Configuration (Gmail)
GMAIL_USER=[email protected]
GMAIL_APP_PASSWORD=your-gmail-app-password

📧 Setting Up Gmail App Password

To send emails with calendar invites, you need a Gmail App Password:

  1. Go to your Google Account settings: https://myaccount.google.com/
  2. Navigate to Security2-Step Verification (enable if not already)
  3. Scroll down to App passwords
  4. Create a new app password for "Mail"
  5. Copy the generated 16-character password
  6. Paste it as GMAIL_APP_PASSWORD in your .env file

Note: You can use other SMTP providers by modifying the email configuration in server/services/emailService.ts.

4. Start MongoDB

Make sure MongoDB is running on your local machine:

# On macOS (if installed via Homebrew)
brew services start mongodb-community

# On Linux
sudo systemctl start mongod

# On Windows
net start MongoDB

5. Seed Admin User

Create the admin account for accessing the dashboard:

cd server
npm run seed:admin

This creates an admin user with:

  • Username: admin
  • Password: admin123

⚠️ Security Note: Change these credentials immediately in a production environment!


🎮 Running the Application

Development Mode

From the project root directory:

npm start

This will start:

The frontend automatically proxies API requests to the backend.

Running Client and Server Separately

If you need to run them separately:

# Terminal 1 - Run the server
npm run server

# Terminal 2 - Run the client
npm run client

📱 Using the Application

User Flow

  1. Open the application: Navigate to http://localhost:5173
  2. View events: See all 4 upcoming Pythagora x Digital Ocean events
  3. Select events: Check/uncheck events you want to attend (all are selected by default)
  4. Enter email: Provide your email address for confirmation
  5. Optional idea: Share your app idea (optional field)
  6. Submit: Click submit to register
  7. Check email: You'll receive a confirmation email with calendar invites
  8. Add to calendar: Calendar invites will automatically add events to your calendar app

Admin Flow

  1. Navigate to admin: Go to http://localhost:5173/admin/login
  2. Login: Use credentials (admin / admin123 by default)
  3. View dashboard: See all submissions with:
    • User emails
    • Submission dates
    • Selected events
    • Idea previews
  4. Expand ideas: Click on any submission to read the full idea
  5. Logout: Click logout when finished

🗂️ Project Structure

IdeaSubmitApp/
├── client/                      # React frontend
│   ├── public/                  # Static assets
│   ├── src/
│   │   ├── api/                 # API client functions
│   │   ├── assets/              # Images and logos
│   │   ├── components/          # React components
│   │   │   └── ui/              # shadcn/ui components
│   │   ├── config/              # Frontend configuration
│   │   ├── hooks/               # Custom React hooks
│   │   ├── lib/                 # Utility functions
│   │   ├── pages/               # Page components
│   │   └── App.tsx              # Main App component
│   ├── package.json
│   └── vite.config.ts
│
├── server/                      # Express backend
│   ├── config/
│   │   ├── database.ts          # MongoDB configuration
│   │   └── events.ts            # Event data definitions
│   ├── models/
│   │   ├── User.ts              # User model
│   │   └── Idea.ts              # Submission model
│   ├── routes/
│   │   ├── middleware/
│   │   │   └── auth.ts          # Authentication middleware
│   │   ├── authRoutes.ts        # Auth endpoints
│   │   ├── ideaRoutes.ts        # Submission endpoints
│   │   └── index.ts             # Route aggregation
│   ├── services/
│   │   ├── userService.ts       # User business logic
│   │   └── emailService.ts      # Email & calendar invites
│   ├── scripts/
│   │   └── seedAdmin.ts         # Admin user seeding
│   ├── utils/
│   │   └── password.ts          # Password utilities
│   ├── .env                     # Environment variables
│   ├── server.ts                # Server entry point
│   └── package.json
│
├── shared/                      # Shared types and utilities
│   └── types/                   # TypeScript interfaces
│
├── package.json                 # Root package configuration
└── README.md                    # This file

🔧 API Endpoints

Public Endpoints

Submit Idea

POST /api/ideas
Content-Type: application/json

{
  "email": "[email protected]",
  "idea": "My amazing app idea...",
  "events": [1, 2, 3, 4]
}

Response:

{
  "success": true,
  "message": "Idea submitted successfully!"
}

Authentication Endpoints

Admin Login

POST /api/auth/login
Content-Type: application/json

{
  "email": "admin",
  "password": "admin123"
}

Response:

{
  "accessToken": "jwt_token_here",
  "refreshToken": "refresh_token_here",
  "user": {
    "id": "user_id",
    "email": "admin"
  }
}

Protected Endpoints (Require Authentication)

Get All Submissions

GET /api/ideas
Authorization: Bearer <access_token>

Response:

{
  "ideas": [
    {
      "_id": "submission_id",
      "email": "[email protected]",
      "idea": "App idea text",
      "events": [1, 2, 3],
      "createdAt": "2025-01-15T10:30:00.000Z"
    }
  ]
}

🎨 Available Events

The platform features 4 events in October 2025:

  1. October 8, 2025 - 7:00 AM PST
  2. October 15, 2025 - 7:00 AM PST
  3. October 22, 2025 - 7:00 AM PST
  4. October 29, 2025 - 7:00 AM PST

All events are Pythagora x Digital Ocean Vibe Coders Inno Corner sessions.


📧 Calendar Integration

The application sends calendar invites using the METHOD:REQUEST format, which ensures automatic integration with popular calendar applications:

  • ✅ Google Calendar
  • ✅ Microsoft Outlook
  • ✅ Apple Calendar
  • ✅ Yahoo Calendar
  • ✅ Most other calendar clients

Each invite includes:

  • Event title and description
  • Date and time (7:00 AM PST)
  • Location (Virtual)
  • Organizer information
  • Unique event identifier

🧪 Development Commands

# Install all dependencies
npm install

# Start both client and server
npm start

# Run client only
npm run client

# Run server only
npm run server

# Lint all code
npm run lint

# Build for production
npm run build

# Seed admin user
cd server && npm run seed:admin

🔐 Security Features

  • Password Hashing: Admin passwords are hashed using bcrypt
  • JWT Authentication: Secure token-based authentication
  • Session Management: Automatic token refresh mechanism
  • Protected Routes: Admin routes require valid authentication
  • Input Validation: All inputs validated with Zod schemas
  • MongoDB Injection Prevention: Mongoose parameterized queries
  • CORS Protection: Configured CORS policies

🐛 Troubleshooting

MongoDB Connection Issues

# Check if MongoDB is running
pgrep mongo

# Restart MongoDB
brew services restart mongodb-community  # macOS
sudo systemctl restart mongod           # Linux

Port Already in Use

# Kill process on port 3000 (backend)
lsof -ti:3000 | xargs kill -9

# Kill process on port 5173 (frontend)
lsof -ti:5173 | xargs kill -9

Email Not Sending

  • Verify GMAIL_USER and GMAIL_APP_PASSWORD in .env
  • Ensure 2-Step Verification is enabled on your Google account
  • Check that you're using an App Password, not your regular password
  • Review server logs for specific error messages

Calendar Invites Not Working

  • Check email client logs
  • Verify the event format in the email
  • Try downloading the .ics attachment manually
  • Ensure your email client supports METHOD:REQUEST format

📄 License

ISC License - Feel free to use this project for your own purposes.


👥 Contributing

This is a demo project for Pythagora x Digital Ocean events. Feel free to fork and modify for your own use cases.


📞 Support

For issues or questions about the Pythagora x Digital Ocean events, please contact the event organizers.

For technical issues with this codebase, please open an issue in the repository.


🙏 Acknowledgments

  • Pythagora - AI-powered development platform
  • Digital Ocean - Cloud infrastructure provider
  • shadcn/ui - Beautiful component library
  • Vite - Next-generation frontend tooling

Built with ❤️ by Pythagora Agent

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published