ocwcentral

command module
v0.0.0-...-5f5a93c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 10, 2022 License: MIT Imports: 10 Imported by: 0

README

ocwcentral

golangci-lint Gitter

How to start this app

  1. Set up your environmental variables by changing file name from .env.tmplate to .env and specify the following variables.

    APP_ENV=LOCAL
    
    MYSQL_USER=
    MYSQL_PASSWORD=
    MYSQL_ALLOW_EMPTY_PASSWORD=false
    
    • APP_ENV controls where this app is executed. Available variables are LOCAL for local environment, DEV for developing environment (dev-api-ocwcentral.onrender.com), and PROD for production environment (api-ocwcentral.onrender.com).
    • MYSQL_* are settings for a local mysql container. You can specify any value you want.
  2. Start the container of this app.

    docker-compose up --build
    
  3. You need to import data into the database at the first time. The mock data is available here. You can import it by running the following command.

    mysql -p <MYSQL_PASSWORD> -h 127.0.0.1 ocw-central < /path/to/dump/file.sql
    
  4. Access to localhost:8080 and you can see the app.

Directory tree

The following is the directory tree.
We adopt Clean architecture and DDD as our design pattern. Please refer to other articles for the Clean architecture and DDD.

.
├── LICENSE.md
├── README.md
├── docker          // Directory for Dockerfiles and entrypoint scripts
├── docker-compose.yml
├── domain
│   ├── repository  // Clean architecture repository
│   └── usecase     // Clean architecture usecase
├── env
│   └── env.go      // File that maps env variables to a go struct
├── go.mod
├── go.sum
├── gqlgen.yml      // Setting file for `gqlgen` package
├── graph           // Directory for graphql controller
├── interactor      // Clean architecture interactor
├── migrations      // Directory for database migration files
├── model           // DDD model
├── persistence     // Clean architecture repository implementations
├── server.go       // Entry point file to start the server
├── tools           // File that defines tools necessary only for development
├── utils
├── wire.go         // Setting file for dependency injection
└── wire_gen.go     // Auto-generated file by `wire` command

Technology Stack

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
domain
dto

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL