CSharp webapi for EarthFusion, project of Database course design, Tongji SSE, Jul 2020
dotnet add package Oracle.ManagedDataAccess.Core --version 2.19.70
dotnet add package Sendgrid --version 9.18.0
dotnet add package StackExchange.Redis --version 2.1.58
dotnet add package LettuceEncrypt --version 1.0.0 # if you want to automatically obtain Let's Encrypt's certs
Put your https certificate(certificate.pfx) under project root.
Consult your DB Administrator for DB conference.
I assume your spatial admin's account is spatial_admin
, and your geom data is in nemo
's schema.
CREATE TABLE earthfusion_users(
user_id NUMBER,
user_name VARCHAR2(50),
user_email VARCHAR2(50),
user_password_hashed VARCHAR2(66),
user_status VARCHAR2(50),
user_role VARCHAR2(50),
PRIMARY KEY(user_id)
);
Firstly, create an ini
file under project root.
Contents for config.ini
:
EARTH_FUSION_EMAIL_API_KEY=***
EARTH_FUSION_SPATIAL_DB_USERNAME=***
EARTH_FUSION_SPATIAL_DB_PASSWORD=***
EARTH_FUSION_SPATIAL_ADMIN_DB_USERNAME=***
EARTH_FUSION_SPATIAL_ADMIN_DB_PASSWORD=***
Build and run:
#!/bin/bash
#
# no longer need this as we has ini config
# export EARTH_FUSION_EMAIL_API_KEY="***" # Sendgrid API Key
# export EARTH_FUSION_SPATIAL_DB_USERNAME="***" # Oracle
# export EARTH_FUSION_SPATIAL_DB_PASSWORD="***" # Oracle
# export EARTH_FUSION_SPATIAL_ADMIN_DB_USERNAME="***" # Oracle
# export EARTH_FUSION_SPATIAL_ADMIN_DB_PASSWORD="***" # Oracle
#
cp ./config.ini ./bin/Debug/netcoreapp3.1/
dotnet build
./bin/Debug/netcoreapp3.1/earthfusion-backend
- It's recommended to create a script.
- HTTPS support.
- Response compression, enabled over HTTPS: source
- Use ini file for config