Wellets is a financial management website that helps users to manage their money placed in multiple portfolios. It was developed with a focus on users engaged in the crypto world. These users usually have money on their bank accounts, exchanges, blockchain wallets and stuff like that. As there are a lots of places to put their money, it is easy to gets confused with their own money. To avoid that, Wellets currently provide wallet and currency management features to help users control their money with more accurately.
ADVICE: Wellets does not have any type of integration with bank accounts or blockchain wallets, all management is done manually. The benefit of using this is the user experience and practicality, but the user needs to specify their transfers and transactions to see the power of the application.
This repository contains the code related to Wellets Back-end. If you want to see the front-end repository, please check Wellets Front-end.
If Wellets currently does not have a certain feature you think it is awesome, be sure to check out the roadmap to see if this is already planned for the future. Otherwise, you can contact me by any contact method listed in my Github Profile to send your ideas.
METHOD | PATH | SHORT DESCRIPTION |
---|---|---|
GET | /currencies | Index native and user custom currencies |
PUT | /currencies/:id | Set preference for the currency |
GET | /currencies/rate | Show currency rate based on other currency |
GET | /currencies/custom | Index user custom currencies |
POST | /currencies/custom | Create a custom currency |
PUT | /currencies/custom/:id | Update a custom currency |
DELETE | /currencies/custom/:id | Delete a custom currency |
GET | /transactions | Index wallet transactions |
POST | /transactions | Create a wallet transaction |
GET | /transfers | Index wallet transfers |
POST | /transfers | Create a transfer between two wallets |
POST | /users | User sign up |
POST | /users/sessions | User sign in |
DELETE | /users/sessions | User sign out |
GET | /users/settings | Get user settings |
POST | /users/settings | Create user settings |
PUT | /users/settings | Update user settings |
GET | /wallets | Index user wallets |
POST | /wallets | Create a wallet |
DELETE | /wallets | Delete a wallet |
GET | /wallets/balance | Show wallet balance based on other currency |
GET | /wallets/total-balance | Show the sum of wallets balances |
Ignore the
.env
,.env.example
files in the main folder, they are used only for running the backend in local mode.
.env
filecp deploy/.env.example deploy/.env
It's recommended to change the POSTGRES_PASSWORD
and JWT_SECRET
variables.
docker-compose -f deploy/compose.yml build
ormconfig.json
file required by TypeORMdocker-compose -f deploy/compose.yml run --rm backend yarn gen:ormconfig
docker-compose -f deploy/compose.yml up -d
docker-compose -f deploy/compose.yml run --rm backend yarn seed:run --seed ProdSeeder
Available seeders:
ProdSeeder
, setup the database for production (i.e. initializes currencies)DevSeeder
, create two users with some wallets and transactionsRootSeeder
, create a minimal fake database for developmentYou can create a user with
curl --location 'http://localhost:3333/users' \
--header 'Content-Type: application/json' \
--data-raw '{
"email": "test1@test.com",
"password": "test1234"
}'
and test the authentication with
curl --location 'http://localhost:3333/users/sessions' \
--header 'Content-Type: application/json' \
--data-raw '{
"email": "test1@test.com",
"password": "test1234"
}'
Contrary to the docker mode, the local mode run the backend directly on the host machine. Node and Yarn are required.
yarn
.env
file cp .env.example .env
- It's recommended to change the
POSTGRES_PASSWORD
andJWT_SECRET
variables.- If you don't want to use redis, set
CACHE_DRIVER=null
.
docker-compose -f deploy/compose.yml --env-file .env up -d db redis
(or docker-compose -f deploy/compose.yml --env-file .env up -d db
if redis is not used)
ormconfig.json
file required by TypeORMyarn gen:ormconfig
yarn run-migrations
yarn seed:run --seed ProdSeeder
Available seeders:
ProdSeeder
, setup the database for production (i.e. initializes currencies)DevSeeder
, create two users with some wallets and transactionsRootSeeder
, TODOyarn dev
MIT © Luca Parolari
Install project dependencies:
npm install
or yarn install
Copy docker-compose.example.yml
located at the root folder to a new docker-compose.yml
file and fill it with the credentials that you want to create the containers.
Set up docker containers:
docker-compose up -d
Copy ormconfig.example.json
located at the root folder to a new ormconfig.json
file and fill it with the credentials that you have set up when creating the containers.
If you make sure that your containers were successfully created, run TypeORM migrations:
npm run run-migrations
or yarn run-migrations
Copy .env.example
located at the root folder to a new .env
file and fill it with the credentials that you have set up on the past steps.
Run project:
npm run dev
or yarn dev
Generate build
folder:
npm run build
or yarn build
Change your ormconfig.json
file to use the files located on the dist
folder:
Just replace src
by dist
and .ts
to .js
on the ormconfig.json
entries.
Run project:
pm2 reload ecosystem.config.js
May you will need to install pm2
globally with npm install -g pm2
or yarn global add pm2
If you want to contribute with me to improve it and add new features, you can contact me by any contact method listed in my Github Profile.
MIT © Daniel Oliveira