A containerized community management system that enables members to create and participate in multiple-choice voting, built on the Solana blockchain. This project is configured for a seamless, fully containerized development experience using VS Code Dev Containers.
This repository contains the source code, documentation, and configuration for the application.
The project is currently focused on the Solana smart contract, which serves as the on-chain backend. The development environment is entirely managed by Docker and VS Code Dev Containers, providing a consistent and reproducible setup with all necessary tools pre-installed.
Future services, such as a web frontend and backend API, will be added and integrated into this containerized workflow.
-
Solana Smart Contract (
contracts/voting)- Responsibility: Handles all on-chain logic for community management and voting.
- Technology: Rust, Anchor Framework.
- Development: All development and testing occurs within the provided dev container.
-
Containerized Services
- Backend API: Express.js server handling authentication and data management
- Admin Portal: Next.js application for community administration
- Member Portal: Next.js application for community members
- Supporting Services: PostgreSQL, Redis, and Solana local validator
- Docker Desktop
- Node.js (for local development)
- Clone the repository:
git clone https://github.com/danribes/pfm_solana_rust cd pfm_solana_rust - Start the containerized services:
docker-compose up -d
- Access the applications:
- Backend API: http://localhost:3000
- Admin Portal: http://localhost:3001
- Member Portal: http://localhost:3002
The application uses a microservices architecture with separate containers for each service. All services can be managed using Docker Compose.
All contract-related commands should be run from the contracts/voting directory.
-
Navigate to the contract directory:
cd contracts/voting -
Build the contract:
- This command compiles the Rust code and generates the IDL (Interface Definition Language) and other artifacts.
anchor build
-
Run tests:
- This command starts a local Solana validator, deploys the contract, and runs the TypeScript tests located in
contracts/voting/tests/.
anchor test - This command starts a local Solana validator, deploys the contract, and runs the TypeScript tests located in
The docker-compose.yml file orchestrates all application services:
backend: Express.js API serveradmin-portal: Next.js admin interfacemember-portal: Next.js member interfacepostgres: PostgreSQL databaseredis: Redis cache and session storesolana-local-validator: Solana blockchain node
You can start the services manually if needed:
docker-compose up -dTo stop the services:
docker-compose down- Deployment Guide - Comprehensive deployment procedures for all environments
- Operations Runbook - Daily operations, incident response, and maintenance procedures
- Access & Permissions - User roles, security policies, and access management
- Monitoring & Logging - Observability, metrics, and log analysis procedures
- Database Integration - Database and smart contract integration details
- Middleware Architecture - Redis caching and middleware implementation
- Health Checks:
/healthendpoint available on all services - Metrics: Prometheus metrics at
/metricson backend service - Monitoring: Grafana dashboard at http://localhost:3003 (admin/admin)
- Logs: Centralized logging with Loki at http://localhost:3100