The platform that aims to simplify your online gift exchange and secret santa for free.
- PostgreSQL - Primary database
- GORM - ORM to interact with the database programmatically
- Postgres for GORM - Postgres Driver for GORM
- Google UUID - Generates UUID before inserts
- Fiber - Express.js inspired framework for Go (uses Fasthttp)
- Goth - OAuth support for multiple platforms
- Goth Fiber - Goth implementation for Fiber
This project also uses a PostgreSQL database in order to run. To start, create a file called db_config.json
in the project root and place the following in the file, replacing all content within the []
with the correct database values:
{
"host": "localhost",
"dbName": "[database name]",
"username": "[database username]",
"password": "[database password]",
"port": 5432
}
Note: All database table and column names are represented in snake_case
. While all json field names are represented using camelCase
.
In addition to the db_config.json
, you will also need to create a tokens.json
file which will hold the JWT secret, note that this token should be a randomly generated value and must not be made public. The token.json
file should contain the following:
{
"jwtKey": "[YOUR SECRET TOKEN]",
"twitter": {
"apiKey": "[Twitter OAuth 1.0 API Key]",
"apiKeySecret": "[Twitter OAuth 1.0 API Secret]",
"bearerToken": "[Twitter OAuth Bearer Token]",
"callbackUrl": "http://localhost:8080/auth/twitter/callback"
},
"google": {
"clientId": "[Google Client Id]",
"clientSecret": "[Google Secret Key]",
"callbackUrl": "http://localhost:8080/auth/google/callback"
}
}
$ make build
or
$ go build src/server.go
Creates an executable binary file called server
. To run this file call ./server
, like so:
$ ./server
This should start the server on port 8080
.
Another way to run the server is by using the make run
command.
$ make run
Running the command should also start the server on port 8080
. This command is equivalent to running go run src/server.go
.