Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions frontend/exercise/client/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Dockerfile
.dockerignore
.gitignore
README.md
build
node_modules
23 changes: 23 additions & 0 deletions frontend/exercise/client/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# production
/build

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
8 changes: 8 additions & 0 deletions frontend/exercise/client/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM node:16.13
WORKDIR /home/app/client
COPY package*.json ./
RUN npm install
COPY . .

EXPOSE 3000
CMD [ "npm", "start" ]
98 changes: 98 additions & 0 deletions frontend/exercise/client/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
# Expense Tracker - Provectus Frontend Internship

[![Build][build-shield]][build-url]

[![Contributors][contributors-shield]][contributors-url]
[![Issues][issues-shield]][issues-url]


<!-- TABLE OF CONTENTS -->
<details open="open">
<summary>Table of Contents</summary>
<ul>
<li><a href="#about">About</a>
</li>
<li><a href="#getting_started">Getting Started</a>
<ul>
<li><a href="#prerequisites">Prerequisites</a></li>
<li><a href="#docker-installation">Instalation via docker-compose</a></li>
<li><a href="#manual-installation">Manual Installation</a></li>
</ul>
</li>
</ul>
</details>

## About <a name = "about"></a>

Application is implemented using HTML+CSS+JS+React+Typescript stack. Forms are validated via [`react-hook-form`](https://github.com/react-hook-form/react-hook-form). [`rechart`](https://github.com/recharts/recharts) lib was used to visualize statistic by categories. Icons were imported from [`react-feather`](https://github.com/feathericons/react-feather) lib.

The application will contain 4 routes:

- `/expenses` - displays full expenses history, allows to perform CRUD operations on the expenses;
- `/add-expense` - form to add new expense. All the fields should be filled and the amount values should not be less than 0,01 in order to send the `POST` request;
- `/edit-expense/{id}` - form to update the existing expense. All the fields should be filled and the amount values should not be less than 0,01 in order to send the `POST` request. By default the input fields' values are set to the data of current expense;
- `/statistic` - shows statistic by category for each month present in expenses list. The total month spending, monthly categories expenses and categories spending chart are displayed on this page.

Client Application is available on port `3000`.
Server API is running on port `5000`.
MongoDB is using port `27017`.
## Getting Started <a name = "getting_started"></a>

These instructions will get you a copy of the project up and running on your local machine.

### Prerequisites <a name = "prerequisites"></a>

Download the app using

```bash
git clone https://github.com/mari1647iv/internship
cd ./internship/frontend/exercise
```

### Instalation via docker-compose <a name = "docker-installation"></a>

The app could be installed and started simply via

```bash
docker-compose up
```
Client application will be available on port `3000`.

### Manual Installation <a name = "manual-installation"></a>

Seed the database with the generated data
```
docker-compose up mongo-seed
```
Start the api server
```
docker-compose up api
```
Check the api doc generated by the server side
```
http://localhost:5000/api-docs
```
Install client dependencies using `npm`
```npm
cd client
npm i
```
Start the application
```npm
npm start
```
,or build it for production:

```npm
npm run build
```

<!-- MARKDOWN LINKS & IMAGES -->
<!-- https://www.markdownguide.org/basic-syntax/#reference-style-links -->

[contributors-shield]: https://img.shields.io/github/contributors/mari1647iv/internship.svg?style=for-the-badge
[contributors-url]: https://github.com/mari1647iv/internship/graphs/contributors
[issues-shield]: https://img.shields.io/github/issues/mari1647iv/internship.svg?style=for-the-badge
[issues-url]: https://github.com/mari1647iv/internship/issues
[build-shield]: https://forthebadge.com/images/badges/made-with-javascript.svg?style=for-the-badge
[build-url]: https://forthebadge.com
Loading