Skip to content

Repository files navigation

YumeLink

Business model reference : social media
Deployed link
May take a while to finish loading, but if it took longer than 1 minutes please contact me, so I may refresh the server.

Database files to load in data/ and media/ ,to which you can load following the Installation and Running Tutorial.

Installation & Run locally

1. Clone the repository

Run this in your terminal

git clone https://github.com/Karczel/YumeLink

2. Navigate to the project directory

cd YumeLink

3. Create a virtual environment

python -m venv myenv

4. Activate the Virtual environment

For Mac/Linux

source myenv/bin/activate

For Windows

.\myenv\Scripts\activate

5. Install requirements

pip install -r requirement.txt

6. Create your own .env file

In the sample.env file, we have provided everything necessary to run the file, So you can duplicate and rename it to .env

To create a .env file in terminal

For Mac/Linux

cp sample.env .env

For windows

copy sample.env .env

You'll have to create your own neon.tech Postgre database and Amazon S3 to connect with the application
Follow these tutorial, you only have to get values for your .env
neon.tech Postgre database
Amazon S3 tutorial

7. Makemigrations

python manage.py makemigrations

8. Migrate

python manage.py migrate
python manage.py runserver

9. Load data

Media files First, download awscli

Windows

choco install awscli

Mac/Linux

brew install awscli

log in to your amazon cli

aws configure

input your aws configuration data

If the aws configuration data is correct, then you'd be able to load media/ into S3 with

aws s3 sync media/ s3://<your-bucket-name> --region <your-region-name>

Relational files

For Windows

for %f in (data\*.json) do python manage.py loaddata "%f"

For Mac/Linux

for file in data/*.json; do
    python manage.py loaddata $file
done

if you ran into loaddata errors, you simply rerun those commands again until no error reports appears

Running the Application

1. After you've finished the Installation Tutorial

you can run the application; run this in your terminal from the project directory

python manage.py runserver

if static files did not load properly, quit previous (CTRL+C) and use this instead

python manage.py runserver --insecure

2. Use your web browser of choice

type this in your web browser's URL bar

localhost:8000

or

127.0.0.1:8000

And you should be redirected to the Yumelink home page

!Caution Some web browser may block the application due to security concerns (like Safari)
Try Google Chrome or Brave.

3. Saving data

Your data are saved to cloud database (neon.tech Postgres, Amazon S3) up-to-date in real-time
But if you want to save your questions and choices locally
To save your data

Windows

python manage.py dumpdata auth.user --indent 4 > data\users.json

Mac/Linux

  • users
python3 manage.py dumpdata auth.user --indent 4 > data/users.json
  • app models

Windows

for %model in (chatroom, tag, user, notification, follow, post, comment, like, chatrank, chatrequest, chatrole, message, posttag, share, block, postimage, reporttype, report, userinterest, userdisinterest) do (
    python manage.py dumpdata <yourappname>.%model --indent 4 > data\%model%.json
)

Mac/Linux

for model in chatroom tag user notification follow post comment like chatrank chatrequest chatrole message posttag share block postimage reporttype report userinterest userdisinterest; do
    python3 manage.py dumpdata <yourappname>.$model --indent 4 > data/${model}.json
done

To save your media files
First, download awscli

Windows

choco install awscli

Mac/Linux

brew install awscli

log in to your amazon cli

aws configure

input your aws configuration data
If the aws configuration data is correct, then you'd be able to load media into media/ with

aws s3 sync s3://<your-bucket-name> --region <your-region-name> media/  

4. Terminate the running application

Ctrl+C to stop the running web application. If you've accidentally pressed Ctrl+Z and can't run the application again, follow these instructions

  1. Type this in your terminal For Mac/Linux
    sudo is added to execute the command with superuser(root) privileges
sudo lsof -i :8000
//The second column of the output is the <PID>

Then replace in this code below and run,

sudo kill <PID>
//or
sudo kill -9 <PID>

or

Mac Searching the PID in your Activity Moniter, right click, and press Quit.

For Windows

netstat -ano | findstr :8000
//The last column is the <PID>

Then replace in this code below and run,

taskkill /PID <PID> /F

5. Exit virtual environment

run this in your virtual environment

deactivate

Existing demo users and passwords

DEMO

username pwd
abc iamabc1234
karczel iamkarczel1234
mammothx iammammoth1234
tanfan iamtanfan1234

About

Database project

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages