GithubHelp home page GithubHelp logo

gd-nws / accounts-api Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 1.0 38 KB

Good News user accounts api

License: BSD 3-Clause "New" or "Revised" License

Go 94.26% Dockerfile 5.74%
authentication users jwt go

accounts-api's Introduction

Accounts API

API for managing Good News user accounts.

Setup

Setup Environment Variables

Setup GOPATH and GOBIN environment variables:

export GOPATH=$(pwd)/src
export GOBIN=$GOPATH/bin

Set the environment variables for postgres and application secret:

DB_HOST=
DB_USER=
DB_PASS=
DB_NAME=
SCHEMA=
JWT_KEY=

Setup Postgres:

The database should have a users table like so:

create table users
(
	id serial not null
		constraint users_pk
			primary key,
	email varchar(255) not null,
	password varchar(255) not null,
	refresh_token varchar(255),
	created_at timestamp default CURRENT_TIMESTAMP not null,
	updated_at timestamp default CURRENT_TIMESTAMP
);

create unique index users_email_uindex
	on users (email);

Build

cd ./src && go build -a -installsuffix cgo -o main .

Run

./src/main

Deploy

Build and tag the docker image. Or run with:

docker-compose up --build -d

accounts-api's People

Contributors

wel-shy avatar

Stargazers

Nathan Dygant avatar

Watchers

James Cloos avatar  avatar

Forkers

mongosaurusrex

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.