This is my first project in Go, where I've developed a fully functional blog application with a focus on security, efficiency, and user experience. Key features and technologies implemented include:
JWT Authentication: Secure user authentication using JSON Web Tokens for session management.
Middlewares: Developed custom middleware to verify JWTs, ensuring only authenticated users can access protected routes.
Password Hashing: Leveraged bcrypt for secure password storage, ensuring user credentials are safely hashed.
OTP Verification: Implemented a robust signup process with One-Time Password (OTP) verification, enhancing user registration security.
Cloudinary Integration: Successfully integrated Cloudinary for image uploads, allowing users to manage their profile pictures seamlessly.
Database Interaction without ORM: Utilized raw SQL queries for MySQL database interactions, gaining hands-on experience with direct database management and optimization.
Input Validation: Incorporated comprehensive input validation to ensure data integrity and prevent malicious input.
Bloom Filters: Implemented Bloom filters to efficiently check for existing emails during user registration, optimizing performance for large databases.
CORS Management: Configured Cross-Origin Resource Sharing (CORS) to enable secure interactions between the frontend and backend.
This project not only showcases my technical skills in Go but also reflects my commitment to building secure and efficient applications. The experience gained from this project has strengthened my understanding of backend development principles and has equipped me with practical knowledge in handling real-world application challenges.
Tech Used
Go Built the HTTP server and backend logic.
Cloudinary Cloud service to handle image uploads for user profiles.
Docker Containerized the application for ease of deployment and consistency across environments.
As part of my learning journey, I'm excited to experiment with building this blog application in C# and PostgreSQL to explore new technologies and enhance my skills!
Run the command to download all the dependencies to your local machine:
go mod vendor
Now you will need to apply all the migrations in your database. First install goose locally:
go install github.com/pressly/goose/v3/cmd/goose@latest
Move to the migrations directory:
cd src/database/migrations
Run the command to apply the migrations. Make sure to modify the command to have your's used MySQL database url in the .env. Make sure to have a database created before-hand:
goose mysql "root:YOUR_PASSWORD@tcp(127.0.0.1:3306)/Blog_App_Go" up
After applying the migrations traverse back to the root directory: