COSC-499-W2023 / year-long-project-team-8

year-long-project-team-8 created by GitHub Classroom
3 stars 3 forks source link

PassThePlate (Team 8)- Joss White, Alexander Roizman, Mackenzie Kudrenecky, Brandon Mack

Local Development Backend Start-Up

  1. Clone repo
    git clone git@github.com:COSC-499-W2023/year-long-project-team-8.git
  2. Navigate to project
    cd year-long-project-team-8
  3. Create a virtual environment in root
    python -m venv venv
    • Activate virtual environment
    • Windows:
      venv/Scripts/activate
    • Linux/Mac:
      source venv/bin/activate
  4. Navigate to drf directory
    cd app/drf
  5. Install backend dependencies
    pip install -r requirements.txt
  6. Navigate to backend
    cd backend
  7. Create a .env file and add your EMAIL_HOST_PASSWORD for SendGrid API key and SECRET_KEY for your Django project (Ask us what this is by emailing passtheplate9@gmail.com)
  8. Run migrations to set up local DB
    python manage.py makemigrations
    python manage.py migrate
  9. run server locally
    python manage.py runserver 0.0.0.0:8000
  10. The backend server is now up and running and is ready for communication with the frontend server
    • to access Django Rest Framework web GUI, you may need
      python manage.py runserver
  11. Development server available at http://127.0.0.1:8000/
  12. Upon setting up the environment, both frontend and backend servers can be launched with from project root with:
    ./startservers.bat
    • on Mac/Linux
      chmod +x startservers.sh
      ./startservers.sh

Production Backend Start-Up

How to run:

  1. Configure the front end, see frontend instructions and install expo go on the device, navigate to \app\drf\front-end and run:

    npx expo start
  2. Scan the QR code and pass those plates

Hosting and admin details

Local Development Front End

Production Font End

API Usage

HTTP Endpoints Action
POST /api/products Create a new product
GET /api/products Retrieve a list of all products
GET /api/products/?search=${query} Search for products with a query
GET /api/products/?categories=${categories} Filter products by category
GET /api/product/${productId} Get product details
PATCH /api/product/${productId} Update product details
DELETE /api/product/${productId} Delete a product
GET /api/products/?owner=${userId} Receive products linked to the owner
GET /api/users Get user list
POST /api/users Create a new user
GET /api/users/${userId} Get user details
PATCH /api/users/${userId} Update user details
DELETE /api/users/${userId} Delete a user
GET /api/my-products Get user-owned products
GET /api/images Get images associated with a product
POST /api/reviews Submit a review
POST /api/token Validate login credentials and receive tokens
POST /api/token/verify Verify current tokens
POST /api/token/refresh Refresh access token
POST /api/auth/change-password Send password reset code
PATCH /api/save_posts Toggle saved post for user
GET /api/chat/list Get list of chat instances
GET /api/chat/${chatId} Get chat messages for chat instance
POST /api/chat/${chatId} Send chat messages for chat instance