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.
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.
- 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.
- Language: Go (Golang)
- Framework: Fiber v2
- Database: SQLite (Production-ready via GORM)
- ORM: GORM
- Auth: Custom Auth (Bcrypt for hashing)
Prerequisites:
- Go 1.21+
- Git
# 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# Run directly
go run main.go
# OR using Air (if installed) for live reload
airThe server will start on http://localhost:3000.
Copy .env.example to .env (if applicable) and configure your variables. See ENVIRONMENT.md for details.
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. |
The API is accessible at http://localhost:3000.
See API_DOCUMENTATION.md for full usage details.
We take security seriously. Please review SECURITY.md for our security policy and reporting instructions.
Distributed under the MIT License. See LICENSE for more information.
Muhammad Dava Fahreza
- GitHub: @MDF05