Welcome to Machu-Piku, a full-stack web application that simulates a bracket-style tournament.
This application allows a user to start a tournament by choosing a concept and the number of contenders. It then repeatedly presents two contenders, allowing the user to vote for their preferred option. This process continues through each round of the bracket until a single winner remains.
The project is still under development. Right now, it only has a tournament for football players, which is what the Machu-Piku team loves!
The application is powered by a Node.js backend using the Express.js framework to serve a RESTful API. All tournament data, image information, and user votes are stored in a Supabase (PostgreSQL) database. The backend handles the core logic for fetching contender pairs (GET /pair), recording votes (POST /vote), and retrieving user voting history (GET /me/votes).
All commands must be run from within the backend folder of the project.
cd backend
Install the required Node.js packages using npm.
npm install
The server needs to connect to a Supabase project.
- Create a file named
.envinside thebackenddirectory. - Copy the following content into your new
.envfile:
SUPABASE_URL=ADD_YOUR_URL
SUPABASE_SERVICE_ROLE_KEY=ADD_YOUR_KEY
PORT=8787
- Replace
ADD_YOUR_URLwith your Supabase project URL. - Replace
ADD_YOUR_KEYwith your Supabase service role key.
Run the start script defined in package.json.
The server will start, and you should see the following message in your console:
API listening on http://localhost:8787
Implement a proper user login system (e.g., email/password or social logins) using Supabase Auth. Replace the simple userId and allow users to save their tournament progress and view their voting history across devices.
Allow authenticated users to create and name their own tournaments, including uploading their own images and contender names.