1. 🎉 Introduction
Aug 23, 2016 Toko Online Sederhana berbasis Code Igniter. Contribute to putuyoga/olshop development by creating an account on GitHub.
Randomly connect to a player around the world and challenge him/her. Remember not to blink!
For full version of demo video, click here.
2. 📜 Implementation
1. Project structure
We use
react
as our frontend framework, and use peerjs
to communicate between clients. At backend, we use flask
to host the server. For connection between clients and server, we use socketio
to implement real-time data transfer.2. Game State
We use the notion of Finite State Machine to design our game state. The circle is the state. The text in the top of each box is the event causing state transition, and the text in the bottom of each box is the action taken when event occurs. The logic looks quite simple here, but it is not that easy to implement. For more detail you can check play.jsx or server.py.
3. 💻 Development
I spent lots of time formatting my code and writing comments to make it as readable as possible. Hope you enjoy 😊
- Clone this repo.
- Install the packages
- Build and Run
Every time you changed your code, you should run the above command again. We do not support hot module replacement now.
- Start and Enjoy
Goto
https://0.0.0.0:3000
0.0.0.0:3000
does not work, remember to add https
.4. 🚧 Problem
- Because the detector is too slow and weak, we can not endure too many clients. Therefore, we do not deploy it to a public server now. We plan to train a robust and fast model in the future.
- When restarting, the old media connection listener will be called again. So we remove restart temporarily.
5. 📖 Reference
- Environment setup: https://github.com/rwieruch/minimal-react-webpack-babel-setup
- Simple P2P WebRTC package: https://github.com/peers/peerjs
- Socket-io: https://socket.io/docs/client-api/
- Flask-socketio: https://flask-socketio.readthedocs.io/en/latest/
- Blink detector: https://github.com/dilawar/eye-blink-detector
- Material UI: https://material-ui.com/
6. 🗞ï¸x8F License
About Laravel
Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experience to be truly fulfilling. Laravel takes the pain out of development by easing common tasks used in many web projects, such as:
- Simple, fast routing engine.
- Powerful dependency injection container.
- Multiple back-ends for session and cache storage.
- Expressive, intuitive database ORM.
- Database agnostic schema migrations.
- Robust background job processing.
- Real-time event broadcasting.
Laravel is accessible, powerful, and provides tools required for large, robust applications.
Learning Laravel
Laravel has the most extensive and thorough documentation and video tutorial library of all modern web application frameworks, making it a breeze to get started with the framework.
If you don't feel like reading, Laracasts can help. Laracasts contains over 1100 video tutorials on a range of topics including Laravel, modern PHP, unit testing, and JavaScript. Boost you and your team's skills by digging into our comprehensive video library.
Laravel Sponsors
We would like to extend our thanks to the following sponsors for funding Laravel development. If you are interested in becoming a sponsor, please visit the Laravel Patreon page.
Contributing
Thank you for considering contributing to the Laravel framework! The contribution guide can be found in the Laravel documentation.
Security Vulnerabilities
If you discover a security vulnerability within Laravel, please send an e-mail to Taylor Otwell via [email protected]. All security vulnerabilities will be promptly addressed.
License
The Laravel framework is open-source software licensed under the MIT license.