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.
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:
.\web.app\win.bat
- Linux Users: Run the shell script:
./web.app/linux.sh
- macOS Users: Run the shell script:
./web.app/osx.sh
- 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.
- Edit src/utils/config.ts, change BASE_URL to web.api's URL, like http://localhost:8800.
- run
npm run dev
Before building the project, you need to configure the ASP.NET Core project settings in the appsettings.json file located in the app folder.
{
"ConnectionStrings": {
"DefaultConnection": "Data Source=aurga.db"
},
"EmailServer": "smtp.yourdomain.com",
"EmailAccount": "[email protected]",
"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 [email protected] 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.
- Navigate to the app folder:
- Build the ASP.NET Core project in Release configuration:
dotnet build -c ReleaseAfter 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:
Open aurga.csproj with Visual Studio and debug.
- 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.
Follow these steps to build and run the project using Docker:
- Docker installed on your machine (Install Docker).
- Docker Compose (optional, but recommended).
-
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:/databaseSave this as docker-compose.yml and run:
sudo docker-compose up -d-
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>