The Community Events service is a full-stack web application that manages community events within the Decentraland virtual world. It allows users to create, discover, and attend events in both land-based locations and virtual worlds, providing a dApp interface for event management with features like recurrent events, event scheduling, notifications, and social sharing.
- Features
- Dependencies and Related Services
- API Documentation
- Database
- Getting Started
- Testing
- Development
- License
- Event Management: Create, edit, and manage community events with approval workflows
- Recurrent Events: Support for recurring events using RRule (RFC 5545) specifications
- Location-Based Discovery: Find events by coordinates, estates, worlds, or places
- Event Attendance: Track event attendance and display attendee lists
- Notifications: Browser push notifications and email notifications for upcoming events
- Schedules & Collections: Curated event collections with custom theming (festivals, fashion weeks, etc.)
- Full-Text Search: PostgreSQL-based text search across event names and descriptions
- Social Sharing: Open Graph meta tags for social media sharing
- PWA Support: Progressive Web App with offline capabilities
- Admin/Moderator Tools: Event approval/rejection system with permission controls
- PostgreSQL: Primary database for storing events and user data
- AWS S3: Storage for event poster images
- AWS SNS: Push notification delivery
- Decentraland Catalyst: World information and place resolution
- Decentraland Communities API: Community associations
- Notification Service: Event notification processing
- decentraland-gatsby: Framework providing authentication, database utilities, and job management
- @dcl/schemas: Decentraland schema definitions and validation
API endpoints are documented using OpenAPI/Swagger specification. See docs/openapi.yaml.
The service uses PostgreSQL with the following main tables:
events- Core event informationevent_attendees- User attendance trackingevent_category- Event categorization tagsschedules- Curated event collectionsprofile_settings- User notification preferencesprofile_subscription- Web push subscription data
For detailed schema information, see docs/database-schemas.md.
Database migrations are managed using node-pg-migrate. Migration files are located in src/migrations/.
npm run migrate create -- <migration-name>npm run migrate upnpm run migrate downAll migrations are timestamped TypeScript files with up() and down() functions for applying and rolling back changes.
- Node.js: v18.x or higher
- npm: v8.x or v9.x
- PostgreSQL: v12 or higher
- AWS Account: For S3 storage and SNS notifications (optional for development)
- Clone the repository:
git clone https://github.com/decentraland/events.git
cd events- Install dependencies:
npm install- Build the project:
npm run buildCopy the example environment file and configure it:
cp .env.example .env.developmentRequired environment variables:
| Variable | Description | Example |
|---|---|---|
CONNECTION_STRING |
PostgreSQL connection string | postgres://user:pass@localhost:5432/events |
ADMIN_ADDRESSES |
Comma-separated list of admin wallet addresses | 0xabc...,0xdef... |
AWS_REGION |
AWS region for S3 and SNS | us-east-1 |
AWS_ACCESS_KEY |
AWS access key ID | - |
AWS_ACCESS_SECRET |
AWS secret access key | - |
AWS_BUCKET_NAME |
S3 bucket for event images | events.decentraland.zone |
AWS_BUCKET_URL |
Public URL for S3 bucket | https://s3.amazonaws.com/... |
WEB_PUSH_SECRET |
VAPID private key for web push | Generate with web-push generate-vapid-keys |
GATSBY_WEB_PUSH_KEY |
VAPID public key for web push | Generate with web-push generate-vapid-keys |
GATSBY_DECENTRALAND_URL |
Decentraland play URL | https://play.decentraland.org |
GATSBY_COMMUNITIES_API_URL |
Communities API URL | https://social-api.decentraland.zone |
NOTIFICATION_SERVICE_URL |
Notification service URL | https://notifications-processor.decentraland.zone |
NOTIFICATION_SERVICE_TOKEN |
Auth token for notification service | - |
COMMUNITIES_API_ADMIN_TOKEN |
Admin token for communities API | - |
See .env.example for a complete list of configuration options.
Run both the frontend (Gatsby) and backend (Express) concurrently:
npm startThis will start:
- Express API server on
https://localhost:8000/api - Gatsby development server on
https://localhost:8000
- Build the frontend:
npm run build:front- Build the backend:
npm run build:server- Serve the built application (configure your production server to serve the built files and run the Express server)
Run only the backend server:
npm run serveRun only the Gatsby development server:
npm run developRun the test suite:
npm testRun tests with coverage:
npm test -- --coverageTests are organized as:
- Unit tests:
src/**/*.test.ts - Integration tests: Testing API endpoints and database interactions
Lint the codebase:
npm run lintAuto-fix linting issues:
npm run lint:fixFormat code:
npm run formatThe project uses Husky and lint-staged for pre-commit hooks. Code is automatically linted and formatted before commits.
Setup hooks (first time only):
npm run husky-setupevents/
├── src/
│ ├── entities/ # Domain entities (Event, Attendee, etc.)
│ │ ├── Event/
│ │ │ ├── model.ts # Database queries
│ │ │ ├── routes.ts # API endpoints
│ │ │ ├── types.ts # TypeScript types
│ │ │ ├── schemas.ts # Validation schemas
│ │ │ └── utils.ts # Helper functions
│ │ └── ...
│ ├── migrations/ # Database migrations
│ ├── hooks/ # React hooks
│ ├── api/ # Frontend API clients
│ ├── config/ # Configuration
│ └── server.ts # Express server setup
├── docs/ # Documentation
│ ├── ai-agent-context.md # AI agent context
│ ├── database-schemas.md # Database schema details
│ └── openapi.yaml # API documentation
├── static/ # Static assets
└── package.json
For AI-assisted development and comprehensive service documentation, see docs/ai-agent-context.md.
Copyright 2020 by the Decentraland Foundation
Licensed under the MIT License. See LICENSE for details.
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
