Go to file
2024-03-25 10:00:47 +00:00
.vscode new catchers for 404 errors 2024-03-21 17:47:17 +00:00
about open_evening_2 2023-10-17 15:15:41 +01:00
database Changed to separate page structure & api updates 2024-03-25 09:40:43 +00:00
documentation Changed to separate page structure & api updates 2024-03-25 09:40:43 +00:00
public Changed to separate page structure & api updates 2024-03-25 09:40:43 +00:00
scripts open_evening_2 2023-10-17 15:15:41 +01:00
src Changed to separate page structure & api updates 2024-03-25 09:40:43 +00:00
.env.example Added ReadMe and LICENSE FILES, Started Documentation 2024-03-20 17:16:15 +00:00
.gitignore added rocket.toml.example 2024-03-21 17:59:00 +00:00
Cargo.toml migrated database to sqlite 2023-09-04 16:53:09 +01:00
Dockerfile open_evening_2 2023-10-17 15:15:41 +01:00
LICENSE Added ReadMe and LICENSE FILES, Started Documentation 2024-03-20 17:16:15 +00:00
ReadMe.md Changed to separate page structure & api updates 2024-03-25 09:40:43 +00:00
Rocket.toml open_evening_2 2023-10-17 15:15:41 +01:00
Rocket.toml.example added rocket.toml.example 2024-03-21 17:59:00 +00:00
TODO.md Added ReadMe and LICENSE FILES, Started Documentation 2024-03-20 17:16:15 +00:00
wordlist.txt added colorschemes 2022-12-01 14:41:14 +00:00

Touch Typing Website - My Computer Science Coursework

Overview

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.

Features

  • 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.

Setup

Note

You will need to have Rust and sqlite installed

  1. Clone the repository: git clone https://github.com/ArloFilley/cs_coursework
  2. Navigate to the project directory: cd cs_coursework
  3. Install dependencies: cargo build

Usage

  1. Start the server: cargo run
  2. By Default the server runs on http://localhost:8000 This can be changed by creating a Rocket.toml file
  3. 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

  1. 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
    • Test-related endpoints:
      • Create test: POST /api/post_test
      • New test: GET /api/new_test

Dependencies

  • Rocket: Web framework for Rust.
  • Serde: Serialization and deserialization library for Rust.
  • SQLX: SQLite database driver for Rust.
  • Rand: Random number generation library for Rust.

Contributors

License

This project is licensed under the MIT License.