Hi there! Even though the "project" and technical stack was created by AI this one paragraph is human-text as you can guess by the way of presenting this information. Nevertheless project was created due to the home assignment and out of my personal curiousity to try to make a "universal" interactive sandboxing tool to visually feel the abstract world of mathematics and Linear Algebra as it is the heart of the tool that actually built whole project. I do get that there are a lot of tools, CAS systems, frameworks that actually do even better, personally I couldn't find any alikes.
Vector Space is an interactive web application designed to visualize and manipulate mathematical objects like vectors, matrices, and points in 2D and 3D space. It provides a dynamic environment for exploring linear algebra concepts, performing transformations, and understanding coordinate systems through an intuitive user interface. Users can define expressions using a custom mathematical syntax, which the application evaluates to render objects and their relationships.
- Interactive 2D/3D Visualization: Manipulate vectors, points, and matrices in real-time.
- Expression Engine: Define and evaluate mathematical expressions to create and modify scene objects.
- Scene Management: Authenticated users can save, load, update, and delete their customized scenes.
- Transformation Tools: Apply linear transformations to objects and change basis vectors.
- Projection Explorer: Explore projections and their effects on objects.
- Notifications: Real-time feedback on operations and errors.
This project adheres to the GRACE methodology for software development, emphasizing a Contract-First approach. This means that architectural decisions and component interfaces are meticulously defined through formal XML contracts (specifically Architecture.xml, DevelopmentPlan.xml, and RequirementsAnalysis.xml) before implementation begins. This strategy is crucial for:
- Preventing "Big Ball of Mud": By establishing clear boundaries and responsibilities early, we avoid an unstructured and unmanageable codebase.
- Mitigating "Architectural Drift": The contracts serve as a single source of truth, ensuring that implementation remains aligned with the intended design and preventing deviations over time.
- Formal Verification: Adherence to these contracts provides a form of formal verification, ensuring the system's components integrate as designed and fulfill their specified roles, directly referencing principles discussed in software architecture lectures.
- React: A JavaScript library for building user interfaces.
- TypeScript: A strongly typed superset of JavaScript.
- Zustand: A small, fast, and scalable bear-bones state-management solution.
- KaTeX: Fast math typesetting for the web.
- Konva.js: For 2D canvas drawing.
- Three.js: For 3D rendering.
- Vite: A fast build tool.
- Node.js: A JavaScript runtime built on Chrome's V8 JavaScript engine.
- Express.js: A minimal and flexible Node.js web application framework.
- TypeScript: For type-safe backend development.
- Prisma: A next-generation ORM for Node.js and TypeScript.
- PostgreSQL: A powerful, open source object-relational database system.
- JWT (JSON Web Tokens): For secure authentication.
- Docker: For containerization of the application services.
- Docker Compose: For defining and running multi-container Docker applications.
- GitHub Actions: Implemented for Continuous Integration (CI) to automate testing and linting on every push.
- Docker and Docker Compose installed on your machine.
- Node.js and npm (or yarn) if you plan to develop the frontend or backend outside of Docker.
-
Clone the repository:
git clone [your-repository-url] cd VectorSpace -
Configure Environment Variables: Create a
.envfile in the root directory of the project (wheredocker-compose.ymlis located) with the following content:DB_USER=your_db_user DB_PASSWORD=your_db_password DB_NAME=your_db_name JWT_SECRET=a_very_secret_key_for_jwt_signingReplace
your_db_user,your_db_password,your_db_name, anda_very_secret_key_for_jwt_signingwith strong, unique values. -
Build and Start Services: From the root directory, run:
docker-compose up --build
This command will:
- Build the Docker images for the backend API and frontend.
- Start the PostgreSQL database, backend API, and frontend services.
- The backend API will be available at
http://localhost:3000. - Access API documentation at
http://localhost:3000/api-docs. <<<<<<< HEAD - The frontend will be available at
http://localhost:8080. ======= - The frontend will be available at
http://localhost:5173.
b1965e62d0481f392bc3b7496c157a86a13ad9cb
-
Database Migrations (First Run): After the services are up and running for the first time, you'll need to apply database migrations. Open a new terminal in the project root and run:
docker-compose exec api npx prisma migrate dev --name initFollow any prompts. This will create the necessary tables in your PostgreSQL database.
-
Access the Application: Open your web browser and navigate to
http://localhost:5173.
If you wish to develop the frontend outside the Docker container (e.g., for hot-reloading):
- Install dependencies:
cd frontend # Assuming your frontend is in a 'frontend' directory, adjust if different npm install
- Start the development server:
The frontend will typically run on
npm run dev
http://localhost:5173. Ensure your backend is running (either via Docker Compose or separately).
If you wish to develop the backend outside the Docker container:
- Install dependencies:
cd backend npm install - Set up database (if not using Docker Compose for DB):
Ensure you have a PostgreSQL database running and update the
DATABASE_URLin your backend's.envfile or directly inprisma/schema.prisma. - Run migrations:
npx prisma migrate dev --name init
- Start the development server:
The backend will typically run on
npm run dev
http://localhost:3000.
backend/: Contains the Node.js/Express.js API.src/: Contains the React frontend application.docker-compose.yml: Defines the multi-container Docker application.README.md: This file....(other configuration files and assets)
Contributions are welcome! Please create issue and submit pull requests.