Skip to content

davidpaley/learning-cards

Repository files navigation

About this project

The objective of this project is to use spaced repetition to remember things.

You create Decks and every deck has Cards. The cards can be in different "levels", from 1 to 5. Cards in different levels, has different frecuencies to show up in the application. Cards in level:

  1. are shown every day
  2. are shown every 3 days
  3. are shown every 7 days
  4. are shown every 15 days
  5. are shown every 30 days

This is the file where it is configured.

All cards start in level 1. Every time you reply a card ok, it will go to the next level (you will answer it less frecuently). If you reply wrong, it will go to level 1 again.

Learn more about Spaced repetition

You can learn about space repetition here and here.

Deployment

This project is deployed here with Vercel and Heroku for the database.

Technologies used

Technologies used for this project

Getting started

Clone the project and install dependencies

  • Clone this repository:

git clone [email protected]:danimontanaro/nowports-phone-book-app.git

  • Install dependencies:
yarn
# or
npm i

Create .env file

  • Create .env file file in the root of the project with the following variables:
DB_URL=file:./dev.db # if you are going to use sqlite
NEXT_PUBLIC_HOST=http://localhost:3000
GITHUB_CLIENT_ID=
GITHUB_CLIENT_SECRET=
NEXTAUTH_SECRET= # for local testing set any number here
NEXTAUTH_URL=http://localhost:3000
  • For GITHUB_CLIENT_ID and GITHUB_CLIENT_SECRET follow this instructions:
  1. Go to your GitHub settings. Select Applications > Developer applications tab.
  2. Pick an existing application or hit Register new application.
  3. Set a few parameters for your application and get the Client ID and Client Secret.
  4. After that, with the Client ID and Client secret you can set these variables.

Set up the database

  • Change provider variable in schema.prisma file provider = "sqlite"

  • Set your Database in the .env file, setting the DB_URL

DB_URL=postgres://davidpaley@localhost:5432/davidpaley # if you are using local sqlite
  • Run the following command to create your database file.
npx prisma migrate dev`

If you are using a deployed postgres DB, you could use this command to initialize the DB:

npx prisma db push --preview-feature
// https://github.com/prisma/prisma/issues/4571

Start the project in localhost

  • Start the REST API server running
yarn dev
# or
npm run dev

The server is now running on http://localhost:3000.