rms-go

command module
v0.0.0-...-458f1ed Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2024 License: MIT Imports: 8 Imported by: 0

README

Go Assessment SynergyLabs

Recruitement Management System

Tech Used

  • Golang: Utilized Golang's standard HTTP library for routing and building a RESTful API.

  • Mysql: Employed MySQL as the database solution, using raw SQL queries for efficient and flexible data handling.

  • Validator: Integrated for robust input validation, ensuring data integrity and security.

  • Goose: Managed database migrations with Goose, facilitating seamless schema version control and updates.

  • Docker: Containerized the application with Docker, simplifying setup for the team. Testing can be done easily with docker-compose up.

Set-Up Project Locally

Docker
  1. First clone the Project locally:

    git clone https://github.com/Sahil2k07/rms-go.git
    
  2. Move to the Project directory:

    cd rms-go
    
  3. Set these environment variables in the .env file.

     API_URL=
     API_KEY=
    
  4. Run the command to start your Containerized Application

    docker-compose up
    

    or

    docker-compose up -d
    
  5. If you have Docker Compose Plugin, Use this command instead

    docker compose up
    

    or

    docker compose up -d
    
  6. You will be able to access this application in localhost:3000 of your machine.

Golang
  1. Clone the repository to the local:

    git clone https://github.com/Sahil2k07/rms-go.git
    
  2. Move to the project directory:

    cd rms-go
    
  3. Set up all the required env variable by making a .env file. A .env.example file has been given for reference.

    PORT=localhost:3000
    
    JWT_SECRET=GoAppSecret
    
    ALLOWED_ORIGINS=*
    
    MYSQL_URL=root:<password>@tcp(127.0.0.1:3306)/<dbName>
    
    API_KEY=
    API_SECRET=
    
  4. Run the command to download all the dependencies to your local machine:

    go mod vendor
    
  5. Now you will need to apply all the migrations in your database. First install goose locally:

    go install github.com/pressly/goose/v3/cmd/goose@latest
    
  6. Move to the migrations directory:

    cd src/database/migrations
    
  7. Run the command to apply the migrations. Make sure to modify the command to have your's used MySQL database url in the .env. Make sure to have a database created before-hand:

    goose mysql "root:<password>@tcp(127.0.0.1:3306)/<dbName>" up
    
  8. After applying the migrations traverse back to the root directory:

    cd ../../../
    
  9. Build the Binary to start the Project:

    go build
    
  10. Start the Project:

    ./rms-go
    

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
src
dto

Jump to

Keyboard shortcuts

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