This is a 2-part repository for
npm i
npm run build
To run the project you need a .env file.
The name of your .env file must include the environment you want to run like .env.local
/ .env.development
/ .env.production
Before running anything, either manually run npm run migrate:up
or make sure dbMigrationsLoop
is ran.
npm run backend:env
pm2 start npm --name=6529backend -- run backend:env
* Note: env can be one of: local
/ dev
/ prod
This repository is configured to be runnable through AWS Lambdas. Each 'loop' folder in the code represents a lambda function and can be built and deployed on AWS individually. * Note: additional setup is required within AWS in order to configure environment variables and triggers for each lambda.
* Note: env can be one of: local
/ dev
/ prod
-
Running database for development: You can use docker and docker-compose for this. Run
docker-compose up -d
in project root and configure your.env
exactly as DB part in.env.sample
. -
Database and ORM: Backend service is using TYPEORM. When starting a service, if the database is successful then the ORM will take care of synchronising the schema for the database and creating the necessary tables. * Note: You will need to create the database and user and provide them in the .env file. Only thing TypeORM doesn't take care of, are views. Those are created with migrations. So you should either run
npm run migrate:up
or make suredbMigrationsLoop
is ran to be sure that all migrations are applied. -
CRON: When starting the service, there are several scheduled cron jobs running at specific intervals which will consume data from the chain, process and save the result to the database. e.g. discovering NFTs - there is a scheduled cron job to run every 3 minutes which detects new nfts minted on the chain or any changes to existing nfts.
-
S3 and Video Compression: S3Loop. The s3Loop persist compressed versions of the nft images and videos on AWS S3. This loop is configured to only run in
prod
mode. Video compression requires ffmpeg installed on the running machine. Download instructions at: https://ffmpeg.org/ -
Creating new migrations: Run
npm run migrate:new name-of-the-migration
. Three new files are created inmigrations folder
. A jacascript file and 2 SQL files. Find the "up" SQL file and write the SQL for new migration there. Then runnpm run migrate:up
to apply the new migration. You can write reverse migration if you wish in the "down" SQL file.
PORT: 3000
PATH: src/api-serverless
cd src/api-serverless
npm i
cd src/api-serverless
npm run build
To run the project you need a .env file.
The name of your .env file must include the environment you want to run like .env.local
/ .env.development
/ .env.production
In project root directory:
npm run api:env
* Note: env can be one of: local / dev / prod
pm2 start npm --name=6529api -- run api:env
* Note: env can be one of: local
/ dev
/ prod
The API is also configured to run as an AWS lambda and can be built and deployed on AWS on its own. * Note: additional setup is required within AWS in order to configure environment variables and API Gateway.
Currently 6529.io uses an Admin Panel to manage:
- distribution lists and presentations
- team members
- royalties
The admin panel repo is located here.
* Note: Please bear in mind that in the near future the admin panel will be deprecated and all functionality will be moved to the 6529SEIZE-BACKEND repo.