Skip to content

chinese-slacking-party/dtt-game-backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dtt-game-backend

This is the backend service repository of MatchMe app. DTT stands for Discrete Trial Training.

To get started with this project, you'll need the following prerequisites:

  • MongoDB (tested with v3.6 and v7.0)
  • A Replicate API key
  • A writable directory to store user-uploaded and AI-generated photos

Moreover, you'll need both backend and frontend to make the app work. After you've deployed the two ends, you'll use nginx to map the services onto the same port (80 or 443). See appendix for sample nginx configuration snippet.

You can choose to run a binary release or build from source code.

Running a binary release

See the Releases page. We currently provide binaries for Windows (x64) and Linux (x64). Those executables are completely standalone (no external library required). You can run it directly in your shell with:

# Linux
export REPLICATE_API_KEY=xxxx
./linux_server
# Windows PowerShell
$env:REPLICATE_API_KEY=xxxx
.\windows_server.exe

Building from source code

You'll need go and git to build the project.

After cloning this repository, cd into it and run:

go build ./cmd/server

As long as you have a working Internet connection (or GOPROXY properly set), go will automatically download all the dependencies and generate the executable.

Appendix 1: Sample nginx configuration

# Add this in your `server` block:
    location /api { # Backend
        proxy_pass http://localhost:8080;
    }
    location / { # Frontend
        proxy_pass http://localhost:3000;
    }

Appendix 2: Customizing your build

As of v0.1.0, MatchMe backend uses in-code constants for configuration. Before you build, make sure to change those constants into desired values:

  • DBAddr and DBName for your MongoDB configuration
  • PhotoDir for your writable UGC directory
  • OurAddr for your IP or domain

If you have your own deployment on Replicate, you should change the CreatePredictionWithDeployment invocation in this file to use yours as well.

More flexible settings are planned for the next release.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages