First of all, thanks for contributing!
All means of contributions are Welcome!
If you are familiar with python
, nodejs
or html
,
don't hesitate to make your own changes to it!
You can even improve this README.md
page if you have some markdown
skills!
If you are not familiar with a programming language but have some fastinating ideas, leave your comments for us!
-
Go to issues page
-
Press
New Issue
button. -
Leave your comments!
-
Fork this project.
-
Pull your forked repo to your local machine.
git clone http://github.com/your_user_name/your_folked_repo.git
-
Create a new branch
develop
or something else likea-new-feature
on your local machine.git checkout -b name_of_your_new_branch
-
Do some editing & commit it
# edit... git status # check your edits git add -A # add all updated files to cache git commit -m "your commit message" # commit it git push origin name_of_your_new_branch
-
Start a pull request
Some detailed information for building this website on your machine are described in the following sections.
WARNING: The database has some major changes in Cindy-Realtime, which means you CANNOT upgrade from Cindy
simply running python3 manage.py makemigrations && python3 manage.py migrate
,
which can modify your database but will DROP SOME EXISTING DATA.
To upgrade from Cindy
-
Make sure you are at a node BEFORE an existing
cindy@v5.X
tag. -
Checkout to branch relay-channels:
git checkout origin/relay-channels
-
Run
upgrade.py
under./upgrade-from-cindy/
folderdepending on how your database is initialized, you may have to manually add the
RenameField
s in migration files. -
Make sure you have your previous files in
/sui_hei/migrations
. If not, runpython3 manage.py migrate
incindy-realtime@v0.0.0
, which will give you a initialized migration file. Checkout tocindy-realtime@master
after that. -
Then upgrade the database as you did before
python3 manage.py makemigrations; python3 manage.py migrate
-
Clone this repo to your machine if you have
git
, otherwize download the zip archive by clicking the button up-right. -
Install requisitories. Make sure
python3
exists in your PATH. -
Configure your MySQL database
-
customize
cindy/mysql.cnf
file. A template is here. -
open mysql, create a user and a database, grant all previlidges to it.
# note that you need to chage all <>s to the value in your mysql.cnf. create database <database> character set utf-8; create user '<user>'@'<host>' identified by <password>; grant all on <database> to '<user>'@'<host>'; quit
-
have django generate the database for you
python3 manage.py makemigrations # Alternatively, drag `manage.py` to the python3 manage.py migrate # terminal to avoid `cd` operations.
-
-
Run server on your localhost.
- For Linux Users or Mac Users,
cd
to the root of the cloned/unzipped folder, and runpython3 manage.py runserver
. - For Windows Users,
open a
cmd
window, and typepython3 <drag the manage.py here> runserver
- For Linux Users or Mac Users,
-
Open the link (http://localhost:8000) appeared in your terminal/cmd with a browser.
This chapter is specially for explaning the whole project to programmers.
.
├── cindy
│ ├── __init__.py
│ ├── settings.py
│ ├── security.py.template # Security configurations. please
│ │ # rename it to `security.py` for your preferences.
│ ├── urls.py
│ └── wsgi.py
├── mysql.cnf.template # tempate of config of mysql. please
│ # rename it to `mysql.cnf` for your preferences.
├── LICENSE # licence file
├── manage.py # auto-generated manage script by django
├── README.md # the description file you are reading!
├── locale/ # folder storing language files
└── sui_hei/ # folder storing the main site project.
├── admin.py # modules visible in /admin
├── apps.py # apps config file.
├── models.py # models storing data structure.
├── static/ # folder storing static files, e.g. css, js, png, etc.
├── templates # folder storing HTML templates
│ └── index.html # entry point
├── tests.py # file for testing the project
├── urls.py # url patterns of the website
├── views.py # create pages from templates. Pass variables here.
└── translation.py # modeltranslation
-
To update the database:
python3 manage.py makemigrations && python3 manage.py migrate
Do this after modifying, or making pulls with changes in
/sui_hei/models.py
. -
To update the graphql schema files
- Apply changes in
/sui_hei/schema.py
:python3 manage.py graphql_schema
- Apply changes in
graphql\
query{}`in javascript:
npm run relay`
... or you can simply run
make schema
to update both. - Apply changes in
-
To generate bundles
- If you are developing, run
npm run debug-main
. - If you are deploying, run
npm run prod-main
.
or you can run watch mode for webpack if you frequently update javascript files:
./node_modules/webpack -w
- If you are developing, run
-
To generate language files
python3 manage.py makemessages -d djangojs --ignore node_modules python3 manage.py makemessages
-
To compile language files
python3 manage.py compilemessages
The latest commit may have some changes in sui_hei/models.py and you have to update your local database manually by running
python3 manage.py makemigrations && python3 manage.py migrate