This project is a web application designed to help users learn and practice Ohms Law and power equations. It consists of a backend API server and a frontend user interface, built with modern web technologies.
The application is divided into two main parts:
- Backend API Server (Rust/Rocket.rs): A robust and efficient server that generates exercises based on Ohms Law and power equations.
- Frontend UI (Vuetify/Vue3/TypeScript): A user-friendly and responsive interface that interacts with the backend API, providing an interactive learning experience. The frontend also showcases the use of internationalization (i18n) features within the Vue framework.
- Exercise Generation: Dynamically generates a variety of exercises related to Ohms Law and power equations.
- Interactive UI: Provides a seamless and engaging user interface for solving exercises.
- Multilingual Support: Demonstrates i18n capabilities, making the application accessible to a wider audience.
- Backend:
- Rust: A systems programming language that runs blazingly fast, prevents segfaults, and guarantees thread safety.
- Rocket.rs: A web framework for Rust that makes it simple to write fast web applications without sacrificing flexibility or type safety.
- Frontend:
- Vue.js (v3): A progressive JavaScript framework for building user interfaces.
- Vuetify: A Material Design component framework for Vue.js.
- TypeScript: A typed superset of JavaScript that compiles to plain JavaScript.
- Vue i18n: Internationalization plugin for Vue.js.
Before you begin, ensure you have met the following requirements:
- Rust and Cargo installed. You can install them from the official Rust website.
- Node.js and npm installed. You can download them from the official Node.js website.
To get a local copy up and running, follow these simple steps:
-
Navigate to the backend directory at the repository root.
-
Build and run the project using Cargo:
cargo run
The server will start on the default Rocket port (8000).
-
Navigate to the frontend directory:
cd frontend -
Install the dependencies:
npm install
-
Start the development server:
npm run serve
The application will be available at
http://localhost:3000/(or another port if 3000 is in use).
Once both the backend and frontend are running, open your web browser and go to http://localhost:3000/ (or the port where the frontend is running). You can now start interacting with the application, solving exercises, and exploring the i18n features.
The frontend server proxies all /api/* calls to the backend at port 8000.
In production/release mode the Rocket web server serves the frontend files (built with npm run build) from a folder configurable via environment variable PUIMURI_FRONTEND_DIR, but by default from ./static/.
See Dockerfile for an example of this.
Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Distributed under the MIT License. See LICENSE for more information.
Antti Peltonen - bcow@iki.fi
Project Link: https://github.com/braincow/puimuri-trainer