I-connect
December 6, 2021 ยท View on GitHub
heroku link : https://i-connect.herokuapp.com/
CMPUT404-project-social-distribution-app
See Abram Hindle's project.org (plain-text/org-mode) for a description of the project.
Make a distributed social network!
This project's background, description and requirement are based on Abram Hindle's work, please check his project here.
Contributor
xiu |
frieda1 |
ztan4 |
xichen3 |
bi2 |
Welcome to join us by joining our slack channel!
Please use npm ci instead of npm install to install all the dependency for the front end
Demo video
YouTube Link: https://youtu.be/znyX1znNkLc
Development Process(from root dir)
virtualenv venv --python=python3.7 (if you did not get the virtual env)
source venv/bin/activate
pip install -r requirements.txt (to install all required libraries for backend using pip)
python manage.py runserver
# open another terminal
npm ci
npm start
#open browser and go to url localhost:8000 and/or localhost:3000 and start coding
Run all tests
virtualenv venv --python=python3.7 (if you did not get the virtual env)
source venv/bin/activate
pip install -r requirements.txt (to install all required libraries for backend using pip)
python manage.py test
Documentation
Development Admin Management
You can login to the page https://i-connect.herokuapp.com/admin/ to manage the database's entries. The credentials is:
username: admin
password: admin
API documentation
API specification
- service address: https://i-connect.herokuapp.com/service
- local port: 8000
- local hostname: 127.0.0.1 or localhost
- prefix of service: service
Online documentation
It is deployed by Heroku, you can view the doc here. The source code of the documentation is here. The API documentation is developed by swagger editor and swagger ui. They are under Apache 2.0 LICENSE.
Pagination
- We enables pagination for authors, comments and posts
- Use query string for get method to realize pagination
posts?page=4&size=40
Connection with other groups
-
Team 1:
- API endpoint: https://social-distance-api.herokuapp.com/
- Username for Basic Auth: team16
- Password for Basic Auth: socialdistance
-
Team 4:
- API endpoint: https://social-distribution-fall2021.herokuapp.com/api/
- Username for Basic Auth: team16
- Password for Basic Auth: secret16
-
Team 6:
- API endpoint: https://newconnection-server.herokuapp.com/api/v1/
- Username for Basic Auth: admin
- Password for Basic Auth: NewConnectionAdmin
Reference
Special reference
- The references used for single cases are decleared in code.
General reference
- Basic Auth: https://www.django-rest-framework.org/api-guide/authentication/#how-authentication-is-determined
- Serialization: https://www.django-rest-framework.org/tutorial/1-serialization/
- Django Query: https://docs.djangoproject.com/en/3.2/topics/db/queries/
- React Hooks: https://reactjs.org/docs/hooks-state.html and https://reactjs.org/docs/hooks-effect.html
- Material UI: https://mui.com/components/cards/ , https://mui.com/components/material-icons/ and https://mui.com/components/grid/
- Reactstrap: https://reactstrap.github.io/
- Axios: https://axios-http.com/docs/intro
- Test: https://www.django-rest-framework.org/api-guide/testing/
AJAX design
-
We used the library Axios, which is an AJAX and promises-based HTTP Client for node.JS and browser. It implements all API requests with AJAX call.
-
In this way, we can only retrieve necessary data from the server and handle the data on the client-side with JavaScript which improved the performance a lot compared with the original web application.
-
We used Axios for all requests so all of our requests are based on AJAX. For detail of each AJAX request, you can view our online documentation.