Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
evdmatvey committed Jul 10, 2024
1 parent 9912f10 commit d768d9d
Show file tree
Hide file tree
Showing 26 changed files with 1,131 additions and 506 deletions.
3 changes: 3 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
extends: ['plugin:@typescript-eslint/recommended', 'next/core-web-vitals'],
};
3 changes: 0 additions & 3 deletions .eslintrc.json

This file was deleted.

52 changes: 52 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: CI

on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]

jobs:
format:
name: Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '20'
- run: npm i
- run: npm run format

lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '20'
- run: npm i
- run: npm run lint

build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '20'
- run: npm i
- run: npm run build

check-for-errors:
name: Check for Errors
needs: [lint, format, build]
runs-on: ubuntu-latest
if: ${{ failure() }}
steps:
- run: exit 1
2 changes: 2 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
npm lint
npm run format
21 changes: 21 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"printWidth": 80,
"tabWidth": 2,
"trailingComma": "all",
"singleQuote": true,
"semi": true,
"endOfLine": "auto",
"importOrder": [
"<THIRD_PARTY_MODULES>",
"^@/pages/(.*)$",
"^@/widgets/(.*)$",
"^@/features/(.*)$",
"^@/entities/(.*)$",
"^@/shared/(.*)$",
"^[../]",
"^[./]"
],
"importOrderSeparation": false,
"importOrderSortSpecifiers": true,
"plugins": ["@trivago/prettier-plugin-sort-imports"]
}
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 Matvey Evdokimov

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
79 changes: 55 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,40 +1,71 @@
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).
# ecommerce-frontend

## Getting Started
<p align="center">
<img src="https://i.ibb.co/TBM45pT/logo.png" alt="logo">
</p>

First, run the development server:
<p align="center">
<img src="https://img.shields.io/badge/Framework-next-blue%3Fstyle%3Dflat" alt="Framework-next"/>
<img src="https://img.shields.io/badge/Version-0.0.1-purple?style=flat" alt="Version-0.0.1"/>
<img src="https://img.shields.io/badge/License-MIT-green?style=flat" alt="License-MIT"/>
</p>

## About

Frontend part of the e-commerce app. Authorization and registration are supported, along with the ability to add items to a wishlist or cart, create an order and follow its delivery status, manage items by categories and filter them based on a variety of criteria, and manage many parts of application through the admin panel (like adding new brands / products / categories / etc.).

The figma layout of the application was found in the public domain. [The figma layout](https://www.figma.com/community/file/1376901695536369893)

## Technologies

- Next.js (14)
- Next-intl
- Redux toolkit (4.5.4)
- Axios (1.7.2)
- React hook form (7.52.0)

## Environment

- Node 20.14.0
- npm 10.7.0

## Common setup

Clone the repo and install the dependencies.

```bash
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev
```
git clone https://github.com/evdmatvey/ecommerce-frontend.git
cd ecommerce-frontend
```

Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
```
npm install
```

You can start editing the page by modifying `pages/index.tsx`. The page auto-updates as you edit the file.
### Development

[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.ts`.
Run in development mode.

The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages.
```
npm run dev
```

This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font.
Run code format checker.

## Learn More
```
npm run format
```

To learn more about Next.js, take a look at the following resources:
### Build

- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
```
npm run build
```

You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!
## Developers

## Deploy on Vercel
- [evdmatvey](https://github.com/evdmatvey)

The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
## License

Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
Project ecommerce-frontend is distributed under the MIT license.
6 changes: 5 additions & 1 deletion next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
reactStrictMode: false,
i18n: {
locales: ['en', 'ru'],
defaultLocale: 'ru',
},
};

export default nextConfig;
Loading

0 comments on commit d768d9d

Please sign in to comment.