Trendmall is the frontend of a streamlined full-stack application focused on essential functionalities for an e-commerce system. This frontend service is built using Next.js, Shadcn, and Tailwind, providing functionalities such as product listing, user authentication, and order processing.
Before you begin, ensure you have met the following requirements:
- Node.js (version 18.X.X)
- Yarn (version 4.X.X)
-
Clone the repository:
git clone https://github.com/BRTZL/trendmall-web.git
-
Navigate to the project directory:
cd trendmall-web
-
Install the dependencies:
yarn install
-
Set up the environment variables:
Create a
.env
file in the root directory and add the necessary environment variables as specified in the.env.example
file.
To start the development server, run:
yarn dev
The server will start on http://localhost:3000
.
To build the project for production, run:
yarn build
To generate API types using swagger-typescript-api
, run:
npx swagger-typescript-api -p http://localhost:3001/docs-yaml -o ./src/types -n api.ts --axios
We are using Axios for API integration with bearer authentication.
We are using Shadcn and Tailwind for UI components and styling.
We are using React Query for state management and mutations.
This project uses server-side rendering (SSR) with Next.js to optimize performance and SEO.
To run the unit tests, use the following command:
yarn test
-
Build the Docker image:
docker build -t trendmall-frontend .
-
Run the Docker container:
docker run -p 3000:3000 trendmall-frontend
For detailed deployment guidelines, refer to the Docker documentation.
To contribute to this project, follow these steps:
- Fork the repository.
- Create a new branch (
git checkout -b feature-name
). - Make your changes and commit them (
git commit -m 'Add some feature'
). - Push to the branch (
git push origin feature-name
). - Create a Pull Request.