This project is a web server built using the Rocket framework in Rust. It provides APIs for interacting with a database and serves Javascript for the front-end of the website.
- User Authentication: Users can sign up, login, and access their tests from anywhere they can access the server.
- Test Management: Allows users to create tests and retrieve their test data.
- Leaderboard: Provides a leaderboard of users based on their test performance.
Note
You will need to have Rust and sqlite installed
- Clone the repository:
git clone https://github.com/ArloFilley/cs_coursework - Navigate to the project directory:
cd cs_coursework - Install dependencies:
cargo build
- Start the server:
cargo run - By Default the server runs on
http://localhost:8000This can be changed by creating aRocket.tomlfile - Front end will be acessible through
http://url/typing/
Caution
The hashing algorithm used by this project is a basic one and should not be considered safe enough to use any password that is used on another site. Proceed at your own risk
- Access the API endpoints:
- User-related endpoints:
- Sign up:
POST /api/create_user - Login:
GET /api/login/<username>/<password> - Get user tests:
GET /api/get_tests/<user_id>/<secret> - Leaderboard:
GET /api/leaderboard
- Sign up:
- Test-related endpoints:
- Create test:
POST /api/post_test - New test:
GET /api/new_test
- Create test:
- User-related endpoints:
- Rocket: Web framework for Rust.
- Serde: Serialization and deserialization library for Rust.
- Rusqlite: SQLite database driver for Rust.
- Rand: Random number generation library for Rust.
This project is licensed under the MIT License.