Welcome to StudyBud-Go, a web application inspired by Discord, designed to enhance learning and facilitate information exchange in group settings. This Go-based version builds on the foundation laid by Denis Ivy's original Django project, offering a robust platform for creating virtual spaces to discuss topics, share knowledge, and collaborate effectively.
-
Account Creation and Registration:
- Users can sign up and create an account.
- Secure login allows users to access their accounts.
-
Room Creation:
- Create rooms on various topics to encourage conversation and study.
-
Room Participation:
- Join existing rooms and engage in discussions.
-
Messaging:
- Send and receive messages within rooms.
-
Recent Activities Log:
- Stay informed about ongoing activities and conversations.
-
Searching:
- Search for topics or discussions to join and participate in.
- Go: Programming language for core development.
- go-chi: Router for handling HTTP requests.
- Redis: Session management and authentication.
- PostgreSQL: Database for data storage.
- GORM: ORM library for database interactions.
- zerolog: Logging library for efficient logging.
StudyBud-Go utilizes Clean Architecture principles for a scalable and maintainable codebase, structured into:
- Entities: Core business logic and data models.
- Use Cases: Application-specific business rules.
- Interface Adapters: Interfaces for interacting with external systems.
- Frameworks and Drivers: Go’s standard library and third-party frameworks.
- Docker and Docker Compose installed
-
Clone the Repository:
git clone https://github.com/ElyarSadig/StudyBud-Go.git
-
Navigate to the Project Directory:
cd StudyBud-Go
-
Setup Environment Variables: Create a
.env
file in the project root directory with the following contents:DB_USER=admin DB_PASSWORD=password REDIS_PASSWORD=password REDIS_USERNAME=root SESSION_PRIVATE_KEY=password12345678
-
Start the Services: Use Docker Compose to build and start the application and its dependencies:
docker-compose up -d
This command will build and start the application along with its dependencies (PostgreSQL and Redis) in detached mode.
-
Run the Application: The Dockerfile specifies the
CMD
to run the application with theconfig-stage.yaml
configuration file, migration, and seeding by default. If you need to run different commands, modify the Dockerfile or override theCMD
at runtime. -
Access the Application:
- The application will be available at
http://localhost:8080
.
- The application will be available at
-
Dockerfile Configuration:
- The
Dockerfile
is set up to copy the application binary and configuration files into the Docker image. - Configuration is handled through
config-stage.yaml
, which is copied into the/configs
directory inside the container. - To modify configurations, update
config-stage.yaml
or build with different configurations.
- The
-
Environment Variables:
- Make sure your
.env
file is properly configured with the necessary environment variables.
- Make sure your
- Application Health Check:
The application exposes a health check endpoint at
http://localhost:8080/health
. Docker Compose uses this endpoint to verify that the application is running correctly.
- Based on the original StudyBud project developed with Django by Denis Ivy.
- Thanks to the Go community for their valuable tools and libraries.
Contributions are welcome! Just submit a pull request :)