A competitive cryptography web application where users solve cryptography problems and compete on leaderboards.
Crypto Racer is a platform for cryptography enthusiasts, ARG enthusiasts, and students. Users can create or join lobbies to solve cryptographic puzzles competitively. A leaderboard tracks user progress, highlighting the fastest solvers.
- Competitive cryptography puzzles
- Real-time multiplayer functionality
- Leaderboard with percentile rankings
- User authentication (Google/GitHub sign-in)
- Redis-backed real-time leaderboard
- WebAssembly for faster cryptographic operations
- Frontend: React.js, HTML5, Tailwind CSS
- Backend: Node.js, Express.js
- Database: MongoDB, Redis
- APIs: RESTapi, GraphQL, WebSocket
- Cryptography: WebAssembly, C
- Clone the repository:
git clone https://github.com/pedrocriado/CryptoRace
- Install dependencies:
npm install
- Configure the .env file with necessary variables:
PORT = 1234 MONGO_URL = your-mongodb-url REDIS_URL = your-redis-url AUTH_SECRET = your-secret-key
- Start the development server:
npm start
- Register or log in to your account.
- Create or join a lobby to start solving cryptographic puzzles.
- Compete with other players and track your progress on the leaderboard.
- POST /auth/login: Logs in a user.
- POST /auth/register: Registers a new user.
- POST /auth/logout: Logs out a user.
- DELETE /auth/delete: Deletes the current user. Along with the user, all associated information.
- GET /leaderboard: Retrieves the top 10 leaderboard entries. If the user IS logged in then the user's entrie will be returned. If the user is NOT logged in then the returned user field will be null
- GET /leaderboard/rank: Retrieves the users rank.
- POST /leaderboard/addScore: Registers or Updates users rank. (The score that is being ranked is an average of all the best times)
- POST /lobby/createLobby:
If the user already has an active lobby, they will not be able to create a new one.
The new lobby will have the options of:
- A list of cryptographs
- Name of the lobby
- Player limit
- Whether the lobby is private or not.
- GET /lobby/joinLobby: when clicking on a open lobby, the API will return the 'lobbyId'. If the lobby is private, then it will authenticate the password provided by the user.
- DELETE /lobby/deleteLobby: remove the user's own lobby