Repository for Garex Sneakorum. Done by Gareth Yeo and Rex Yong as part of NUS orbital project. (Deployed code is on rex-production-test)
Garex Sneakorum is built using DJango and React.js. So far, the web application only allows users to log in, access the sneaker forum page to add and view threads.
- Project log https://docs.google.com/spreadsheets/d/1TpqGWD2BXQ9LmXTm3K0cyGhjbrelDNgj-mygXk2z0Wg/edit
- Project ReadMe document https://docs.google.com/document/d/1DBJkbkE8qRIKHXz5j7gsbSde9cerSz81Yis_hsEKv2M/edit
- Project Video
As of Milestone 3, the available features are
- Authentication function. Users can log in and log out of the web page
- Sneaker Forum. Users can create threads and comment on them, as well as use keywords to search for other threads.
- Calendar. Users can see latest sneaker releases on the homepage.
Project is created with:
- React.js
- Python Django
- Html 5 / CSS
- React Material UI
- HTML, CSS, React Bootstrap
- POSTGRES SQL
- Django REST Framework
- Render (Hosting)
The image below shows the files structrure of the project. Note that the frontend has both React and HTML. The authentication pages are in HTML and CSS, whereas the Forum was done in React.js
.png)
GFG is the Django Project Folder of the web page.
./settings.pyrelevant settings and configurations for web page./.envcontains the DATABASE_URL for deployment to Render. This folder is hidden by .gitignore, note that you will have to create a .env file and initialise the DATABASE_URL variable to the external database link if you wish to deploy on render as well../urls.pyroutes of the forum app API to provide endpoints for the client./views.pyconsists of different functions based on urls.py
authentication is the DJango APP in charge of all authentication related things in the web page.
./urls.pyroutes of the authentication app../views.pyconsists of different functions to enable authentication of user. The html pages are retrived fromtemplates/authenticationfolder shown in diagram../models.pydeclares the tables and fields for our authentication database
forum_api is the DJango APP in charge of the api related functions between frontend and backend.
./models.pydefined database models for forum../serializers.pydifferent classes to serialize database models./tests.pyempty file./urls.pyroutes of the forum app API to provide endpoints for the client./views.pyconsists of different functions to build the API
Under forum-react-app , contains the react folders build, public and src
./builda build directory with a production build of the forum app when commandnpm run buildis run in terminal../publiccontain favicon and index.html etc../srcstores contains all the source code of the React app, and it stores Reactpagesandcomponents../componentscontain different components of forum app such as GarexNavBar, GarexSneakorumLogo, ListThreads, NewThreadForm, ReplyThreadForm../pagesstores the pages of GarexSneakorum such as ForumHome and Thread.
- Clone and download the repository from github
- Ensure that you have downloaded the necessary technologies listed above.
Navigate to ...\GaRex-Sneakorum directory and create virtual environment. Then run the virtua environment on the terminal. Afterwards, install the requirements.txt file.
virtualenv venv
venv\Scripts\activate
pip install -r requirements.txt
Navigate to ...\GaRex-Sneakorum\forum-react-app directory and start react on localhost:3000.
npm start
Once the build folder has been created, copy this build folder and replace the build folder under ...\GaRex-Sneakorum\newstatic This is because the django app will look for the static files under newstatic folder, so make sure you replace this build folder.
Navigate to ...\GaRex-Sneakorum directory and run python server on localhost:8000
python manage.py runserver
The application will be available on http://127.0.0.1:3000/