A Node.js API service for integrating with Sympla's event management platform. This service provides event synchronization, order management, and automated data updates between your system and Sympla.
- Event Management: Sync and manage events from Sympla platform
- Order Processing: Automatically update and sync orders with status tracking
- Background Jobs: Automated order updates every 20 seconds for active events
- Database Integration: PostgreSQL database with Prisma ORM
- RESTful API: Clean REST endpoints for event and order operations
- TypeScript: Full TypeScript support with strict typing
- Node.js (v18 or higher)
- PostgreSQL database
- pnpm (recommended) or npm
- Clone the repository
git clone https://github.com/MatheusIshiyama/sympla-homologation.git
cd sympla-homologation- Install dependencies
pnpm install- Environment Setup
Create a
.envfile in the root directory with the following variables:
# Database
DATABASE_URL="postgresql://username:password@localhost:5432/sympla_homologation"
DIRECT_URL="postgresql://username:password@localhost:5432/sympla_homologation"
# Server
PORT=3000- Database Setup
# Generate Prisma client
pnpm prisma:generate
# Run database migrations
pnpm prisma:migrate# Start development server with hot reload
pnpm dev# Build the project
pnpm build
# Start production server
pnpm start# Open Prisma Studio (database GUI)
pnpm prisma:studio
# Generate Prisma client
pnpm prisma:generate
# Run migrations
pnpm prisma:migrateGET /healthGET /sympla/events/:eventIdReturns event information by ID.
Example:
curl http://localhost:3000/sympla/events/1111111The application uses PostgreSQL with the following main entities:
- Event management with integration details
- Support for private/public events
- Status tracking (active, published, cancelled)
- Date range management (start_date, end_date)
- Order processing and status tracking
- Buyer information management
- Transaction details and pricing
- UTM tracking support
- Attendee management for events
- Order association
- Contact information
- API configuration management
- Credential storage
- Service-specific settings
The application runs automated jobs every 20 seconds to:
- Fetch Active Events: Retrieve all active events from the database
- Update Orders: Sync new orders from Sympla API for each active event
- Status Validation: Filter orders with valid status ("A" for approved)
- Database Updates: Store new order data in the local database
src/
βββ config/ # Environment and configuration
βββ controllers/ # API controllers
βββ database/ # Database connection
βββ jobs/ # Background job processing
βββ repositories/ # Data access layer
βββ routes/ # API route definitions
βββ services/ # Business logic
βββ types/ # TypeScript type definitions
βββ utils/ # Utility functions
Use the provided HTTP request files in the requests/ directory to test the API:
requests/events.http- Event endpoint testingrequests/health.http- Health check testingrequests/integrations/sympla.http- Integration testing
| Script | Description |
|---|---|
pnpm dev |
Start development server with hot reload |
pnpm build |
Build the project for production |
pnpm start |
Start production server |
pnpm lint |
Run ESLint for code quality |
pnpm prisma:generate |
Generate Prisma client |
pnpm prisma:migrate |
Run database migrations |
pnpm prisma:studio |
Open Prisma Studio GUI |
| Variable | Description | Required |
|---|---|---|
DATABASE_URL |
PostgreSQL connection string | Yes |
DIRECT_URL |
Direct database connection | No |
PORT |
Server port (default: 3000) | No |
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Matheus Ishiyama - matheus.ishiyama@outlook.com
For support and questions, please contact the development team or create an issue in the repository.