This project is a monorepo. Consists of a platform to upload a specific type of file, containing information about each customer's product transactions, with the purpose of processing the data and displaying the listing.
This is a challenge by Coodesh
The definitions of the requests and the strategies for creating the application for both the backend and the frontend are in the documentation file.
- Check out the project presentation at this link.
- I created a flow to simulate a scrum board with all the decision making I had during the development of this project. If you want to view it, click here. PS.: the board is in Portuguese.
- Backend:
- Frontend:
-
Step one: clone this repository
-
With HTTP:
git clone https://github.com/natanhermes/fullstack-afiliados.git
-
With SSH:
git clone git@github.com:natanhermes/fullstack-afiliados.git
-
Step two: setup api
- Install dependencies(use node version 18):
cd fullstack-afiliados && cd backend && npm install
- Rename file from .env.example to ".env".
Run:
cp .env.example .env
- If you don't have docker installed, follow these steps to install it:
- To create the PostgreSQL database schema using docker compose, it is necessary to define the "DATABASE_URL" environment variable. I defined a default url that you can use or modify as you wish.
Obs.: If you modify the docker configuration url, also modify the respective settings in the docker-compose.yml file.
Obs.2: For these commands to work, you need to have the docker service running on your machine.
Run in fullstack-afiliados/backend dir:
docker-compose up -d
- To create the migrations referring to the database tables.
Run in fullstack-afiliados/backend dir:
npm run db:migrate
- Finally, run project in dev mode:
npm run start:dev
- Install dependencies(use node version 18):
- Step one: setup app
- Install dependencies(use node version 18):
cd frontend && npm install
- Rename file from .env.example to ".env".
Run:
cp .env.example .env
- Install dependencies(use node version 18):
- Step two:
- Run app in dev mode:
npm run dev
- Run app in dev mode:
-
It is necessary to register with name, email and password.
-
After registering, log in using your email and password.
-
To view the data on screen, it is necessary to upload the text file containing the transactions.
-
The text file must follow the following structure:
12022-01-15T19:20:30-03:00CURSO DE BEM-ESTAR 0000012750JOSE CARLOS
- *Where the 1st position refers to the type of transaction, which can be: 1 - Producer sale 2 - Affiliate sale 3 - Commission paid 4 - Commission received
- From the 2nd to the 26th position, it refers to the date of the transaction, in ISO 8601 format(YYYY-MM-DDTHH:MM:SS±HH:MM): Ex.: 2022-01-15T19:20:30-03:00
- From the 27th position to the 56th, it refers to the product description: Ex.: CURSO DE BEM-ESTAR
- From position 57 to 66, it refers to the value in cents of the transaction: Ex.: 0000012750
- Finally, from position 67 onwards, it refers to the name of the producer or affiliate: Ex.: JOSE CARLOS
-
When uploading, the list with the processed data will be displayed.