Skip to content

nurzhanova2/voting-blockchain

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Voting Blockchain System 🗳️

A secure blockchain-based voting platform built with Go and PostgreSQL.

Features

  • JWT-based authentication with admin/user roles
  • Election creation by admins
  • Voting with integrity (blockchain-based)
  • Immutable vote chain (one vote per user)
  • Choices per election
  • Token expiration and refresh flow
  • Dockerized environment
  • Unit & integration tests (WIP)
  • Clean Architecture layout

Tech Stack

  • Go
  • PostgreSQL
  • Docker
  • Chi (router)
  • pgx (PostgreSQL driver)
  • golang-migrate (DB migrations)
  • JWT (auth)
  • Clean Architecture principles

API Overview

Method Endpoint Role Required
POST /auth/register -
POST /auth/login -
POST /voting/elections Admin
GET /voting/elections User/Admin
POST /voting/elections/{id}/vote User
GET /voting/elections/{id}/blocks User/Admin
GET /voting/elections/{id}/choices User/Admin
GET /voting/elections/{id}/results User/Admin

Setup

cp .env.example .env
go mod tidy
go run cmd/main.go

About

This project was created for the Blockchain Development Hackathon (July 8–11) with Башня and Singularity, implementing a secure voting system in Go and PostgreSQL with a simplified blockchain to hash, link, and protect votes, featuring JWT authentication, admin election management, and one-vote-per-user restrictions as part of the Secure Blockchain

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors