Deckly is a flashcard application designed to make remembering things easier and more efficient. It leverages the spaced repetition technique to help users optimize their learning process by scheduling reviews at strategic intervals. Whether you're learning a new language, preparing for medical exams, or mastering any knowledge-intensive subject, Deckly is your go-to solution for boosting memory retention, reducing study time, and enhancing productivity.
The application is built using Next.js, Neon Postgres database with Drizzle, Shadcn and Tailwind CSS.
Displays an overview of all the decks created by the user. Includes options for creating new decks and managing existing ones.
Users can view all cards within a selected deck. This page allows the addition, editing, or deletion of cards.
Visualizes user activity and card statistics, providing insights into learning progress and overall performance.
Showcases the benefits of premium subscriptions, such as unlocking higher deck limits and gaining access to exclusive features.
To get started with the project, follow these steps:
DATABASE_URL
variable in the .env
file.GOOGLE_CLIENT_ID
and GOOGLE_CLIENT_SECRET
variables in the .env
file.GITHUB_CLIENT_ID
and GITHUB_CLIENT_SECRET
variables in the .env
file.STRIPE_SECRET_KEY
variable in the .env
file.STRIPE_STANDARD_PLAN_PRICE_ID
and STRIPE_PREMIUM_PLAN_PRICE_ID
variables in the .env
file respectively.stripe login
STRIPE_WEBHOOK_SECRET
variable in the .env
file.stripe listen --forward-to localhost:3000/api/webhooks/stripe
Open terminal and clone the repository:
git clone https://github.com/guanjunming/deckly.git
Navigate to the project directory:
cd deckly
Install the dependencies:
npm i --legacy-peer-deps
The --legacy-peer-deps flag is needed in order to resolve issues with installing packages that does not list React 19 as a peer dependency.
Create a .env
file in the project directory and add the following variables:
NEXT_PUBLIC_SERVER_URL= # Public server url. Use http://localhost:3000 for local development
DATABASE_URL= # Neon Postgres database connection string
AUTH_SECRET= # Secret key for Auth.js
GOOGLE_CLIENT_ID= # Google OAuth client ID
GOOGLE_CLIENT_SECRET= # Google OAuth client secret
GITHUB_CLIENT_ID= # GitHub OAuth client ID
GITHUB_CLIENT_SECRET= # GitHub OAuth client secret
STRIPE_SECRET_KEY= # Secret key for Stripe API access
STRIPE_STANDARD_PLAN_PRICE_ID= # Price ID for Standard Plan product defined in Stripe dashboard
STRIPE_PREMIUM_PLAN_PRICE_ID= # Price ID for Premium Plan product defined in Stripe dashboard
STRIPE_WEBHOOK_SECRET= # Stripe webhook signing secret generated from Stripe CLI
Create tables in the Neon Postgress database:
npm run db:migrate
Open terminal and run the server:
npm run dev
In another terminal, run the Stripe webhook listener:
npm run stripe:webhook
The project structure is organized as follows:
deckly/
├── public/ # Static files (images, icons)
├── src/
│ ├── app/ # App Router and API Route Handlers
│ ├── components/ # Reusable React components
│ ├── data/ # Constants and data configurations
│ ├── db/ # Drizzle database schema and migration
│ ├── hooks/ # Custom hooks
│ ├── lib/ # Utility functions
│ ├── schemas/ # Zod validation schemas
│ ├── types/ # Typescript type declarations
├── .env # Environment variables (not tracked in version control)
├── package.json # Dependencies and scripts