Skip to content
Β 
Β 

Latest commit

Β 

History

737 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Participium πŸ“‹

Participium Logo

Participium is an integrated platform for managing and monitoring civic participation reports. It enables citizens to report issues, facilitating communication between public administrators and the community.


πŸ“‘ Table of Contents


🎯 Getting Started

Access Credentials

Use these credentials to access Participium based on your role:

Role Username Email Password Access Level
Citizen mneri mneri@team4.it citizenTeam4 βœ… Full
Technical Officer mcurie mcurie@team4.it tOfficerTeam4 βœ… Full
Public Relations Officer arossi arossi@team4.it PrOfficerTeam4 βœ… Full
External Maintainer everdi everdi@team4.it extMaintWithTeam4 βœ… Limited
Administrator admin - adminTeam4 βœ… Full

User Roles & Permissions

Each role in Participium has specific rights and responsibilities:

πŸ‘€ Citizen

  • What you can do:
    • ✏️ Create new reports and issues
    • πŸ‘οΈ View your reports and their status
    • πŸ’¬ Add notes to your reports
    • πŸ“² Receive notifications via Telegram (if connected)

πŸ› οΈ Technical Officer

  • What you can do:
    • βœ… Approve/Reject technical reports
    • πŸ‘οΈ View all pending reports
    • πŸ“ Add technical notes
    • πŸ“Š Manage report classification (category, location)

πŸ“’ Public Relations Officer

  • What you can do:
    • βœ… Approve/Reject reports for communication
    • πŸ’Œ Manage citizen communication
    • πŸ“‹ View all report statuses
    • πŸ“ Fill in decisions and reasoning

🏒 External Maintainer

  • What you can do:
    • πŸ‘οΈ View only assigned reports
    • πŸ“ Add technical notes
    • βœ… Mark completion of actions

πŸ”‘ Administrator

  • What you can do:
    • πŸ”§ Configure users and roles
    • πŸ“Š View global statistics
    • βš™οΈ Manage system settings

Main Features

πŸ“ Report Creation

  1. Select the category of the issue (e.g., "Roads", "Lighting")
  2. Choose the location on the map
  3. Add photos and description
  4. Submit β€” the report will be tracked automatically

πŸ“Š Status Tracking

Each report has a clear status:

  • 🟑 Pending - Awaiting review
  • 🟒 Approved - Accepted, in progress
  • πŸ”΄ Rejected - Rejected with reason
  • βœ… Completed - Resolved

πŸ’¬ Notes System

  • Add private comments to reports
  • See all actions taken
  • Track complete history

Telegram Bot

Connect your Participium account to Telegram to receive real-time notifications:

  1. Open the Participium Telegram bot
  2. Start the conversation (/start)
  3. Link your account
  4. You'll receive notifications when:
    • ✏️ You create a report
    • βœ… A report is approved
    • πŸ”΄ A report is rejected
    • πŸ’¬ You receive a new comment

Quick Start

  1. Clone the repository:
git clone https://github.com/Skeitt/Participium.git
cd Participium
  1. Set up environment variables:

    • Copy .env.example to .env in the root (or create .env manually) and fill in the required values (e.g. BOT_TOKEN, DATABASE_URL, etc.).
    • The Docker Compose file will automatically load variables from .env in the current directory.
  2. Start all services with Docker Compose:

docker compose pull
docker compose up -d

To use a custom .env file (e.g., .env.prod):

docker compose --env-file .env.prod up -d
  1. Verify that the containers are running:
docker ps
  1. Access the application:

Available Services

Service Port Description
participium 3000 Web application
telegram_bot - Bot (isolated environment)
db 5432 Main Database
test_db 5433 Test Database

Main Environment Variables

# Database
DATABASE_URL=postgresql://user:password@db:5432/participium
TEST_DATABASE_URL=postgresql://user:password@test_db:5433/participium_test

# Telegram Bot
BOT_TOKEN=your_telegram_bot_token_here
BOT_ADMIN_ID=your_admin_telegram_id

# Application
NEXTAUTH_SECRET=your-secret-key
NEXTAUTH_URL=http://localhost:3000

Deploy with Docker Hub

To run Participium using pre-built images from Docker Hub:

docker run -d --name participium \
  --env-file .env \
  -p 3000:3000 \
  skeitt/participium-team-4:latest

docker run -d --name participium_bot \
  --env-file .env \
  skeitt/participium-team-4-bot:latest

Make sure you have a .env file in the current directory with all required variables.


πŸ› οΈ Technical Setup & Deployment

Technology Stack

Frontend & Backend:

  • Next.js 14 (App Router)
  • TypeScript
  • Prisma ORM
  • PostgreSQL

Telegram Bot:

  • Node.js + Telegraf
  • TypeScript

Infrastructure:

  • Docker & Docker Compose
  • CI/CD with GitHub Actions

Project Structure

participium-team-4/
β”œβ”€β”€ participium/                # Next.js Frontend + Backend API
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ app/               # Next.js app router
β”‚   β”‚   β”œβ”€β”€ components/        # React components
β”‚   β”‚   β”œβ”€β”€ lib/
β”‚   β”‚   β”‚   β”œβ”€β”€ controllers/   # HTTP controllers
β”‚   β”‚   β”‚   β”œβ”€β”€ services/      # Business logic
β”‚   β”‚   β”‚   β”œβ”€β”€ repositories/  # Data access
β”‚   β”‚   β”‚   β”œβ”€β”€ dtos/          # Zod schemas
β”‚   β”‚   β”‚   └── utils/         # Utility functions
β”‚   β”‚   └── types/             # TypeScript types
β”‚   β”œβ”€β”€ prisma/
β”‚   β”‚   β”œβ”€β”€ schema.prisma      # Database schema
β”‚   β”‚   └── migrations/        # DB migrations
β”‚   └── package.json
β”‚
β”œβ”€β”€ bot/                        # Telegram Bot
β”‚   β”œβ”€β”€ bot.ts                 # Entry point
β”‚   β”œβ”€β”€ handlers/              # Command handlers
β”‚   β”œβ”€β”€ dtos/                  # DTOs
β”‚   β”œβ”€β”€ utils/                 # Utilities
β”‚   β”œβ”€β”€ package.json
β”‚   └── jest.config.js
β”‚
β”œβ”€β”€ docker-compose.yml         # Service orchestration
└── README.md

Database

Managed by Prisma with automatic migrations:

# Generate/apply migrations
npx prisma migrate dev --name add_feature

# Seed test data
node prisma/admin.ts
node prisma/citizen.ts

# View database
npx prisma studio

Data is persisted via Docker volumes (pgdata and pgdata_test).


πŸ‘¨β€πŸ’» For Developers

Clone and Local Setup

git clone https://github.com/Skeitt/Participium.git
cd Participium

# Install dependencies
cd participium && npm install && cd ..
cd bot && npm install && cd ..

# Setup environment
cp .env.example .env
# Edit .env with your values

Development in Watch Mode

# Terminal 1: Backend + Frontend (Next.js)
cd participium
npm run dev

# Terminal 2: Bot (Telegram)
cd bot
npm run dev

# Terminal 3: Database with Prisma Studio
cd participium
npx prisma studio

Testing

# Backend API tests
cd participium
npm run test

# Bot tests
cd bot
npm run test

# Test coverage
npm run test:coverage

Production Build

# Build Next.js
cd participium
npm run build
npm run start

# Build Bot
cd bot
npm run build
npm start

Build & Push Docker Images

For multi-platform build (amd64 + arm64):

# Setup builder
docker buildx create --use --name participium-builder

# Build backend
cd participium
docker buildx build --platform linux/amd64,linux/arm64 \
  -t your_username/participium:latest --push .

# Build bot
cd bot
docker buildx build --platform linux/amd64,linux/arm64 \
  -t your_username/participium-team-4-bot:latest --push .

Replace your_username with your Docker Hub username.


Last Updated: March 2026
Repository: Skeitt/Participium

About

Participium is a civic issue reporting platform with a web backend and Telegram bot, developed as a course project for Software Engineering 2 at the Polytechnic University of Turin.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages