Skip to content

CaraMellang/military-count-down

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

military-count-down

Description

A military discharge date calculator and company wiki toy project for myself and coworkers for fun.

This project consists of the left days of military duty and some wiki about the company where I worked as a skilled industrial personnel agent.

Tech stacks

TypeScript Next.js Nest.js Docker Nginx
Cloudflare R2 PostgreSQL Prisma TailwindCSS

Pre-requisites

  • Git
  • Docker
  • Docker Compose

Installiation

Summary

  1. Clone repository.
  2. Modify datasource (docker-compose.yml and .env both)
  3. Create new docker network named military-count-down
  4. Docker compose build and execute

Detail

  1. Clone this repository using the command below where you want.
>> git clone https://github.com/dinb1242/military-count-down.git
  1. Move to the directory where you have cloned, find docker-compose.yml, and modify the postgreSQL db, username, and password what you want to use.

    You have to modify .env file too (datasource such as DB, username, password in this file must match up with db.environment in docker-compose.yml)
>> cd ./military-count-down
  # docker-compose.yml
  # Modify the db.environment.
  db:
    container_name: military-count-down-postgres
    image: postgres:15
    environment:
      - POSTGRES_DB=local
      - POSTGRES_USER=postgres
      - POSTGRES_PASSWORD=password
    ports:
      - "5432:5432"
    networks:
      - military-count-down

  1. Move to the server directory, create .env file to specify the postgreSQL datasource and fill in the below code.

    Note that the datasource must match up with db.environment in docker-compose.yml
# Create .env in server directory.
>> cd ./server
>> touch .env
# .env
DATABASE_URL="postgresql://username:password@db:5432/db_name?schema=schema_name"
JWT_KEY=A_JWT_key_what_you_want_to_use

  1. Before execute the docker compose command, you have to create a new docker network named military-count-down by typing the command below.

    Otherwise, you can just remove docker compose network setting by modifying networks property in docker-compose.yml. (If you decide this way, you can skip this step.)

    To create a docker network, execute the command below.
>> docker network create military-count-down

  1. Move to the root directory and type the command below to set up the whole projects.
# Move to the root directory and build.
>> cd ..
>> docker compose up --build -d

  1. Once the docker compose command finished, you can check the status using the command below.
>> docker compose ps
# Results
NAME                           COMMAND                  SERVICE             STATUS              PORTS
military-count-down-postgres   "docker-entrypoint.s…"   db                  running             0.0.0.0:5432->5432/tcp, :::5432->5432/tcp
military-count-down-server-1   "/bin/sh -c ./entryp…"   server              running             0.0.0.0:8080->8080/tcp, :::8080->8080/tcp
military-count-down-web-1      "npm run start"          web                 running             0.0.0.0:3000->3000/tcp, :::3000->3000/tcp

  1. If some containers are not running, then you can run those by using the command below.
>> docker compose start # Whole containers will be started.
>> docker compose start [service name] # [service name] container will be starte.

Features

About

A military discharge date calculator and company wiki toy project.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 98.9%
  • Other 1.1%