Full-featured API that handles most of the Nove projects. Including: OAuth2, account administration and more. Required to run certain projects such as Files: files.backend, files.frontend.
-
To get started, please install the following packages
nodejs
,yarn
,imagemagick
,postgresql
,libwebp
# Example of installing the packages on Arch Linux using Paru package manager paru -S nodejs yarn imagemagick postgresql libwebp
-
Fork and then
git clone
your forked repository# You should always clone repositories through SSH git clone [email protected]:nove-org/NAPI.git
-
Install the required node packages
# Always use yarn as your package manager when contributing to nove-org projects yarn # If the command wasn't found please install yarn >=1.22.19 package manager # You can do it on Arch Linux using the following command paru -S yarn
-
Set up PostgreSQL and then run
yarn db
. Before running database generate and update please fill out the .env file using premade .env.exampleyarn db # Alternatively, you can use following commands yarn db:generate yarn db:update
-
If everything was successful you are ready to go! Happy coding.
NAPI project comes with premade commands for simplified usage:
yarn dev
: In development mode, compiles Sass in watch mode and the project itself, running in nodemonyarn dev:sass
: Watch for Sass file changes and compile them to CSS directoryyarn build
: Compile the projectyarn build:sass
: Compile Sass files to CSSyarn start
: Start the project (auto compilation)yarn db
: Prepare database for the project (generate and update)yarn db:generate
: Generate Prisma Packageyarn db:update
: Sync Prisma with PostgreSQL (required config in .env and PostgreSQL running)yarn db:studio
: Start Prisma Studio on localhost:5555yarn test
: Run project tests
Feel free to contribute improvements, features, bug fixes and more to our code. When you do that, please follow the guidelines. Found a bug in this file? Fork this repository, fix it and open a new pull request.
All commits in pull request or not have to follow Conventional Commits guidelines. Otherwise, they will be rejected instantly.
The code should be automatically formatted after you create your pull request with our config file. You can still install Prettier extension for VSCode/VSCodium and turn on format on save.
Before you will be able to use NAPI you have to setup PostgreSQL as your database. Download it from here (or using your package manager) and follow the setup guide.
- Connect to PostgreSQL
- Create new user with password
- Create new database called
napi
on that user - Give user all privileges on that database
- Give user privileges to create shadow databases
In the .env file
DATABASE_URL="postgres://USERNAME:PASSWORD@localhost:5432/DATABASE"
You should now be able to setup Prisma.
# Generate Prisma Client
yarn db:generate
# Keep your database schema in sync with your Prisma schema as it evolves
yarn db:update
This project is under the GNU Affero General Public License v3.0