Backend API & Database Setup Guide
Step-by-step instructions for configuring the Node.js backend environment and MongoDB database connections.
1. Prerequisites
- Node.js: Ensure you have Node.js version 18 or higher installed on your server or local machine.
- MongoDB: You need a running MongoDB database (either a local MongoDB installation or MongoDB Atlas cloud).
2. Configuring the Server Environment
The backend requires specific environment variables to connect to the database and secure the API.
- Navigate to the
codefolder where the backend source code is located. - Rename the file
.env.exampleto.env. - Open the
.envfile in a text editor.
Essential Variables
Important Security Note: The application will refuse to start if JWT_SECRET is not set. You must provide a secure, unique string to prevent unauthorized token forgery.
3. Database Connection & Initialization
Once your .env file is configured with the correct MONGODB_URI, you need to install dependencies and start the server.
- Open your terminal and navigate to the
codefolder. - Install all required Node.js packages by running:
npm install
- Start the backend server by running:
npm run build && npm run start
If the connection is successful, you will see a message in the terminal: Connected to MongoDB successfully!
4. Finalize Installation via Web Wizard
Once your server is running, the application provides an automated web-based installation wizard to set up your administrator account and verify your purchase.
- Open your web browser and navigate to your server's URL (or
http://localhost:3000if running locally). - The system will automatically detect a fresh installation and redirect you to the
/installpage. - Enter your Envato Purchase Code to verify your license.
- Follow the on-screen prompts to configure your Site Name and create your custom Admin Email, Username, and Password.
After completing the wizard, your platform is fully installed and secured!