Coder Social home page Coder Social logo

112-1-hack2's Introduction

Run the project

Install dependencies

yarn

Environment variables

Create a .env.local file in the root of the project and add the following variables:

POSTGRES_URL=postgres://postgres:postgres@localhost:5432/hack2

AUTH_SECRET=<ANY_RANDOM_STRING>
AUTH_GITHUB_ID=
AUTH_GITHUB_SECRET=

NEXT_PUBLIC_BASE_URL=http://localhost:3000

Get Github OAuth credentials (Optional)

本次考試不會評分 Github 登入的部分,但是如果懶得打帳號密碼,可以參考以下步驟:

  • Go to Settings tab of your Github account

  • Click Developer settings on the left sidebar

  • Click OAuth Apps on the left sidebar

  • Click New OAuth App

  • Enter the following information:

    • Application name: Notion Clone (or any name you like)
    • Homepage URL: http://localhost:3000
    • Authorization callback URL: http://localhost:3000/api/auth/callback/github
  • Click Register application

  • Copy the Client ID and Client Secret to your .env.local file:

    AUTH_GITHUB_ID=<Client ID>
    AUTH_GITHUB_SECRET=<Client Secret>
    

    Note that in NextAuth v5, the prefix AUTH_ is required for the env variables.

    Note that you do not have to add those keys to src/lib/env/private.ts since they are automatically handled by NextAuth.

Database

  1. Start database
docker compose up -d
  1. Run migrations
yarn migrate

Start the server

yarn dev

Setup tests

yarn playwright install chromium # Install Chromium (if not already installed)
yarn playwright install-deps chromium # Install Chromium dependencies (if not already installed)

Run tests

yarn test

題目說明

112-1-hack2's People

Contributors

madmaxieee avatar ric2k1 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.