A full-stack web application designed to manage donations and events for CUDECA, a charitable organization. This platform enables users to make donations, register for events, purchase tickets, and manage their profiles, while providing administrators with comprehensive management tools.
- Overview
- Features
- Architecture
- Technologies Used
- Project Structure
- Getting Started
- API Endpoints
- Database Models
- Configuration
- Deployment
- Troubleshooting
- Development Team
- Contributing
- License
CUDECA WATT is a comprehensive platform built to facilitate charitable donations and event management. The application provides a seamless user experience for donors and event participants while offering robust administrative capabilities for organization staff.
- π Authentication & Authorization - Secure user registration and login using Supabase Auth
- π° Donation Management - Make donations (authenticated or anonymous) and view donation history
- π Tax Certificates - Generate annual donation certificates in PDF format for tax purposes
- π« Event Registration - Browse, search, and register for upcoming events
- ποΈ Ticket Purchase - Purchase and manage event tickets (authenticated or anonymous)
- π·οΈ Discount Codes - Apply promotional discount codes to ticket purchases
- π§ Email Delivery - Automatic email delivery of tickets and certificates
- π€ Profile Management - Update personal information and view activity
- π Dashboard - Personalized donation summary and statistics
- π€ Partner Membership - Subscribe to partner programs (monthly, quarterly, or annual plans)
- π’ Corporate Profiles - Create and manage corporate donor profiles
- π± QR Code Tickets - Digital tickets with QR codes for event entry validation
- π‘οΈ Admin Panel - Dedicated administrative interface
- π Event Management - Create, update, and delete events with image uploads
- ποΈ Ticket Type Management - Configure multiple ticket types per event (General, VIP, etc.)
- π QR Validation - Validate ticket QR codes at event entrances
- π₯ User Management - View and manage registered users
- π³ Payment Processing - Monitor donations and ticket sales
- π Analytics - Track donations and event participation
The application follows a modern client-server architecture with clear separation of concerns:
- Frontend: Single Page Application (SPA) built with Angular 19
- Backend: RESTful API built with ASP.NET Core 9.0 (Minimal API)
- Database: Supabase (PostgreSQL)
- Authentication: Supabase Auth with JWT tokens
- Deployment: Docker containerization ready
| Technology | Version | Purpose |
|---|---|---|
| Angular | 19.2.0 | Frontend framework for building the SPA |
| TypeScript | 5.7.2 | Type-safe programming language |
| RxJS | 7.8.0 | Reactive programming with observables |
| Tailwind CSS | 3.4.18 | Utility-first CSS framework for styling |
| Angular Router | 19.2.0 | Client-side routing and navigation |
| Angular Forms | 19.2.0 | Form handling and validation |
Key Frontend Features:
- Responsive design with Tailwind CSS
- Route guards for authentication
- Service-based architecture for API communication
- Component-based UI structure
- Lazy loading for optimized performance
| Technology | Version | Purpose |
|---|---|---|
| ASP.NET Core | 9.0 | Backend framework using Minimal API approach |
| C# | 12.0 (.NET 9.0) | Primary backend language |
| Supabase Client | 1.1.1 | Database and authentication client |
| Swagger/OpenAPI | 7.2.0 | API documentation and testing |
| Scalar | 2.11.5 | Modern API documentation UI |
| QuestPDF | 2025.7.4 | PDF generation for certificates |
| QRCoder | 1.7.0 | QR code generation for tickets |
| Stripe.NET | 50.0.0 | Payment processing integration |
| RestSharp | 113.0.0 | HTTP client for external API calls |
Key Backend Features:
- RESTful API architecture with Minimal API pattern
- JWT-based authentication via Supabase
- Custom authentication filters (
SupabaseAuthFilter,AdminAuthFilter,OptionalAuthFilter) - CORS configuration for secure cross-origin requests
- Strongly-typed models with Postgrest attributes
- User Secrets for secure configuration management
- Docker support for containerized deployment
- Email service integration with Mailgun
- Payment processing with Stripe (configurable with simulated mode for development)
- PDF certificate generation with QuestPDF
- QR code generation and validation for tickets
- Support for authenticated and anonymous transactions
| Technology | Purpose |
|---|---|
| Supabase | Backend-as-a-Service (PostgreSQL database + Auth) |
| Docker | Containerization and deployment |
| Git | Version control |
| Swagger UI | Interactive API documentation |
| Scalar | Modern alternative API documentation |
| Mailgun | Email delivery service for tickets & certificates |
| Stripe | Payment processing platform |
| Azure | Cloud hosting and deployment |
| User Secrets | Secure configuration management |
Proyecto-ADAp-WATT/
βββ Backend/
β βββ Backend.sln # Solution file
β βββ docker-compose.yml # Docker composition
β βββ Backend/
β βββ Program.cs # Application entry point
β βββ Backend.csproj # Project configuration
β βββ Dockerfile # Docker configuration
β βββ WebApplicationExtensions.cs # Endpoint registration
β β
β βββ Models/ # Database models
β β βββ Usuario.cs
β β βββ Cliente.cs
β β βββ Evento.cs
β β βββ Donacion.cs
β β βββ Entrada.cs
β β βββ EntradaEvento.cs
β β βββ Pago.cs
β β βββ Admin.cs
β β βββ Socio.cs
β β βββ PeriodoSocio.cs
β β βββ Corporativo.cs
β β βββ ValeDescuento.cs
β β βββ UsuarioNoRegistrado.cs
β β
β βββ AdminEndpoints.cs # Admin API endpoints
β βββ Donations.cs # Donation endpoints
β βββ Events.cs # Event endpoints
β βββ Tickets.cs # Ticket endpoints
β βββ Profile.cs # Profile endpoints
β βββ Auth.cs # Authentication endpoints
β βββ Partner.cs # Partner endpoints
β βββ Corporate.cs # Corporate endpoints
β βββ DevTools.cs # Development tools
β βββ Test.cs # Test endpoints
β β
β βββ Filters/ # Authentication filters
β β βββ SupabaseAuthFilter.cs
β β βββ AdminAuthFilter.cs
β β βββ OptionalAuthFilter.cs
β β βββ SwaggerEmptyStringDefaultFilter.cs
β β
β βββ Services/ # External service integrations
β β βββ IEmailService.cs
β β βββ MailGunService.cs
β β βββ IPaymentService.cs
β β βββ StripePaymentService.cs
β β βββ SimulatedPaymentService.cs
β β
β βββ ResponseDtos.cs # API response DTOs
β βββ Settings.cs # Configuration settings
β βββ appsettings.json # Application configuration
β
βββ Frontend/
β βββ cudecaApp/
β βββ angular.json # Angular configuration
β βββ package.json # NPM dependencies
β βββ tailwind.config.js # Tailwind configuration
β β
β βββ src/
β βββ app/
β β βββ home/ # Home page component
β β βββ login/ # Login component
β β βββ sign-up/ # Registration component
β β βββ cuenta/ # User account component
β β βββ donation/ # Donation component
β β βββ eventos/ # Events list component
β β βββ evento-detalles/ # Event details component
β β βββ compra-entradas/ # Ticket purchase component
β β βββ compra-finalizada/ # Purchase confirmation
β β βββ pagos/ # Payment processing
β β βββ hazte-socio/ # Partner subscription
β β βββ qr-validate/ # QR code validation
β β βββ help-modal/ # Help modal component
β β βββ layouts/ # Layout components
β β βββ services/ # API services
β β β βββ auth.service.ts
β β β βββ compra.service.ts
β β β βββ partner.service.ts
β β β βββ partner-api.service.ts
β β β βββ company.service.ts
β β βββ guards/ # Route guards
β β β βββ auth.guard.ts
β β β βββ public.guard.ts
β β βββ interceptors/ # HTTP interceptors
β β βββ app.routes.ts # Application routes
β β
β βββ assets/ # Static assets
β β βββ images/
β βββ styles.css # Global styles
β βββ index.html # Main HTML file
β
βββ DiagramClase.xmi # UML class diagram (root level)
βββ DiagramSequence.xmi # UML sequence diagram (root level)
βββ EntityRelationship.xmi # Entity relationship diagram (root level)
βββ UseCase.xmi # Use case diagram (root level)
βββ README.md # This file
Before you begin, ensure you have the following installed:
- Node.js (v18 or higher) and npm
- .NET 9.0 SDK
- Docker (optional, for containerized deployment)
- Supabase Account (for database and authentication)
-
Navigate to the Backend directory:
cd Backend/Backend -
Configure required services using User Secrets:
# Supabase configuration (required) dotnet user-secrets set "Supabase:Url" "https://your-project.supabase.co" dotnet user-secrets set "Supabase:Key" "your-anon-key" # Mailgun configuration (required for email delivery) dotnet user-secrets set "MailGun:ApiKey" "your-mailgun-api-key" dotnet user-secrets set "MailGun:Domain" "your-domain.mailgun.org" # Stripe configuration (optional - uses simulated payment by default) dotnet user-secrets set "Stripe:SecretKey" "your-stripe-secret-key"
-
Restore dependencies:
dotnet restore
-
Run the application:
dotnet run
The API will be available at
https://localhost:5001(orhttp://localhost:5000) -
Verify the API is running: Navigate to
https://localhost:5001/- you should see "CUDECA API" Test Supabase connection:https://localhost:5001/test/supabase -
Access API documentation:
- Swagger UI:
https://localhost:5001/swagger - Scalar UI (modern alternative):
https://localhost:5001/scalar/v1
- Swagger UI:
-
Navigate to the Frontend directory:
cd Frontend/cudecaApp -
Install dependencies:
npm install
-
Configure environment (if needed): Update the API base URL in your services to point to the backend.
-
Start the development server:
npm start
The application will be available at
http://localhost:4200
To run the backend using Docker:
cd Backend
docker-compose up --buildPOST /auth/signup- User registrationPOST /auth/signin- User loginPOST /auth/signout- User logout (requires authentication)
GET /users/me- Get current user profile (requires authentication)PUT /users/me- Update user profile (requires authentication)GET /users/me/is-admin- Check if user is admin (requires authentication)GET /users/me/is-partner- Check if user is partner (requires authentication)GET /users/me/is-corporate- Check if user is corporate (requires authentication)
GET /users/me/tickets- Get user's purchased tickets (requires authentication)GET /users/me/tickets/{ticketId}- Get specific ticket details (requires authentication)GET /users/me/donations- Get user's donation history (requires authentication)GET /users/me/donations/summary- Get donation summary (requires authentication)
POST /donations- Create a donation (authenticated or anonymous)POST /donations/certificate/annual- Generate annual donation certificate PDF (requires authentication)
GET /events- List all visible events (supports search withqueryparameter)GET /events/{eventId}- Get event details
GET /tickets/type/event/{eventId}- Get ticket types for specific eventPOST /tickets/purchase- Purchase event tickets (authenticated or anonymous)GET /tickets/validate- Validate ticket QR code
GET /payments/methods- Get available payment methodsPOST /discounts/validate- Validate discount code
POST /partners/subscribe- Subscribe as partner (requires authentication)GET /partners/data- Get partner membership data (requires authentication)
POST /company- Create or update corporate profile (requires authentication)GET /company- Get corporate profile data (requires authentication)
GET /admin/events- List all events including hidden ones (requires admin)POST /admin/events- Create new event with image upload (requires admin)PUT /admin/events/{eventId}- Update event (requires admin)DELETE /admin/events/{eventId}- Delete event (requires admin)
GET /dev/dtos- Get all DTO structures for API integration
- Usuario - User information (ID, email, DNI, name, phone, address)
- Cliente - Client/donor profile linked to Usuario
- UsuarioNoRegistrado - Anonymous user data for non-authenticated transactions
- Admin - Administrator accounts with elevated privileges
- Evento - Event details (name, description, date, location, capacity, image)
- Entrada - Individual ticket instances with QR codes and purchase information
- EntradaEvento - Ticket types for events (General, VIP, etc.) with pricing and stock
- Donacion - Donation records with amount, date, and donor information
- Pago - Payment information for donations and tickets (method, amount, status)
- Socio - Partner membership records linked to Cliente
- PeriodoSocio - Partner membership periods with dates and fees
- Corporativo - Corporate donor profiles with company information
- ValeDescuento - Discount/voucher codes with expiration and usage limits
The backend requires several configuration settings that should be stored securely using .NET User Secrets in development:
-
Supabase - Database and authentication
Supabase:Url- Your Supabase project URLSupabase:Key- Your Supabase anon/public key
-
Mailgun - Email delivery service
MailGun:ApiKey- Your Mailgun API keyMailGun:Domain- Your Mailgun domain
- Stripe - Payment processing (defaults to simulated payment service)
Stripe:SecretKey- Your Stripe secret key
The frontend connects to the backend API. Update the API URL in service files:
- Located in:
Frontend/cudecaApp/src/app/services/*.service.ts - Default development:
http://localhost:5000orhttps://localhost:5001 - Production: Configure to point to your deployed backend URL
The backend is configured to accept requests from:
http://localhost:4200(development)https://cudeca-watt.es(production)https://www.cudeca-watt.es(production)
Update Program.cs to add additional allowed origins if needed.
The application supports two payment modes:
- Simulated Mode (default) - For development and testing
- Stripe Integration - For production use
Configure in Program.cs by uncommenting the environment-based payment service selection.
The backend is containerized and can be deployed using Docker:
cd Backend
docker-compose up --buildThe application is deployed on Azure App Service. Configure your production URL in environment variables.
Build the Angular application for production:
cd Frontend/cudecaApp
npm run buildThe production build will be in dist/ directory. Deploy to your preferred hosting service.
For production deployment, configure environment variables instead of User Secrets:
Supabase__UrlSupabase__KeyMailGun__ApiKeyMailGun__DomainStripe__SecretKey(optional)
- Team Member 1 - Role/Responsibilities
- Team Member 2 - Role/Responsibilities
- Team Member 3 - Role/Responsibilities
- Team Member 1 - Role/Responsibilities
- Team Member 2 - Role/Responsibilities
- Team Member 3 - Role/Responsibilities
Problem: "Supabase configuration is missing" error
- Solution: Ensure you've set up user secrets for Supabase:Url and Supabase:Key
Problem: "MailGun configuration is missing" error
- Solution: Configure Mailgun credentials using user secrets
Problem: CORS errors when calling API from frontend
- Solution: Check that your frontend URL is listed in the CORS policy in
Program.cs
Problem: Payment processing fails
- Solution: The app uses simulated payments by default. For Stripe integration, configure Stripe secret key
Problem: API calls fail with 404 or connection errors
- Solution: Verify the backend is running and the API URL in services matches your backend URL
Problem: Authentication not working
- Solution: Check that Supabase credentials are correctly configured in both backend and frontend
Problem: Database queries fail
- Solution: Verify Supabase connection and ensure database tables match the models
Problem: Missing tables or columns
- Solution: Review the database models in
Backend/Models/and ensure your Supabase database schema matches
- API Documentation: Access Swagger UI at
/swaggeror Scalar UI at/scalar/v1when running the backend - Supabase Documentation: https://supabase.com/docs
- Angular Documentation: https://angular.dev
- Tailwind CSS: https://tailwindcss.com/docs
This project is developed for CUDECA as part of the ADAp course. All rights reserved.
This is an academic project. For any questions or suggestions, please contact the development team.
For more information about CUDECA and their mission, visit their official website or contact the project maintainers.
Made with β€οΈ for CUDECA