gen

package module
v0.0.0-...-6d2187c Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2024 License: MIT Imports: 0 Imported by: 0

README ΒΆ

This AMA (Ask me Anything) repository holds the WebServer of the AMA project.

⁉ AMA | Ask me Anything

The project consists on creations of ROOMS where you can share with your audience in your next AMA Meeting.
In the Room, anyone can make questions and upvote others people questions.

It uses WebSocket to subscribe to a room and get it updated realtime and handle some problems of race conditions using mutual exclusion.

πŸ–₯ FrontEnd

The frontend of this application was developed using React and it's avaiable in its own repository.

πŸ“‹ Pre-requirements

🌲 Environment Variables

Make a copy of the env.template file and rename it to .env.
Change the variables inside .env with the credentials of your database.

πŸ—οΈ Usage

First, install all dependecies using go mod:

go mod tidy
πŸ”„ Migrations

Currently, the application does not perform migrations automatically, meaning you need to run the command to create the tables in the database.

To run the migrations, simply use go run.

go run cmd/tools/terndotenv/main.go

[!NOTE] To do the migrations, your database need already to be up and running.

βš™ Go

Then, you can start the API with the go run command:

go run cmd/ama/main.go

πŸ‹ Docker Compose

Alternatively, you can run the application using docker-compose. This will run the backend, frontend and the postgres database:

docker-compose up

Make sure you have this ama-backend repository and the ama-frontend repository in the same folder level.

/
└── ama/
    └── Dockerfile
└── ama-backend/
    └── Dockerfile
    └── docker-compose.yaml

[!NOTE] Using Docker, you will also need to manually do the migrations!

After the containers are up, run:

go run cmd/tools/terndotenv/main.go

πŸ” Postman

You can validate and manually test the API using Postman. Check here the Postman collection:

Run In Postman

πŸ™Œ Support this project

If you want to support this project, leave a ⭐.

Happy coding! πŸš€


Made with ❀️ by Rodrigo Molter.

Documentation ΒΆ

The Go Gopher

There is no documentation for this package.

Directories ΒΆ

Path Synopsis
cmd
ama
internal
api

Jump to

Keyboard shortcuts

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