Helix Home is a web application built with a React frontend and a Rails backend. The application allows users to manage products and accounts, featuring CSRF protection and a modern development workflow.
- Product Management: Create, read, update, and delete products.
- Account Management: Create, read, update, and delete accounts.
- CSRF Protection: Secure application with CSRF tokens.
- Node.js
- Yarn or npm
- Ruby
- Rails
- PostgreSQL (or your preferred database)
-
Clone the repository:
git clone https://github.com/mklemos/Ruby-ERM-test.git cd Ruby-ERM-test/helix-home-backend
-
Install dependencies:
bundle install
-
Set up the database:
rails db:create rails db:migrate
-
Run the Rails server:
rails server
-
Navigate to the frontend directory:
cd ../helix-home-frontend
-
Install dependencies:
yarn install # or npm install
-
Start the React development server:
yarn start # or npm start
helix-home/
├── helix-home-backend/ # Rails backend
│ ├── app/
│ ├── config/
│ ├── db/
│ └── ...
├── helix-home-frontend/ # React frontend
│ ├── public/
│ ├── src/
│ │ ├── components/
│ │ ├── axiosConfig.js
│ │ └── ...
│ └── ...
GET /products
- Retrieve all productsGET /products/:id
- Retrieve a specific productPOST /products
- Create a new productPUT /products/:id
- Update a productDELETE /products/:id
- Delete a product
GET /accounts
- Retrieve all accountsGET /accounts/:id
- Retrieve a specific accountPOST /accounts
- Create a new accountPUT /accounts/:id
- Update an accountDELETE /accounts/:id
- Delete an account
The application includes CSRF protection by setting a CSRF token in the cookies and including it in each request's headers. This ensures that only legitimate requests from authenticated users are processed by the server.
- Fork the repository.
- Create a new branch (
git checkout -b feature-branch
). - Make your changes.
- Commit your changes (
git commit -am 'Add new feature'
). - Push to the branch (
git push origin feature-branch
). - Create a new Pull Request.
This project is licensed under the MIT License.