Project Overview
This project consists of two main parts:
- An ASP.NET Core project (
web.apifolder) that provides web APIs. - A Node.js project (
web.appfolder) that provides the sign-up/sign-in UI.
Prerequisites
Step 1: Build the Node.js Project
Automatic Build and Copy for Windows, Linux, and macOS
If npm is installed, the following scripts can automatically build the Node.js project and copy the built files to the web.api/wwwroot directory for debugging:
- Windows Users: Run the batch script:
- Linux Users: Run the shell script:
- macOS Users: Run the shell script:
Manual Build
- Navigate to the
web.appfolder: - Follow the instructions in the
web.app/README.mdto build the Node.js project. - After building, copy the dist folder to web.api/wwwroot.
Debug
- Edit src/utils/config.ts, change BASE_URL to web.api's URL, like http://localhost:8800.
- run
Step 2: Build the ASP.NET Core Project
Configure the Project
Before building the project, you need to configure the ASP.NET Core project settings in the appsettings.json file located in the app folder.
Sample appsettings.json Configuration
{
"ConnectionStrings": {
"DefaultConnection": "Data Source=aurga.db"
},
"EmailServer": "smtp.yourdomain.com",
"EmailAccount": "account@yourdomain.com",
"EmailPassword": "smtp_password",
"WebSiteUrl": "https://aurga.yourdomain.com",
"WebSiteMirrorUrl": "https://aurga.yourdomain.com"
}Configuration Details
DefaultConnection: Specifies the SQLite database file location. Update this to your desired database file path.
EmailServer: The SMTP server address. Replace smtp.yourdomain.com with your SMTP server's address.
EmailAccount: The email account used for sending emails. Replace account@yourdomain.com with your email account.
EmailPassword: The password for the email account. Replace smtp_password with your email account's password.
WebSiteUrl: The site url attached in invitation email.
WebSiteMirrorUrl: This is the URL used by the mirror application to communicate with the main web server. It acts as the host address for mirroring requests and responses. Ensure this URL points to the correct endpoint where the mirror app can access the server. Typically, this will be the same as WebSiteUrl unless you have a separate domain or subdomain dedicated to mirroring functionality.
Automatic Build and Copy for Windows, Linux, and macOS
- Navigate to the app folder:
- Build the ASP.NET Core project in Release configuration:
After building, the files are generated in app/bin/Release/netx.0/. Copy the web.app/dist folder to this location and rename it to wwwroot:
Debug
Open aurga.csproj with Visual Studio and debug.
Step 3: Host the Web Server
Windows (IIS)
- Open IIS Manager.
- Create a new website and point the physical path to
app/bin/Release/netx.0/. - Configure the bindings (e.g., port, hostname).
- Start the website.
Linux (Nginx or Apache)
Docker Setup
Follow these steps to build and run the project using Docker:
Prerequisites
- Docker installed on your machine (Install Docker).
- Docker Compose (optional, but recommended).
Steps
-
Configure
web.api/appsettings.json
Update theappsettings.jsonfile with your configuration details. Refer to Step 2 for guidance. -
Set Database Location
Change the database path inappsettings.jsonto a bind mount path inside the Docker container. For example:"DefaultConnection": "Data Source=/database/data.db"
-
Build the Docker Image
- Windows: Run
build.bat. - Linxu/macOS: Run
bash build.sh.
This script will:
- Build the Node.js project (if applicable).
- Copy the necessary files to web.api/wwwroot.
- Build the Docker image.
- Windows: Run
-
Run the Docker Container Start the Docker container with a local volume for the database. For example:
docker run -d -p 80:8080 -v /path/to/local/database:/database <image-name>
Replace /path/to/local/database with the path to your local database directory and <image-name> with the name of your Docker image.
Alternatively, use Docker Compose:
version: '3.8' services: web: image: <image-name> ports: - "80:8080" volumes: - /path/to/local/database:/database
Save this as docker-compose.yml and run:
sudo docker-compose up -d
Notes
-
Ensure the local database directory (
/path/to/local/database) exists and has the correct permissions. -
If you encounter issues, check the Docker logs for errors:
docker logs <container-id>