sniperok is a game of rock-paper-scissors.
The application provides user registration and login implemented via supabase. It allows verified user registration/sign-up and login/sign-in via email and also guest login. Guests are users which have limited funtionality.
Registered users can add buddies. Registered users can receive buddy reuests and choose to accept or decline.
Registered players can earn boosts and trade them and use them. Boost types are swappable or playable
- Snaps are swappable
- Shotgun is playable
- Dynamite is playable
- Bazooka is playable
Users can swap 3 Snaps for a Shotgun, Dynamite or Bazooka.
All users can list public games, whether they are registered users, guest users or unauthenticated visitors. Registered and guest users can join public games. Registered users can also see non-public games to which they have been invited, and can choose to join the game. Registered users can create games which they will automatically join and will become the game curator. Registered users can invite their buddies to the game. The game consists of an odd number of rounds. At the end of each round a round summary is displayed showing the users actions and scores. After the last round an additional summary is shown displaying the overall player scores in descending order by score. When a player wins a game i.e. has the single highest overall score and if there are no guest users in the game, then the player wins a boost of type snap. Within the round the curator starts the play which triggers a 3 second countdown for the player to play their weapon,
- Rock
- Paper
- Scissors Normal rules apply i.e. Rock beats Scissors, Scissors beats Paper, Paper beats Rock. If the user has any playable boosts, they can spend them to play
- Shotgun beats Dynamite and Rock and Scissors
- Dynamite beats Bazooka and Rock and Paper
- Bazooka beats Shotgun and Paper and Scissors
- SvelteKit: A framework for building web applications with Svelte
- TypeScript: A typed superset of JavaScript that compiles to plain JavaScript
- Supabase: An open-source Firebase alternative
- Kysely: type-safe SQL query builder for TypeScript
- shadcn-svelte: A Tailwind CSS component library for Svelte, based on shadcn
- Tailwind CSS: A utility-first CSS framework
- Iconify: A unified icon framework using icons from icones.js
- Zod: A TypeScript-first schema declaration and validation library
- socket.io WebSockets, Bidirectional and low-latency communication for every platform
- docker: https://docs.docker.com/desktop/
- supabase cli: https://supabase.com/docs/guides/local-development/cli/getting-started
- node.js: https://nodejs.org/en/download
- pnpm: https://pnpm.io/installation
- Clone the repo
git clone https://github.com/swopsyapp/sniperok.git
cd sniperok- Install dependencies
pnpm i- Create a
.env.localbased on.env.exampleand fill in your own credentials
cp .env.example .env.local- Start your supabase server with
supabase startNote: You need to have the Supabase CLI installed to run the above command.
-
Supabase console will be available at
http://localhost:54323 -
Start your app
pnpm run dev- Navigate to localhost:5173 to see your app running.
The easiest way to deploy this app is to use Vercel. You can deploy this app with the following steps:
-
Create a new project in the Supabase dashboard
-
Login to supabase using the console
supabase login- Link your project to the supabase cli
supabase link --project-ref <YOUR_PROJECT_ID>- Deploy your database
supabase db push- Create a new project on Vercel
- Connect your GitHub repository
- Add a new github OAuth app in the Github developer settings
- Configure your environment variables, make sure you are using updated values from your newly-created Supabase project and Github OAuth app
- Deploy
Contributions are welcome! Please feel free to submit a PR or open an issue.
Shout out to Davis Media for building the base template for this project! 🤙