Code Monkey home page Code Monkey logo

cheertimetable-web's Introduction

Overview

绮课简介

技术栈

get Started

此文档可能并不足够详尽,如遇到问题,请联系作者

prerequisite

  1. 你心爱的命令行终端和代码编辑器
  2. 安装 Node.JS 运行环境: Node.js 12.22.0 或更高版本;
  3. 安装 yarn
  4. 安装 MySQL 8.0

1. 克隆代码仓库

git clone https://github.com/huayemao/cheerTimetable-web.gitgit clone [email protected]:huayemao/cheerTimetable-web.git

2. 配置环境变量

  1. 数据库:准备一个 mysql 数据库实例,或者使用 PlanetScale 提供的服务,这也是目前绮课在生产环境所使用的。
  2. 获取教务系统 jwctest 环境以 kbuser 课表数据查询用户登录后获得的 cookie,详见 绮课如何从教务系统抓取数据 | Dors.——花野猫的数字花园
  3. 在项目根目录创建环境变量文件 .env,使用 MySQL 数据库连接字符串和获得的 COOKIE 填写以下环境变量
DATABASE_URL='mysql://root:huayemao123@localhost:3306/cheerTimetable'
COOKIE='JSESSION_ID=XXX'

3. 安装依赖

使用 npm installyarn命令安装 npm 依赖

4. 导入数据

  1. 运行 yarn db:generate
  2. 运行 yarn db:seed ,自动从教务系统导入数据

5. 开发调试

运行 yarn dev将以开发模式启动 Next.js 项目,更多请见 Next.js 文档

主要目录结构

├── _data // 以异步 IIFE 导出从教务系统获取数据所需的 JSON
├── components // React 组件
├── constants // 常量
├── contexts // 存放 React Contexts
├── lib // 抽出的工具函数
├── pages // Next.js 路由页面
├── prisma // 数据库相关,包括模式定义和数据库导入脚本

cheertimetable-web's People

Contributors

huayemao avatar steamfinder avatar

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.