Manage, track, and analyze the value of your digital assets, including NFTs (ERC-721) and FTs (ERC-20) tokens
- NestJS
- PostgreSQL
- Kysely
- TypeScript
- Docker
- Eslint
- Prettier
- JWT
- Moralis used for getting token metadata and market price.
- Privy.io used for verifying access received from the login widget.
- Node 18 LTS/Hydrogen (LTS is recommended)
- Yarn 1+ (1.22.19 is recommended)
- PostgreSQL 16 (LTS is recommended)
-
Clone the repository
Run the command below
git clone https://github.com/timi-codes/coinfolio-api.git && cd coinfolio-api
-
Install dependencies
Run the command below
yarn install
-
Create a
.env
file in the root of the project and add the following environment variables:cp .env.example .env
How to setup environment variables
Below are the environment variables required for the project along with links to setup instructions for each service.
DB_HOST=localhost
DB_PORT=5432
DB_NAME=coinfolio
DB_USER=postgres
DB_PASSWORD=postgres
MORALIS_API_KEY=your-api-key-here
JWT_SECRET=your-jwt-secret
JWT_EXPIRES_IN=7d
JWT_ISSUER=coinfolio
JWT_AUDIENCE=coinfolio
PRIVY_APP_ID=your-privy-app-id
PRIVY_APP_SECRET=your-privy-app-secret
REDIS_HOST=localhost
REDIS_PORT=6379
-
Run migrations
Run the command below to create the database schema
docker compose run coinfolio-api yarn run db:migrate
-
Run the project
Run the command below to start the project
docker compose up -d --build
-
Navigate to
http://localhost:4000/api-docs
to access the API documentation -
The root folder contain a token.json file that contains test data
-
Run migrations
Run the command below to create the database schema
yarn run db:migrate
Other commands:
# create a new migration yarn run migrate:create <migration_name> # run the next migration yarn run db:migrate:up # rollback the last migration yarn run db:migrate:down # rollback all migrations yarn run db:rollback # create a new seed yarn run db:seed:make <seed_name> # run all seeds yarn run db:seed:run
-
Run the project
Run the command below to start the project
yarn run start:dev
-
Navigate to
http://localhost:4000/api-docs
to access the API documentation -
The root folder contain a token.json file that contains test data
- Navigate to
http://localhost:4000/api-docs
to access the API documentation