beasiswakita

package module
v0.0.0-...-ad98ba4 Latest Latest
Warning

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

Go to latest
Published: May 17, 2018 License: MIT Imports: 6 Imported by: 0

README

BeasiswaKita

BeasiswaKita is simple scholarship tools for organizations and scholarship hunter.

Quick Start

Environment Setup

Make sure:

  • go and mysql has been installed
  • $GOPATH exist in your path
  1. Get this repository
    $ go get github.com/basisdatalab/beasiswakita
    $ cd $GOPATH/src/github.com/basisdatalab/beasiswakita/
    
  2. Set up development environtment
    $ cp env.sample .env
    
    Edit .env file according to your environment setup.
    # Fill this with random string
    APP_KEY=50m3r4nd0m4w3s0m35tr1ng
    
    # Change DB_USERNAME and DB_PASSWORD
    DEVELOPMENT_DATABASE_URL=DB_USERNAME:DB_PASSWORD@(127.0.0.1:3306)/beasiswakita_development
    
    # Host to serve image PATH
    BEASISWAKITA_HOST=http://localhost:8061
    
  3. Install dependencies
    $ make init
    
  4. Init database
    mysql> create database beasiswakita_development;
    $ make migrate
    
Development Guide

This project use MySQL as default DBMS, and use kamimai for the migration.

To create new migration file, go to project root directory and run migration command.

$ make migration <migration name>

The command above will create two files in directory db/migrations

<current_timestamp>_<migration_name>_down.sql
<current_timestamp>_<migration_name>_up.sql

To do a migration, run migrate on project root

$ make migrate

Run rollback to revert a migration

$ make rollback

If you add more dependencies to the project, don't forget to dep ensure

$ dep ensure
Build Project

Build project using build commnd.

$ make build

Run project by executing:

$ ./bin/beasiswakita

Beasiswakita will run at port :8061

TODO
  • Create test files
  • Better documentation

Beasiswakita endpoint

beasiswakita.surge.sh/

-> Halaman ini untuk mengakses halaman utama

beasiswakita.surge.sh/board

-> Halaman ini untuk mengakses halaman dashboard -> Requirement :

  • Harus sudah dalam kondisi login sebagai user penerima beasiswa

-> Halaman ini untuk mengakses halaman pencarian

beasiswakita.surge.sh/detilBeasiswa

-> Halaman ini untuk mengakses halaman lihat detil beasiswa

beasiswakita.surge.sh/partnership

-> Halaman ini untuk halaman pendaftar bagi partnership

beasiswakita.surge.sh/partnership/board

-> Halaman ini digunakan sebagai halaman dashboard perusahaan atau instansi untuk membuat lowongan beasiswa

beasiswakita.surge.sh/login

-> Halaman ini untuk mengakses halaman login -> Requirement :

-> Akun admin dummy :

beasiswakita.surge.sh/daftar

-> Halaman ini untuk mengakses halaman signup

#endpoint

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DbMap *gorp.DbMap
View Source
var Transaction *gorp.Transaction

Functions

func InitDb

func InitDb(dsn string) error

Types

type Organization

type Organization struct {
	ID                int       `db:"id" json:"id"`
	Name              string    `db:"name" json:"name"`
	Position          string    `db:"position" json:"position"`
	OrganizationName  string    `db:"organization_name" json:"organization_name"`
	OrganizationEmail string    `db:"organization_email" json:"organization_email"`
	Address           string    `db:"address" json:"address"`
	City              string    `db:"city" json:"city"`
	Region            string    `db:"region" json:"region"`
	Country           string    `db:"country" json:"country"`
	Zipcode           *string   `db:"zipcode" json:"zipcode,omitempty"`
	Website           *string   `db:"website" json:"website,omitempty"`
	CreatedAt         time.Time `db:"created_at" json:"created_at"`
	UpdatedAt         time.Time `db:"updated_at" json:"updated_at"`
	UserID            int       `db:"user_id" json:"-"`
}

func (*Organization) Map

func (o *Organization) Map() map[string]interface{}

func (*Organization) Parse

func (o *Organization) Parse(data map[string]interface{}) error

type Scholarship

type Scholarship struct {
	ID             int       `db:"id" json:"id"`
	Name           string    `db:"name" json:"name"`
	Country        string    `db:"country" json:"country"`
	Flag           string    `db:"flag" json:"flag"`
	State          int       `db:"state" json:"state"`
	StartDate      string    `db:"start_date" json:"start_date"`
	EndDate        string    `db:"end_date" json:"end_date"`
	Description    string    `db:"description" json:"description"`
	Requirement    string    `db:"requirement" json:"requirement"`
	OrganizationID int       `db:"organization_id" json:"organization_id"`
	CreatedAt      time.Time `db:"created_at" json:"created_at"`
	UpdatedAt      time.Time `db:"updated_at" json:"updated_at"`
}

func (*Scholarship) Validate

func (s *Scholarship) Validate() error

type Student

type Student struct {
	ID            int       `db:"id" json:"id"`
	Name          string    `db:"name" json:"name"`
	Birthdate     time.Time `db:"birthdate" json:"birthdate"`
	Address       string    `db:"address" json:"address"`
	City          string    `db:"city" json:"city"`
	Region        string    `db:"region" json:"region"`
	Country       string    `db:"country" json:"country"`
	Zipcode       string    `db:"zipcode" json:"zipcode,omitempty"`
	Education     string    `db:"education" json:"education"`
	SchoolName    string    `db:"school_name" json:"school_name"`
	SchoolAddress string    `db:"school_address" json:"school_address"`
	SchoolCity    string    `db:"school_city" json:"school_city"`
	SchoolRegion  string    `db:"school_region" json:"school_region"`
	SchoolZipcode *string   `db:"school_zipcode" json:"school_zipcode,omitempty"`
	CreatedAt     time.Time `db:"created_at" json:"created_at"`
	UpdatedAt     time.Time `db:"updated_at" json:"updated_at"`
	UserID        int       `db:"user_id" json:"-"`
}

func (*Student) Map

func (s *Student) Map() map[string]interface{}

func (*Student) Parse

func (s *Student) Parse(data map[string]interface{}) error

type StudentBoard

type StudentBoard struct {
	ID            int       `db:"id" json:"id"`
	Name          string    `db:"name" json:"name"`
	Category      int       `db:"category" json:"category"`
	Description   string    `db:"description" json:"description"`
	State         int       `db:"state" json:"state"`
	UserID        int       `db:"user_id" json:"user_id"`
	ScholarshipID *int      `db:"scholarship_id" json:"scholarship_id"`
	CreatedAt     time.Time `db:"created_at" json:"created_at"`
	UpdatedAt     time.Time `db:"updated_at" json:"updated_at"`
}

func (*StudentBoard) Validate

func (s *StudentBoard) Validate() error

type User

type User struct {
	ID              int                    `db:"id" json:"id"`
	EmailAddress    string                 `db:"email_address" json:"email_address"`
	Password        string                 `db:"password" json:"password,omitempty"`
	PasswordConfirm string                 `db:"-" json:"password_confirm,omitempty"`
	Role            string                 `db:"role" json:"role"`
	UserData        map[string]interface{} `db:"-" json:"user_data"`
	CreatedAt       time.Time              `db:"created_at" json:"created_at"`
	UpdatedAt       time.Time              `db:"updated_at" json:"updated_at"`
}

User hold record of all registered user

func (*User) Validate

func (u *User) Validate() error

func (*User) ValidatePassword

func (u *User) ValidatePassword() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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