Skip to content
This repository was archived by the owner on Jun 2, 2026. It is now read-only.

TrHgTung/The-Blog-Project

Repository files navigation

How to run the Social Blog project (Backend & Frontend)

Development / Test Environment:

1. Prerequisites

  • Ensure Laragon (or other MySQL DBMS) is running.
  • Database socialproject should exist - if not, create one (Migration scripts have already been applied to this shit).

2. Build for the first time

  1. Open Laragon > Start MySQL service > create a database, name: socialproject and save it

  2. Open Command Prompt > re-check once again if you're stil at the root directory of the source code > type init-project-for-the-first-time.ps1 and hit Entẻ.

  3. Wait for these shit building (backend, migrating, frontend, bla bla..)

  4. Back to the Command Prompt > re-check once again if you're stil at the root directory of the source code > type dev-start.ps1 and hit Entẻ.

  5. The API will be available at https://localhost:5001.

  6. Open your browser and navigate to http://localhost:3000. Because the front-end is on it.

  7. Test yourself!

If your operation system can't run the ps1 script file? Nah, just use Windows and try again!

Production:

  1. Prepare a VPS, a domain name and money for purchasing these shit

  2. Suggested VPS cònfiguration: 2GB of RAM, >20GB of storage, running Ubuntu or other Linux distro OS

  3. Setup your VPS, add you domain to VPS IP address

  4. Start VPS, or use SSH to connect from your PC > login > sudo su > apt update > apt install docker (use ChatGPT for more instructions about setting up Git, Docker, Docker Image, ..)

  5. Git clone the source code for the first time or git pull the source code for updating > cd to the source > and then

    5.1. Add docker-compose.yml file to root directory, and config it by yourself (nano docker-compose.yml > Add scripts (Check the docker-compose.example.yml) > Ctrl X to save > Yes > Enter to overwrite file).

    REMEMBER: enviroment variables in docker-compose.yml file will work on VPS, not on your PC. On your PC, you can use dev-start.ps1 script file instead (it will use appsettings.Development.json and .env files)

    5.2. Add new wwwroot folder on backend source: cd backend > mkdir wwwroot > hit Enter

    5.3. Add appsettings.Development.json file on backend source: cd backend > touch appsettings.Development.json > nano appsettings.Development.json > Add all necessary environment variables (Check the appsettings.Development.example.json) > Ctrl X to save file > Yes > Enter to overwrite

    5.4. Add .env file for frontend source: cd frontend > touch .env > nano .env > Add all necessary environment variables (Check the .env.example) > Ctrl X to save file > Yes > Enter to overwrite

    5.5. Back to root directory of the source (cd ..) > Run docker compose up -d --build for building all the images

  6. Check on your domain or pinging your VPS's IP Address

Or just create a GitHub Actions workflow (.github/workflows/deploy.yml) Example file

My Final Example of Production: The Blog Social - If you get a 404 or 502 status after clicking this, may be it's down due to my poverty.

About

A small social-blog built with monolithic architecture, using .NET Core API and NextJS.

Topics

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors