module
0.0.0-20220822104208-375eabb1ccd1
Repository: https://github.com/burakkarasel/theatre-api.git
Documentation: pkg.go.dev
# README
Dream Theater
Table of Contents
Description
Dream Theater lets it's user to check out which movies avaiable right now and gives brief information about them. You can register and buy a ticket right now!
Technologies
Main Technologies
Libraries
- golang-jwt/jwt
- golang-migrate/migrate
- golang/mock
- google/uuid
- lib/pq
- spf13/viper
- stretchr/testify
- crypto
How To Use
Tools
Setup Database
- Create Theater Database in psql console
CREATE DATABASE $name$;
-
Migrations runs inside of the program
-
For migrations down create a bash script down.sh
#!/bin/bash
migrate -path internal/db/migration -database "postgresql://$username$:$password$@localhost:5432/$database name$?sslmode=disable" -verbose down
- Grant executable
chmod +x down.sh
- And run
make down
Generate Database functions
- Generate SQL CRUD functions
make sqlc
- Generate mockdb
make mock
Run tests
- Create a bash script test.sh
#!/bin/bash
DB_SOURCE="postgresql://$username$:$password$@localhost:5432/$database name$?sslmode=disable" go test -v -cover ./...
- Grant executable
chmod +x test.sh
- And run
make test
Start App
- To Start App create a bash script start.sh
#!/bin/bash
DB_SOURCE="postgresql://$username$:$password$@localhost:5432/$database name$?sslmode=disable" TOKEN_SYMMETRIC_KEY=$32 character string$ go run cmd/web/main.go
- Grant executable
chmod +x start.sh
- And run
make server
Give it a try
Routes
- Check the documentation from here
Don't forget to copy your access token for authentication required routes after logging in!
Author Info
- Twitter - @dev_bck
# Packages
No description provided by the author