A decentralized social network for researchers to self-organize and collaborate through democratic governance structures.
CSDC (Computer Science Democratic Collective) is a social network platform designed to enable researchers to form self-organized structures through democratic processes. The platform combines social networking with democratic governance tools, allowing people to form units (organizations) and create hierarchical relationships through voting mechanisms.
- User registration and authentication
- Personal profiles with name, description, and image
- Profile management and updates
- Create and manage organizational units
- Each unit has a chairperson and membership system
- Units can form hierarchical relationships (parent/child units)
- Democratic governance with voting systems
- Two voting systems:
- Simple Majority: Traditional majority vote
- Majority Consensus: Advanced majority judgment with grades (Excellent, Very Good, Good, Acceptable, Bad, Very Bad)
- Visible or secret voting options
- Automated election result computation
- Forum: Discussion threads and posts within units
- Invitations: Invite people to join units
- Submissions: Request to create unit relationships
- Message system with Accept/Reject replies
- Email notifications and templates
- File storage and sharing within units
- IPFS integration for decentralized file storage
- Image upload and management
- JWT-based authentication
- Password hashing with bcrypt
- Session management
The project consists of three main components:
- csdc-api: REST API server with Servant framework
- csdc-base: Core types and shared utilities
- PostgreSQL database with migrations
- IPFS integration for decentralized file storage
- csdc-gui: Single-page application built with Elm
- Responsive web interface for all platform features
- Real-time updates and interactive forms
- Docker Compose for local development (PostgreSQL + IPFS)
- Nix for dependency management
- Fly.io deployment configuration
Install Nix for dependency management:
curl -L https://nixos.org/nix/install | sh-
Enter development environment:
nix-shell
-
Start infrastructure services:
make docker
-
Build the frontend:
make gui-build
-
Start the server:
make serve
The application will be available at http://localhost:8080.
View all available commands:
make helpKey development targets:
make ghcid-api- Live Haskell development for APImake ghcid-server- Live Haskell development for servermake gui-build- Build Elm frontendmake psql- Connect to development databasemake format-haskell- Format Haskell code
The first time, deploy the database and ipfs service with:
make docker
First, make sure the GUI is built with:
make gui-build
Finally, run:
make serve
and the server should be available at localhost:8080.
Make sure to create an account with access to the free tier.
The following commands should be executed inside the Nix shell, by running
nix-shell before starting.
First, to login, run:
$ flyctl auth loginThen, the Postgres database must be created:
$ flyctl postgres createThis command will show the credentials, which should be saved in a secrets.json file as:
{
"pgstring": "postgresql://user:password@host:port"
}Finally, create your app:
$ flyctl launchIn this step you will choose the app name, which will determine its URL. This name should be used for the tag-and-push-image
In the following, the app name will be called $APP_NAME.
Make dure the image is in the fly.toml configuration file:
[build]
image = "registry.fly.io/$APP_NAME:latest"Save this name in the secrets.json file:
{
"app_name": "$APP_NAME",
"pgstring": "postgresql://user:password@host:port"
}Once more, all commands should be run inside the Nix shell, by running
nix-shell before starting.
First, build the docker image and load it:
$ just build-and-load-imageTag the image conveniently, and push it:
$ just tag-and-push-image $APP_NAMEAnd finally, deploy:
$ just deploy $APP_NAME