This project has been made to provide a backend for blog websites. It is a modern and cloud native backend application. It is made with a CRUD API easy to use.
-
Add authentication with OAuth2/OIDC
-
Add comments
-
Add likes
-
Full test coverage
To run this project, you will need some env variables.
If you want to develop, add variables in a .development.env file in the root folder.
DB_USERNAME
username to be used with the mongoDB database.
DB_PASSWORD
password for the db.
DB_HOST
host where the db is hosted
DB_NAME
the database name to use for the project.
If you want to run it in production, pass those env variable without .env file.
Clone the project
git clone https://github.com/DzeCin/blog-backend.git
Go to the project directory
cd blog-backend
Build the docker image
docker build -t blog:v1 .
Create a .development.env file and setup env variables
Start the docker container
docker run --env-file=.development.env --rm --publish 8080:8080 blog:v1
To run tests, run the following command
go test ./tests