Giter Club home page Giter Club logo

safer's Introduction

safer

Restful API for an open-source "safe-space" platform where users can get heard/helped with their mental/quotidian problems by volunteers

To use this app you will have to configure a MySql database using the following configs

CREATE TABLE users(
    Role ENUM( 'volunteer', 'client','admin' ) Default 'client',
    Id varchar(255), 
	Email varchar(255),
	Password varchar(255),
	FirstName varchar(255),
	LastName varchar(255),
	Phone varchar(255),
	PRIMARY KEY (Id)
);



CREATE TABLE cases(
    Status ENUM( 'open', 'closed','in-progress' ) Default 'open',
    Id varchar(255), 
	AssigneeId varchar(255),
	ReporterId varchar(255),
	PRIMARY KEY (Id),
	FOREIGN KEY (AssigneeId) REFERENCES  users(Id),
	FOREIGN KEY (ReporterId) REFERENCES  users(Id)
);
	
CREATE TABLE messages(
    Id varchar(255), 
	SenderId varchar(255),
	CaseId varchar(255),
	Message varchar(1024),
	Data varchar(1024),
	CreatedAt DATETIME,
	PRIMARY KEY (Id),
	FOREIGN KEY (SenderId) REFERENCES  users(Id),
	FOREIGN KEY (CaseId) REFERENCES  cases(Id)
);

Env file: create a .env file in the root folder of the project with the following properties

PORT=:8080
SECRET_KEY=Your secret key
PUSHER_APP_ID=PUSHERAPPID
PUSHER_KEY=PUSHERKEY
PUSHER_SECRET=PUSHERSECRET
PUSHER_CLUSTER=PUSHERCLUSTER

API usage: sql.NullString should be used like this

{
    "assigneeId":{
        "String":"0eb9055b-ff08-49b7-8a29-c7259fbcc767",
        "Valid":true
     }
}

Install all packages and then to start the app run

go run cmd/main.go

in the root folder

safer's People

Contributors

g0g05arui avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.