Skip to content

mfjkri/OneNUS-Backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OneNUS Backend [22/23 CVWO Winter Assignment]

Backend for OneNUS.

🎮 Demo

You can find the live version of this project here.

Frontend

You can find the frontend that consumes this project here.

💻 Project Overview

Project aspect Technologies used
Frontend Typescript + React
Backend (this repo) Golang + Gin + Gorm
See ⚡️Technologies for more details.
Database MySQL
Deployment plan Frontend: AWS S3 Bucket + Cloudfront
See Frontend Deployment for more details.

Backend: AWS EC2 + Nginx (reverse proxy)
See 🌐 Deployment for more details.

Database: AWS EC2 (same instance as backend)

🛠 Building the project

Prerequisites

  1. Go

    Install Go if you have not done so yet.

Installation

  1. Clone this repo.

    $ git clone https://github.com/mfjkri/OneNUS-Backend.git
    
  2. Change into the repo directory.

    $ cd OneNUS-Backend
    
  3. Copy the template .env file.

    $ cp .env.example .env
    

    Modify the following environment variables in the new .env file accordingly:

    PORT=8080 # Port number that the project  will be listening to
    DB="USERNAME:PASSWORD@tcp(HOSTNAME:PORT_NUMBER)/DATABASE_NAME?charset=utf8mb4&parseTime=True&loc=Local" # Credentials to connect to database
    JWT_SECRET=JWT_SECRET # Random string that is used to generate JWT tokens
    GIN_MODE="debug" # Set to either "debug" or "release" accordingly
  4. All set!

    $ go run main.go
    

    This command will install all dependencies automatically when first ran.

📚 Table of Contents