Web based flashcard app with FSRS support.
To get started with this project, clone the repository and install dependencies:
git clone https://github.com/AungS8430/kotoboss.git
npm installThen, fill in the .env file with your own values. You can use the .env.example or the following as a reference.
AUTH_GOOGLE_ID=
AUTH_GOOGLE_SECRET=
AUTH_SECRET=
ASTRO_DB_APP_TOKEN=
ASTRO_DB_REMOTE_URL=Note:
AUTH_GOOGLE_IDandAUTH_GOOGLE_SECRETare used for Google OAuth authentication, get one from https://console.cloud.google.com/apis/dashboardAUTH_SECRETis used for session encryption, you can generate one usingopenssl rand -base64 32ASTRO_DB_APP_TOKENandASTRO_DB_REMOTE_URLare used for connecting to the database using Astro DB, read more at https://astro.build/db
To start the development server, run:
npm run devThis will start a local server at http://localhost:4321, and you can view your site in the browser.
To add test data to the database, create db/seed.ts file and add your test data there.
Before building Kotoboss, push the database schema to the database first. You can do this by running:
astro db push --remoteTo build your site for production, run:
npm run build --remoteNote: The --remote flag is used to build the site for remote deployment, which is required for Astro DB.
To deploy your site on Vercel, follow these steps:
- Create a new project on Vercel and link it to your GitHub repository.
- In the Vercel dashboard, go to the "Settings" tab of your project
- Add the environment variables from your
.envfile to the Vercel project settings:AUTH_GOOGLE_IDAUTH_GOOGLE_SECRETAUTH_SECRETASTRO_DB_APP_TOKENASTRO_DB_REMOTE_URL
- Set the build command to
npm run build --remote - (Optional) Use Turso for database in your project's Storage tab
- Run
astro db push --remoteto push the database schema to your remote database
All commands are run from the root of the project, from a terminal:
| Command | Action |
|---|---|
npm install |
Installs dependencies |
npm run dev |
Starts local dev server at localhost:4321 |
npm run build --remote |
Build your production site to ./dist/ |
npm run astro ... |
Run CLI commands like astro add, astro check |
npm run astro -- --help |
Get help using the Astro CLI |