-
Install MySQL and Node v18+.
-
Install PNPM.
-
Create a new project in Google reCAPTCHA.
-
Create a MySQL database and a user for it:
CREATE DATABASE partimap CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; CREATE USER 'partimap_user'@'localhost' IDENTIFIED WITH mysql_native_password BY 'your strong password here'; -- or in case of MySQL v5: CREATE USER 'partimap_user'@'localhost' IDENTIFIED BY 'your strong password here'; GRANT ALL PRIVILEGES ON partimap.* TO 'partimap_user'@'localhost';
-
Copy
.env.example
to.env
and edit the app's configuration. At a minimum, you need to set these:DB_USER=partimap_user DB_PASS=your strong password here DB_NAME=partimap RECAPTCHA_SITE_KEY=copy value here from recaptcha admin RECAPTCHA_SECRET_KEY=copy value here from recaptcha admin
-
Open a terminal in the project directory and install dependencies with
pnpm i
. -
Run database migrations with
npx db-migrate up
, this will create the tables of the project. -
In MySQL add an admin user for the project:
INSERT INTO user (email, password, name, registered, isAdmin, active) VALUES ("admin@partimap.eu", "$2a$12$TwohCgZc1t7.pwX84CXZ..R9a3vIM5qWb5RaqcJZokUCNEjmLxXBq", "Admin", 0, 1, 1);
-
Run dev server with
pnpm run dev
. -
Login (
/login
) with username "admin@partimap.eu" and password "123", then change admin password. :)
- Do all of the above, and make sure to set all relevant fields in .env to match your environment, see
.env.example
. - Build the application with
pnpm run build
. - Start server with
pnpm start
.
Or you can set it up as a service and run it with the following steps:
- Install PM2 process manager with
npm i -g pm2
. - Set it up as a service (to start on boot) with
pm2 startup
. - Create a configuration via
cp ecosystem.config.cjs.example ecosystem.config.cjs
and edit the app name and other options as you wish. - Start the server with
pm2 start ecosystem.config.cjs
- Create
.env.test
file. - Run
pnpm run test
or you can runpnpm run dev
and open Vitest in Nuxt DevTools.
- Run
npx db-migrate create <name-of-migration>
. - This will create
migrations/sqls/<timestamp>-<name-of-migration>-<up|down>.sql
files. - Edit them so
*-up.sql
contains the SQL command of your migration, while*-down.sql
contains the command to undo it. SQL files cannot contain more than one command.
GPLv3, please see the LICENSE
file for details.
Copyright (C) 2024 DeepData Ltd.