- Introduction
- Features
- Demo
- Technologies Used
- Getting Started
- Project Structure
- API Endpoints
- Contributing
- License
- Contact
The Approval Voting System is a web application that allows users to create and participate in approval voting pools. It provides a fair and transparent platform for community decision-making by enabling users to vote on various initiatives and candidates.
- Create Pools: Administrators can create new voting pools with a name, description, and list of candidates.
- View Pools: Users can browse available pools and view details, including candidates and descriptions.
- Candidate Profiles: Detailed profiles for each candidate, including affiliations and external links.
- Dynamic Images: Automatically generated images for pools and candidates using Next.js OG.
- Responsive Design: Built with Tailwind CSS for a responsive and modern user interface.
- Error Handling: Custom error and not-found pages for enhanced user experience.
- Next.js: React framework for building server-side rendered applications.
- TypeScript: Strongly typed programming language that builds on JavaScript.
- Tailwind CSS: Utility-first CSS framework for rapid UI development.
- Next.js OG: Open Graph image generation for dynamic image creation.
- Husky: Git hooks management.
- Prettier: Code formatter.
- ESLint: Linting utility for JavaScript and TypeScript.
- Node.js (v14 or later)
- npm or Yarn
-
Clone the repository:
git clone https://github.com/marc-aurele-besner/approval-voting-web.git cd approval-voting-web
-
Install dependencies:
npm install # or yarn install
-
Set Environment Variables:
Create a
.env
file in the root directory and add the following:NEXT_PUBLIC_URL=http://localhost:3000
-
Development Mode:
npm run dev # or yarn dev
Open http://localhost:3000 in your browser to see the application.
-
Production Build:
npm run build npm start # or yarn build yarn start
-
GET
/api/pools
- Description: Fetch all available pools.
- Response:
{ "pools": [/* Array of Pool Objects */] }
-
POST
/api/pools
- Description: Create a new pool.
- Request Body:
{ "poolName": "String", "description": "String", "candidates": [/* Array of Candidate Objects */] }
- Response:
{ "success": true, "pool": {/* New Pool Object */} }
-
GET
/api/pools/[poolId]
- Description: Fetch a specific pool by ID.
- Response:
{ "pool": {/* Pool Object */} }
-
DELETE
/api/pools/[poolId]
- Description: Delete a specific pool by ID.
- Response:
{ "message": "Pool deleted successfully" }
-
GET
/api/candidates
- Description: Fetch all unique candidates across pools.
- Response:
{ "candidates": [/* Array of Candidate Objects */] }
-
GET
/api/candidates/[candidateId]
- Description: Fetch a specific candidate by ID, including associated pools.
- Response:
{ "candidate": {/* Candidate Object */}, "pools": [/* Array of Pool Objects */] }
Contributions are welcome! Please follow these steps:
-
Fork the repository.
-
Create a new branch:
git checkout -b feature/YourFeature
-
Commit your changes:
git commit -m "Add your message"
-
Push to the branch:
git push origin feature/YourFeature
-
Open a Pull Request.
This project is licensed under the MIT License.
For any questions or feedback, please contact Marc-Aurele Besner or open an issue on the GitHub repository.