Giter Site home page Giter Site logo

caramellang / military-count-down Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dinb1242/military-count-down

0.0 0.0 0.0 1.79 MB

A military discharge date calculator and company wiki toy project.

Home Page: military-count-down-rnby.vercel.app

Shell 0.21% JavaScript 0.83% TypeScript 98.85% CSS 0.02% Dockerfile 0.08%

military-count-down's Introduction

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

military-count-down's People

Contributors

dinb1242 avatar caramellang avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.