Giter VIP home page Giter VIP logo

cc's Introduction

cc

logo

Setup

Follow these steps to setup a local development environment.

Prerequisites

This software should be installed on your machine to develop on this project.

Docker Desktop

Download and install Docker Desktop. It's the only required software.

NVM (optional)

This repo sets up a Node JS virtual machine using Docker Compose. However, it may be convenient to install Node JS on your local machine anyway. I recommend using NVM to manage Node JS versions. This repo contains an .nvmrc file and if you follow the NVM setup instructions, especially the section on shell integration you can make NVM switch to the right Node version based on the .nvmrc file automatically whenever you change directories to this project.

Visual Studio Code (optional)

This is optional, but I highly recommend Visual Studio Code. It works very well and it's what I used to develop on this project myself.

Start the dev environment

Make sure you have the prerequisites installed.

Copy example.env to .env and make sure you are ok with it's contents.

Run this command from the project folder to start a development environment:

docker compose up -d

This will download and install NGINX and MariaDB. You can also select another database.

After startup, you can setup SSL and then connect your browser to https://cc.localhost.

Setup SSL

On first run, the proxy/setup.js script will generate a bunch of SSL certificate files in proxy/certs:

  • ca.crt
  • ca.key
  • ca.pem
  • ca.srl
  • cc.localhost.crt
  • cc.localhost.csr
  • cc.localhost.ext
  • cc.localhost.key

The setup script will generate the *.localhost.* files based on the NAME environment variable configured in .env. You can also directly control the domain name for the project by editing proxy/domains.template. Check the logs of the web docker container for details.

The ca.* files are actually a self-signed certificate authority that is in turn used to sign the domain certificates. Double-click ca.crt to install the certificate authority as a trusted authority on your machine, to make your browser trust your self-signed certificates.

Once you have added the certificate authority and restarted your browser, you should be able to visit https://cc.localhost with a trusted SSL certificate.

Stop the dev environment

To stop the dev environment, run

docker compose down

Select another database

This repo actually comes with compose.yml files for 3 different databases:

To select which database to use, set the environment variable DB_TYPE in .env to one of mariadb, mysql or postgres. More details in .env.

cc's People

Contributors

download avatar

Stargazers

 avatar

Watchers

 avatar  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.