MiniShare is a lightweight content sharing platform designed to let users connect and share moments through a simple, intuitive interface. Built as a containerized microservice application, MiniShare demonstrates modern software engineering practices while providing core social media functionality.
Visit the website here: MiniShare
Key features include:
- Google OAuth integration for simplified login
- Image sharing with captions
- User profiles with customizable bios
- Follow/unfollow functionality to connect with other users
- Comment system for engagement
- Responsive UI that works on both desktop and mobile devices
MiniShare is composed of two main microservices:
- Web Application (
frontend-app
): A Flask-based web application that handles user interface, authentication, and business logic - Database Service (
db
): A MongoDB database service that provides data persistence
Both services are containerized and can be deployed independently.
- Docker
- Docker Compose
- MongoDB Atlas account (for database hosting)
-
Clone the repository:
git clone https://github.com/software-students-spring2025/5-final-deployed-app.git cd 5-final-deployed-app
-
Create a
.env
file in the project root based on the provided.env.example
:MONGO_URI=mongodb+srv://username:password@cluster.example.mongodb.net/?retryWrites=true&w=majority SECRET_KEY=your_secret_key_here # Google OAuth settings (for "Sign in with Google") GOOGLE_CLIENT_ID=your_google_client_id_here GOOGLE_CLIENT_SECRET=your_google_client_secret_here # DEVELOPMENT or PRODUCTION: set to 'True' for debug logging locally, 'False' on servers DEBUG=True
-
Set up MongoDB Atlas:
- Create a MongoDB Atlas account if you don't have one
- Create a new cluster
- In the cluster, create a database named
project5_db
with collections:userInfo
posts
comments
follows
- Create a database user with read/write access
- Get your connection string and update the
MONGO_URI
in your.env
file
-
Set up Google OAuth:
- Go to the Google Developer Console
- Create a new project
- Enable the Google+ API and Google OAuth API
- Create OAuth consent screen (External)
- Create OAuth credentials (Web application)
- Add authorized redirect URIs:
http://127.0.0.1:8080/auth/login/google/callback
http://localhost:8080/auth/login/google/callback
- Get your client ID and client secret and update the
GOOGLE_CLIENT_ID
andGOOGLE_CLIENT_SECRET
in your.env
file
-
Build and start the services using Docker Compose:
docker-compose up --build
-
Access the application at
http://localhost:8080
If you want to run the application directly on your machine for development:
-
Create a Python virtual environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
-
Run the Flask application:
cd frontend-app python app.py
The MiniShare application provides the following RESTful API endpoints:
- POST
/auth/register
: Register a new user - POST
/auth/login
: Log in an existing user - GET
/auth/logout
: Log out the current user - GET
/auth/login/google
: Initiate Google OAuth login
- GET
/main/profile/<username>
: View a user's profile - POST
/main/edit-profile
: Edit the current user's profile - POST
/main/follow/<username>
: Follow a user - POST
/main/unfollow/<username>
: Unfollow a user - GET
/main/profile/<username>/followers
: View a user's followers - GET
/main/profile/<username>/following
: View users that a user is following
- GET
/main/feed
: View recent posts - GET
/main/create-post
: View post creation form - POST
/main/create-post
: Create a new post - POST
/main/post/<post_id>/comment
: Add a comment to a post - POST
/main/post/<post_id>/delete
: Delete a post
- Clone this project to your repository
- add .env file locally (not pushed) into your root directory
- Go to DigitalOcean App Platform.
- Click Create App → GitHub Repository → select this repo.
- Go to DigitalOcean App → Settings → Components→ Commands
- Manually edit the run command to: python frontend-app/app.py
- Go to DigitalOcean App → Settings → Environment Variables
- manually add: MONGO_URI,SECRET_KEY, GOOGLE_CLIENT_ID, and GOOGLE_CLIENT_SECRET (which are provide by .env)
- Save settings.
- Click Deploy.
- Wait for build → deployment → health checks → Success.
- Then you can visit the website via the link generate by DigitalOcean
cd db
pytest
cd frontend-app
pytest
pytest db --cov=db --cov-report=term-missing
cd frontend-app
pytest --cov=. --cov-report=term-missing
This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.