This project consists of multiple components to handle different aspects of the Complete Developer Network:
- CDNAPI: Handles API requests and responses.
- CDNDomain: A library used by CDNAPI to manage domain definitions.
- Terraform: Manages EC2 deployment and infrastructure as code.
- .NET SDK 8.0 or later
- PostgreSQL
- Terraform
- AWS CLI (for deployment)
-
Clone the repository:
git clone git@github.com:zaidaiman/cdn.git cd cdn -
Restore and build solution:
dotnet restore dotnet build
-
Build webapp:
cd webapp npm i
-
With the recent release of Apple Sequoia OS, Apple has changed how it handle certificates, which resulted failure when perform
dotnet dev-certs https --trust. The team at Microsoft is working on it and scheduled to release by Oct 2024: dotnet/announcements#324. -
I have made the changes so that https redirection only happens when it is not in development environment.
-
Run the API in project root directory:
dotnet run --project CDNAPI/CDNAPI.csproj
-
Navigate to http://localhost:5007/swagger/index.html to view the API documentation.
-
Run the webapp in webapp directory:
npm start # default url should be http://localhost:4200
-
For development, create
appSettings.Development.json{ "ConnectionStrings": { "DefaultConnection": "Host=localhost;Database=freelancer;Username=user;Password=password" }, "Jwt": { "Key": "<generate-issuer-key>", "Issuer": "Complete Developer Network", "Audience": "Complete Developer Network API" }, "Logging": { "LogLevel": { "Default": "Information", "Microsoft.AspNetCore": "None", "Microsoft.Hosting.Lifetime": "None" } } } -
To generate issuer key, run the following command and replace the value in
appSettings.Development.json:openssl rand -base64 32
complete-developer-network/
├── CDNAPI/ # API project
├── CDNDomain/ # Domain library
├── terraform/ # Terraform scripts for deployment
├── webapp/ # Simple web app demo
├── docker-compose.yml # Docker compose file
├── Dockerfile # Dockerfile for CDNAPI build
├── README.md # Project documentation
└── LICENSE # License file
- Run the tests:
dotnet test --logger "console;verbosity=detailed"
- Initialize Terraform:
cd terraform terraform init - Plan the deployment and verify the changes to be made (double confirm, as this will create/delete resources in AWS!):
terraform plan
- Apply the changes:
terraform apply
This project is licensed under the MIT License - see the LICENSE file for details.