Skip to content

High-performance API server for VotePeace, powered by Go and Fiber. Handles secure authentication, vote processing, real-time analytics, and data persistence using GORM & SQLite

License

Notifications You must be signed in to change notification settings

MDF05/VotePeace-Backend

VotePeace Backend

VotePeace Backend Status Go Version License

VotePeace-Backend is the robust, high-performance server-side application powering the VotePeace election platform. Built with Go (Golang) and the Fiber framework, it provides a secure REST API for managing campaigns, candidates, and real-time voting data.

🚀 Backend Overview

The backend is designed as a modular monolith, prioritizing performance and simplicity. It handles:

  • User Authentication: Secure registration and login (JWT/Session).
  • Campaign Management: CRUD operations for election campaigns.
  • Vote Processing: Secure and transactional vote recording.
  • Real-time Analytics: Aggregating vote counts and statistics.

✨ Features

  • High Performance: Built on Fiber (Express-inspired) for extreme speed.
  • ORM Integration: Uses GORM for database interactions with SQLite (easily switchable to PostgreSQL/MySQL).
  • RESTful API: Clean, predictable endpoints.
  • Secure: Validation, CORS configuration, and password hashing (bcrypt).
  • Database Seeding: Automatic admin and demo data generation.

🛠 Tech Stack

  • Language: Go (Golang)
  • Framework: Fiber v2
  • Database: SQLite (Production-ready via GORM)
  • ORM: GORM
  • Auth: Custom Auth (Bcrypt for hashing)

📦 Installation

Prerequisites:

# Clone the repository
git clone https://github.com/MDF05/VotePeace-Backend.git

# Navigate to the project directory
cd VotePeace-Backend

# Install dependencies
go mod tidy

🚀 Running the Server

Development Mode

# Run directly
go run main.go

# OR using Air (if installed) for live reload
air

The server will start on http://localhost:3000.

⚙️ Environment Variables

Copy .env.example to .env (if applicable) and configure your variables. See ENVIRONMENT.md for details.

📚 Documentation

Detailed documentation for developers and specific domains:

Document Description
ARCHITECTURE.md System design, folder structure, and data flow.
API_DOCUMENTATION.md Detailed API reference (Endpoints, Requests, Responses).
DATABASE_SCHEMA.md Database models, relationships, and ERD description.
DEPLOYMENT.md Guides for deploying to production.
ENVIRONMENT.md Configuration and environment variable reference.
TESTING.md Running unit and integration tests.
STYLE_GUIDE.md Go coding conventions and best practices.
CONTRIBUTING.md Guidelines for contributing to the project.
SECURITY.md Security policies and vulnerability reporting.
CODE_OF_CONDUCT.md Community standards and expectations.
CHANGELOG.md History of changes and versions.
ROADMAP.md Future features and milestones.
DISCLAIMER.md Legal disclaimers.
LICENSE MIT License terms.

🔑 API Access

The API is accessible at http://localhost:3000. See API_DOCUMENTATION.md for full usage details.

🔐 Security

We take security seriously. Please review SECURITY.md for our security policy and reporting instructions.

📄 License

Distributed under the MIT License. See LICENSE for more information.

👤 Maintainer

Muhammad Dava Fahreza

About

High-performance API server for VotePeace, powered by Go and Fiber. Handles secure authentication, vote processing, real-time analytics, and data persistence using GORM & SQLite

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages