Halffancyy / Web-Project2

EDM 4 Life full stack project
MIT License
0 stars 0 forks source link

EDM 4 Life

EDM 4 Life

The best EDM music forum (for us)

Purpose

EDM 4 Life is designed to create a vibrant community for EDM music enthusiasts. Users can register, log in, create posts, comment, and like posts. The points system encourages user engagement by rewarding daily logins, likes, comments, and posts. This application aims to foster a lively and interactive environment for EDM fans to share and discuss their favorite music.

Prerequisites

Ensure you have the following installed on your machine:

Setup

macOS/Linux

1. Configure Virtual Environment

Open a terminal and navigate to your project directory. Then run the following commands to set up a virtual environment:

python3 -m venv venv
source venv/bin/activate

2. Install Dependencies

With the virtual environment activated, install the required packages:

pip install -r requirements.txt

3. Set Environment Variables

Set the FLASK_APP environment variable to point to your application entry point. This will tell Flask how to find your application.

export FLASK_APP=app.py

4. Run the Application

Start the Flask development server:

flask run

Windows

1. Configure Virtual Environment

python3 -m venv venv
venv/bin/activate

2. Install Dependencies

pip install -r requirements.txt

3. Set Environment Variables

set FLASK_APP=app.py

4.Run the Application

flask run

By default, the application will run on http://127.0.0.1:5000/.

Stopping the Application

To stop the Flask development server, you can use Ctrl + C in the terminal where the server is running.

Killing the Process

If you need to kill the process manually (e.g., if the server is still running in the background), you can find the process ID (PID) and kill it:

On macOS/Linux:

Find the process ID using:

lsof -i :5000

Kill the process:

kill -9 <PID>

Usage

User Registration

  1. Open your browser and navigate to the registration page.
  2. Fill in the username, email, and password fields, then click "Register".
  3. Upon successful registration, you will be redirected to the login page.

User Login

  1. On the login page, enter your username and password, then click "Login".
  2. After a successful login, you will be redirected to the dashboard page, displaying a welcome message and your points.

Points System

Our points system rewards user engagement with various activities on the platform:

This system is designed to encourage daily participation and contribute positively to our community. Thank you for being an active member!

Creating and Managing Posts

Create a Post

  1. On the dashboard page, click the "Create Request" button.
  2. Fill in the post title and description, then click "Submit".
  3. The new post will appear in the post list on the dashboard page.

Commenting and Liking Posts

  1. Find a post you are interested in on the dashboard page.
  2. Click the "Comment" button below the post, fill in your comment, and submit.
  3. Click the "Like" button to like the post.

Editing and Deleting Comments

Edit a Comment

  1. Locate the comment you want to edit in the comment list.
  2. Click the "Edit" button next to the comment, modify the content, and submit.

Delete a Comment

  1. Locate the comment you want to delete in the comment list.
  2. Click the "Delete" button next to the comment, and confirm the deletion.

Testing

1. Unit Tests

Our unit tests test the email and password validation and request creation. To run unit tests, use the following command:

python -m unittest tests.test_basic

2. System Tests

Our system tests test login functionality and compatibility with Chrome browser. To run system tests, use the following command:

python -m unittest tests.test_system

Contributing

| Name | Github Username(s) | Student ID | | ---------- | -----------| -----------| | Shijun Shao | Halffancyy | 23926903 | | Weisi Zhang |Wiz6666 | 23210735 | | Chen Shen | jerryshenfewcher, wsscnha | 23877677 | | Jiaheng Gu | HendrickGu | 23925667 |

License

This project is licensed under the MIT License - see the LICENSE file for details.