Git Product home page Git Product logo

cpe-kmutt-web's Introduction

CPE-KMUTT-Web

Getting Started

Preparing the server environment

Server Setup

Install Docker and Docker-compose follow this link

Prerequisites

  • MongoDB cli 4.x
  • Mongo Restore (For Remote/Server)
  • Ubuntu 18 (For server)
  • mongo-tools

Project Setup

Server Setup

clone project

git clone https://github.com/yee2542/CPE-KMUTT-Web
cd ./CPE-KMUTT-Web

Docker

run projecy via Docker in dev environment

$ docker-compose -f docker-compose.dev.yml up --build

Production deployment

for production running, please prepare .env.prod and

$ docker-compose -f docker-compose.prod.yml --env-file .env.prod up -d --build --scale frontend=3

please check the proxy config in nginx.conf to match the --scale setting

Issues

DB

when db not start cause have no permission to create dir e.g.

mkdir: cannot create directory

fix by this command

$ sudo chown -R 1001 ./db

Strapi

default admin account

username password
[email protected] Admin2021
Codegen

how to build a new API and generate native code for frontend

export const getServerSideProps: GetServerSideProps = async () => {
  const { data } = await client.query<GetHomeQuery>({
    query: GetHomeDocument,
    variables: { locale: "th" },
  });
  return {
    props: { data },
  };
};
Build Library

since we've a custom library for strapi e.g. WYSIWYG, it needed for external build before starting strapi by following these steps

# point to strapi plugin
$ cd ./strapi/plugins/wysiwyg

# install dependency for plugin
$ yarn

# build on /strapi
cd ../../
$ yarn build
Common issues

Due to conflicting dependencies, stop the cpe-kmutt-strapi container and delete /strapi/node_modules before restarting the strapi container to install a correct dependence on its own. Do not use yarn to install dependencies.

Restore Strapi data

For testing stage, using mongo-tools for restore a data.

$ cd /qa/strapi

$ mongorestore --host="localhost:27017" --username root --password cpeKMUTT@WebSite --authenticationDatabase admin

cpe-kmutt-web's People

Contributors

kkerberoz avatar nitpum avatar nom00548 avatar panpanpianchoopat avatar unkatreus avatar yeeezsh avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

cpe-kmutt-web's Issues

Strapi Document

update document for setup strapi

  1. build plugin
  2. build strapi

Main menu problem (Mobile)

image
Menu โผล่เกินขอบมาในหน้า News + Staffs และเวลาลากหน้าจอลงมาจะเห็นเมนูแอบอยู่ด้านหลัง

Bad staff rendering data

/staff/[staff_id]

bad mapping at research

image
image
image

raw data

{
  "data": {
    "staffs": [
      {
        "id": "634c1e85c9888d00376edb02",
        "title": "ผศ",
        "full_title": "ผู้ช่วยศาสตราจารย์",
        "name": "ชื่อจริง นามสกุล",
        "academic_position": "อาจารย์",
        "phone_number": "0910000000",
        "email": "[email protected]",
        "rooms": [
          {
            "room_id": "CPE1113",
            "title": "ห้องพัก"
          }
        ],
        "profile_image": {
          "url": "/files/test.png"
        },
        "subjects": [
          {
            "id": "634c2d77dbb3bf000eb807d4",
            "subject_id": "CPE101",
            "title": "Computer Programming"
          }
        ],
        "info": "<ul>\n<li>info</li>\n<li>info</li>\n<li>info</li>\n</ul>",
        "research": "<ul>\n<li>research</li>\n<li>research</li>\n<li>research</li>\n<li>&nbsp;</li>\n</ul>"
      },
      {
        "id": "634c1e8fc9888d00376edb04",
        "title": "ผศ",
        "full_title": "ผู้ช่วยศาสตราจารย์",
        "name": "AA นามสกุล 2",
        "academic_position": "อาจารย์",
        "phone_number": "0910000000",
        "email": null,
        "rooms": [],
        "profile_image": {
          "url": "/files/test.png"
        },
        "subjects": [],
        "info": null,
        "research": null
      }
    ]
  }
}

Bad docker-compose policy

the process does not automatically restart when running out of memory, or exit w/o sending a grateful exit signal.

Route by SEO link

/news is now only routed by id. It would be better to use an SEO link for the route.

example

http://localhost:5000/news/6251d112d76d140063baec29
#to
http://localhost:5000/news/announcement-freshmen

Carousal Bug

Screen Shot 2564-06-21 at 21 37 41

Components: src/common/components/Carousel/index.tsx
Bugs: progress bar not working when small-medium width window

Wrong data in main page

image
ข้อความต้องเป็นตามนี้สำหรับหนัาแรกครับ
image

Menu API

Todo

  • desktop menu section
  • mobile menu section
  • footer section
  • menu api
  • internal link
  • external link

desktop
design
image
implemented
image

mobile
design
image
implemented
image

footer
design
image
implemented
image

Conflict data on QA back up

Since yee restructure contents -> news api in Strapi, the default QA data is not compatible with new structure

Bad Strapi Upload

after re-create container, upload file will be lost. need to map /upload to local host

Gallery Support

needs

  • re-use tags by adding a new types of tags (news, gallery)
  • browse gallery (reuse /news/category/all)
  • add internal page /gallery
  • UI for gallery page

Staff API

Todo

  • [UI] common contact card
  • [API] staffs api

design
image

current implemented
image

Strapi-FE integration

Without creating an admin account, there is currently no way to bypass Strapi authentication. I want a token-based system.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.