A web application to simulate an online store for buying Materia, inspired by Final Fantasy 7.
- Project Title
This web application is built to simulate an online store for buying Materia, the magic orbs from Final Fantasy 7. Users can:
- Select one of 10 characters from the game.
- Browse and add Materia (over 20 types) to their cart.
- View detailed descriptions of Materia items.
- Enter credit card information (sandbox environment, no real transactions).
- Accept terms and conditions required by Colombian authorities.
- View a summary of the order, including price, order number, and payment status.
- Return to the homepage after completing the purchase.
- User-friendly shopping cart for Materia items.
- Sandbox payment processing.
- Final Fantasy 7-inspired UI and UX.
- Responsiveness across devices.
- Secure and efficient backend built with Nest.js.
- Integration with the WOMPI API for payment processing.
- React: For building the user interface.
- SASS: For styles.
- Jest: For unit testing.
- React Router: For navigation and routing.
- React Query: For HTTP requests.
- Redux: For state management.
- Nest.js: To handle user, product, payment, and order logic.
- DynamoDB: For database management.
- Jest: For unit testing.
- GET /users: Fetches all users. Returns a list of user objects.
- GET /users/:id: Fetches a single user by their ID. Returns the user object.
- GET /products: Fetches all products. Returns a list of product objects.
- GET /products/:id: Fetches a single product by its ID. Returns the product object.
- PATCH /products: Updates product stock. Accepts a list of updates (product ID, stock variation, and operation type). Returns the updated product objects. Used to update the stock of each product after a complete purchase.
- GET /orders: Fetches all orders. Returns a list of order objects.
- GET /orders/:id: Fetches a single order by its ID. Returns the order object.
- POST /orders: Creates a new order. Accepts an order object. Returns the created order.
- PATCH /orders/:id: Updates an existing order. Accepts an order ID and a partial order object. Returns the updated order.
- GET /payments/:id: Fetches a payment by its ID. Returns the payment object.
- POST /payments: Creates a new payment. Accepts a payment object. Returns the created payment.
The project follows a hexagonal architecture, ensuring modularity and independence between frontend, backend, and database layers. It is hosted on AWS with the following stacks:
-
Serverless Stack:
- Lambda function hosting the NestJS backend.
- API Gateway for exposing backend endpoints.
- DynamoDB tables for users, products, orders, and payments.
- Execution roles for secure communication between Lambda and DynamoDB.
-
CICD Stack:
- CodePipeline for CI/CD, triggered by commits to the master branch.
- Integration with AWS Secrets Manager for secure GitHub connections.
- Steps for compilation, unit tests, code linting, and deployment.
- S3 bucket for frontend hosting with a CloudFront distribution.
- Automatic CloudFront cache invalidation to ensure users see the latest updates.
The payments module interacts with the WOMPI API to process transactions:
- The frontend sends the following to the backend:
- Tokenized credit card.
- Acceptance tokens for terms and conditions.
- The backend creates a payment source and initiates a transaction.
- The backend monitors the transaction status (e.g., APPROVED, PENDING) and returns results to the frontend.
The application uses DynamoDB with four main tables:
id
(UUID4)email
name
portrait
(S3 object address)
id
(UUID4)description
materia_type
(MAGIC, INDEPENDENT, SUPPORT, SUMMON, COMMAND)name
picture
(S3 object address)price
stock_amount
id
(UUID4)acceptance_token
acceptance_auth_token
address
content
(list of product items)creation_date
order_status
(COMPLETED, CANCELLED, PENDING, FAILED)payment_method
total_order_price
user_id
id
(UUID4)acceptance_token
acceptance_auth_token
customer_email
order
(Order ID)payment_amount
payment_status
(PENDING, APPROVED, FAILED)tokenized_credit_card
wompiTransactionId
- Slower response times during Lambda cold starts.
- Cost-effective as Lambda runs only when needed.
- Inspired by the menus and aesthetics of Final Fantasy 7.
- Fonts, colors, icons, and sounds reflect the original game.
- Testing suggests APPROVED transactions only work within Colombia.
- Future updates will aim for broader international usability.
- Independent layers for frontend, backend, and database.
- Minimal interdependency among modules, except for orders and payments.
- Payment processing uses a step-by-step pipeline for predictable outcomes.
- Frontend unit testing:
- Backend unit testing:
Contributions are welcome! Please follow these steps:
- Fork the repository.
- Create a feature branch:
git checkout -b feature/your-features
- Commit your changes:
git commit -m "Add your message here"
- Push to the branch:
git push origin feature/your-feature
- Open a Pull Request.
This project is licensed under the MIT License.
Feel free to dive into the application and share your feedback! This project reflects my recently discovered passion for Final Fantasy 7 and my passion for software development. Every aspect of it, from the design to the functionality, has been crafted with care and enthusiasm to bring the best experience for the users. Enjoy!