A comprehensive full-stack platform for managing civic engagement, including users, campaigns, events, projects, and impact metrics.
PI-CIS/
βββ civic-platform-backend/ # Spring Boot Backend
β βββ src/main/java/com/civicplatform/
β β βββ controller/ # REST Controllers
β β βββ service/ # Business Logic
β β βββ repository/ # Data Access Layer
β β βββ entity/ # JPA Entities
β β βββ dto/ # Data Transfer Objects
β β βββ mapper/ # MapStruct Mappers
β β βββ security/ # JWT Authentication
β β βββ validator/ # Custom Validators
β β βββ exception/ # Exception Handling
β βββ src/main/resources/
β βββ application.yml # Configuration
β βββ templates/email/ # Email Templates
βββ civic-platform-frontend/ # Angular Frontend
βββ src/app/
β βββ core/ # Core Services & Auth
β βββ features/ # Feature Modules
β βββ shared/ # Shared Components
βββ package.json
βββ angular.json
- Spring Boot 3.2.3 - Main framework
- Java 17+ - Programming language
- Spring Security 6 - Authentication & Authorization
- JWT (jjwt 0.12.5) - Token-based authentication
- Spring Data JPA + Hibernate - Database ORM
- MariaDB - Relational database
- MapStruct - DTO mapping
- Bean Validation - Input validation
- Apache PDFBox - PDF generation
- Spring Mail + Thymeleaf - Email services
- Lombok - Code generation
- SpringDoc OpenAPI - API documentation
- Angular 17+ - Frontend framework
- TypeScript - Type-safe JavaScript
- TailwindCSS - Utility-first CSS framework
- RxJS - Reactive programming
- Angular Router - Client-side routing
- Angular Forms - Form handling
- Java 17+
- Node.js 18+
- MariaDB
- Maven
- Angular CLI
-
Database Setup:
CREATE DATABASE civic_platform;
-
Configure Application: Update
civic-platform-backend/src/main/resources/application.ymlwith your database credentials:spring: datasource: url: jdbc:mariadb://localhost:3306/civic_platform username: your_username password: your_password
-
Run Backend:
cd civic-platform-backend mvn spring-boot:run -
Access API Documentation: Open http://localhost:8080/swagger-ui.html in your browser
-
Install Dependencies:
cd civic-platform-frontend npm install -
Run Development Server:
npm start
-
Access Application: Open http://localhost:4200 in your browser
- JWT-based authentication with refresh tokens
- Role-based access control: USER and ADMIN only (separate from
user_type) - Multiple user types: Ambassador, Donor, Citizen, Participant
- Custom validation for user registration
- Complete CRUD operations
- User type-specific fields
- Ambassador promotion logic
- Profile management
- Create, launch, and manage campaigns
- Voting system for campaign activation (100 votes threshold)
- Progress tracking (kg, meals, funding)
- Status management (DRAFT, ACTIVE, COMPLETED, CANCELLED)
- Event creation and management
- Registration with capacity limits
- Check-in functionality
- Event status tracking
- Project creation and funding
- Vote tracking
- Progress monitoring
- Completion reports
- Automated daily metrics calculation
- COβ savings tracking
- Meals distribution metrics
- PDF report generation
- PDF Generation: Campaign, project, and metrics reports
- Email Notifications: Registration, campaign launches, event confirmations
- Scheduled Jobs: Daily metrics calculation
- Role-based UI: Different interfaces for different user types
POST /api/auth/register- User registrationPOST /api/auth/login- User loginPOST /api/auth/refresh- Token refreshPOST /api/auth/logout- User logout
GET /api/users- Get all users (Admin)GET /api/users/{id}- Get user by IDPUT /api/users/{id}- Update userDELETE /api/users/{id}- Delete user (Admin)POST /api/users/{id}/promote- Promote to ambassador (Admin)
GET /api/campaigns- Get all campaignsPOST /api/campaigns- Create campaignPOST /api/campaigns/{id}/launch- Launch campaignPOST /api/campaigns/{id}/vote- Vote for campaign
GET /api/events- Get all eventsPOST /api/events- Create eventPOST /api/events/{id}/register- Register for eventPOST /api/events/{id}/checkin- Check-in participant
GET /api/projects- Get all projectsPOST /api/projects- Create projectPOST /api/projects/{id}/fund- Fund projectPOST /api/projects/{id}/vote- Vote for project
GET /api/metrics/daily- Get daily metricsGET /api/metrics/monthly- Get monthly metricsGET /api/pdf/metrics- Export metrics PDF
- AMBASSADOR: Community leaders with badges
- DONOR: Organizations providing resources
- CITIZEN: Regular community members
- PARTICIPANT: Event participants with points
- ADMIN: Full system access (moderation, reports, metrics, user management)
- USER: Default at registration; normal authenticated access
# Build
mvn clean install
# Run tests
mvn test
# Run with specific profile
mvn spring-boot:run -Dspring-boot.run.profiles=dev# Build for production
npm run build
# Run tests
npm test
# Lint code
npm run lintDB_PASSWORD: MariaDB passwordJWT_SECRET: JWT signing secretMAIL_USERNAME: Email usernameMAIL_PASSWORD: Email passwordCORS_ALLOWED_ORIGINS: Allowed CORS origins
The application uses JPA/Hibernate with ddl-auto: update for development. The schema includes:
- Users with type-specific fields
- Campaigns with voting and progress tracking
- Events with registration management
- Projects with funding tracking
- Posts with comments and likes
- Impact metrics with automated calculation
- Set up MariaDB server
- Configure production properties
- Build JAR:
mvn clean package - Deploy to server with:
java -jar target/civic-platform-backend-1.0.0.jar
- Build for production:
npm run build - Deploy dist/ folder to web server
- Configure web server for SPA routing
- Fork the repository
- Create feature branch:
git checkout -b feature/amazing-feature - Commit changes:
git commit -m 'Add amazing feature' - Push to branch:
git push origin feature/amazing-feature - Open Pull Request
This project is licensed under the ISC License.
For support and questions, please open an issue in the repository.