Backend
Last updated
Was this helpful?
Last updated
Was this helpful?
The configuration for the backend is located at the backend/.env file.
Make sure you have installed on your machine. The recommended version is 16.
Is recommended that you use a Node Version Manager tool for you to be able to switch version if you need it in the future.
MacOS/Linux:
Windows:
Please make sure you have the database of your choice installed and running on your machine.
Also, make sure you have access to that database using a database GUI tool.
ScaffoldHub supports:
(for the SQL version)
(for the SQL version)
(for the MongoDB version)
The .env file is located at backend/.env and it stores the environment variables.
If you are using the default PostgreSQL database on your localhost, you can leave the configuration as it is.
You must have the DATABASE_DATABASE
created on your localhost server. The default config uses development as the database name.
For MySQL, use those settings:
For the MongoDB version, you must place the full connection URL.
The default example uses the localhost server and the development schema.
The JWT secret is used to sign the JWT tokens. Please replace the JWT secret to some random and long UUID chain. For example: a40a8850-24b2-4023-85ce-1765d10c849b-758df0c2-b112-4851-960d-1b7163d3ccd6
The JWT expiration invalidates the tokens after a certain period that can be configurated on the AUTH_JWT_EXPIRES_IN
variable.
For localhost, the frontend URLs will be:
http://localhost:3000 (for React)
http://localhost:8081 (for Vue)
http://localhost:4200 (for Angular)
Same ports for the FRONTEND_URL_WITH_SUBDOMAIN
. Please leave the [subdomain] as it is. Note: This works only for the multi-with-subdomain tenant mode.
By default, files are stored on the localhost.
Social sign-in is pre-configured for Google and Facebook. What you have to do is to fill the AUTHSOCIAL* env variables with the secrets you get on your Google and Facebook developer accounts.
Go to the backend folder of your project and run:
You can ignore installation warnings.
Go to the backend folder of your project and run:
For SQL: This command will create all the tables.
If the following error occurs, you need to set a password in your database and change the DATABASE_PASSWORD in the .env file with the created password.
For MongoDB: This command will create all the collections and the indexes. If you skip this step, the app will work, but throw errors where you have unique validation defined.
Go to the backend folder of your project and run:
The standard localhost server does not support , but you probably want it enabled in production. You can rent a database, point your localhost to it, and enable the DATABASE_TRANSACTIONS
flag. That way you ensure you are developing on the same conditions of your future production environment.
For the email configuration, follow the section.
For the premium version, you can set Google Cloud Storage or Amazon S3 providers, by following the section.
Google:
Facebook:
For payment configuration, follow the section.
If the following error occurs, you need to set a password in your database and change the DATABASE_PASSWORD in the .env file with the created password.