feat: enhance README and website configuration with new MinIO setup and error handling for GitHub stars fetch
This commit is contained in:
@@ -124,13 +124,34 @@ The repository also contains shared packages under `packages/` (for example `pac
|
|||||||
- `apps/dashboard/.env`: `PUBLIC_SERVER_URL`, `PRIVATE_SERVER_KEY`, `PUBLIC_IS_SELFHOSTED`
|
- `apps/dashboard/.env`: `PUBLIC_SERVER_URL`, `PRIVATE_SERVER_KEY`, `PUBLIC_IS_SELFHOSTED`
|
||||||
- Optional for self-hosted Enterprise-only features (SSO, token-auth, no-tracking): set `LICENSE_KEY` in `apps/api/.env`
|
- Optional for self-hosted Enterprise-only features (SSO, token-auth, no-tracking): set `LICENSE_KEY` in `apps/api/.env`
|
||||||
|
|
||||||
6. Start local infrastructure for API (Postgres + Redis + db-init):
|
6. Start local infrastructure for API (Postgres + Redis) and seed the DB:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker compose -f docker/docker-compose.yaml up -d postgres redis db-init
|
docker compose -f docker/docker-compose.yaml up -d postgres redis db-init
|
||||||
```
|
```
|
||||||
|
|
||||||
7. Run the local app services in separate terminals:
|
- Connect with `DATABASE_URL=postgresql://postgres:postgres@localhost:5432/classroomio`
|
||||||
|
- Connect with `REDIS_URL=redis://localhost:6379`
|
||||||
|
- The `db-init` container runs migrations/seed once Postgres is healthy.
|
||||||
|
|
||||||
|
7. (Optional) Start MinIO locally for object storage (media/documents):
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker compose -f docker/docker-compose.yaml --profile minio up -d minio minio-init
|
||||||
|
```
|
||||||
|
|
||||||
|
- Console: http://localhost:9001 (user/pass default `minioadmin` / `minioadmin`)
|
||||||
|
- S3 endpoint: http://localhost:9000
|
||||||
|
- Buckets created by `minio-init`: `videos`, `documents`, `media`
|
||||||
|
- Add to `apps/api/.env` when using MinIO locally:
|
||||||
|
- `OBJECT_STORAGE_ENDPOINT=http://localhost:9000`
|
||||||
|
- `OBJECT_STORAGE_PUBLIC_ENDPOINT=http://localhost:9000`
|
||||||
|
- `OBJECT_STORAGE_ACCESS_KEY_ID=minioadmin`
|
||||||
|
- `OBJECT_STORAGE_SECRET_ACCESS_KEY=minioadmin`
|
||||||
|
- `OBJECT_STORAGE_FORCE_PATH_STYLE=true`
|
||||||
|
- `OBJECT_STORAGE_MEDIA_PUBLIC_BASE_URL=http://localhost:9000/media`
|
||||||
|
|
||||||
|
8. Run the local app services in separate terminals:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
pnpm api:dev
|
pnpm api:dev
|
||||||
@@ -140,17 +161,17 @@ The repository also contains shared packages under `packages/` (for example `pac
|
|||||||
pnpm dashboard:dev
|
pnpm dashboard:dev
|
||||||
```
|
```
|
||||||
|
|
||||||
8. Default local URLs:
|
9. Default local URLs:
|
||||||
|
|
||||||
- `api`: [http://localhost:3002](http://localhost:3002)
|
- `api`: [http://localhost:3002](http://localhost:3002)
|
||||||
- `dashboard`: [http://localhost:5173](http://localhost:5173)
|
- `dashboard`: [http://localhost:5173](http://localhost:5173)
|
||||||
|
|
||||||
9. Optional: run other apps:
|
10. Optional: run other apps:
|
||||||
|
|
||||||
- **website**: `pnpm website:dev`
|
- **website**: `pnpm website:dev`
|
||||||
- **docs**: `pnpm dev --filter=@cio/docs`
|
- **docs**: `pnpm dev --filter=@cio/docs`
|
||||||
|
|
||||||
10. Login into `dashboard`:
|
11. Login into `dashboard`:
|
||||||
|
|
||||||
- Visit [http://localhost:5173/login](http://localhost:5173/login)
|
- Visit [http://localhost:5173/login](http://localhost:5173/login)
|
||||||
- Enter email: `admin@test.com`
|
- Enter email: `admin@test.com`
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
"dev": "vite dev --port 5174",
|
"dev": "vite dev --port 5174",
|
||||||
"build": "vite build",
|
"build": "vite build",
|
||||||
"preview": "vite preview",
|
"preview": "vite preview",
|
||||||
|
"start": "node build",
|
||||||
"check": "svelte-kit sync && svelte-check --tsconfig ./jsconfig.json",
|
"check": "svelte-kit sync && svelte-check --tsconfig ./jsconfig.json",
|
||||||
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./jsconfig.json --watch",
|
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./jsconfig.json --watch",
|
||||||
"format": "prettier --write .",
|
"format": "prettier --write .",
|
||||||
@@ -13,7 +14,7 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@cio/tsconfig": "workspace:*",
|
"@cio/tsconfig": "workspace:*",
|
||||||
"@sveltejs/adapter-auto": "^3.0.0",
|
"@sveltejs/adapter-node": "^2.0.0",
|
||||||
"@sveltejs/adapter-vercel": "^4.0.0",
|
"@sveltejs/adapter-vercel": "^4.0.0",
|
||||||
"@sveltejs/kit": "^2.5.27",
|
"@sveltejs/kit": "^2.5.27",
|
||||||
"@sveltejs/vite-plugin-svelte": "^4.0.0",
|
"@sveltejs/vite-plugin-svelte": "^4.0.0",
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
import { redirect } from '@sveltejs/kit';
|
import { redirect } from '@sveltejs/kit';
|
||||||
import { client } from '$lib/utils/posthog';
|
import { client } from '$lib/utils/posthog';
|
||||||
|
|
||||||
|
export const prerender = false;
|
||||||
|
|
||||||
export const load = ({ request }) => {
|
export const load = ({ request }) => {
|
||||||
client.capture({
|
client.capture({
|
||||||
distinctId: request.headers.get('x-forwarded-for') || new Date().getTime().toString(),
|
distinctId: request.headers.get('x-forwarded-for') || new Date().getTime().toString(),
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
import { redirect } from '@sveltejs/kit';
|
import { redirect } from '@sveltejs/kit';
|
||||||
|
|
||||||
|
export const prerender = false;
|
||||||
|
|
||||||
export const load = async () => {
|
export const load = async () => {
|
||||||
redirect(307, 'https://docs.google.com/presentation/d/1eqvNPNk167ZcP21gZGVAatdDpWAFL9lfmWJHHrzsVFc');
|
redirect(307, 'https://docs.google.com/presentation/d/1eqvNPNk167ZcP21gZGVAatdDpWAFL9lfmWJHHrzsVFc');
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
import { redirect } from '@sveltejs/kit';
|
import { redirect } from '@sveltejs/kit';
|
||||||
import { client } from '$lib/utils/posthog';
|
import { client } from '$lib/utils/posthog';
|
||||||
|
|
||||||
|
export const prerender = false;
|
||||||
|
|
||||||
export const load = ({ request }) => {
|
export const load = ({ request }) => {
|
||||||
client.capture({
|
client.capture({
|
||||||
distinctId: request.headers.get('x-forwarded-for') || new Date().getTime().toString(),
|
distinctId: request.headers.get('x-forwarded-for') || new Date().getTime().toString(),
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
import { redirect } from '@sveltejs/kit';
|
import { redirect } from '@sveltejs/kit';
|
||||||
import { client } from '$lib/utils/posthog';
|
import { client } from '$lib/utils/posthog';
|
||||||
|
|
||||||
|
export const prerender = false;
|
||||||
|
|
||||||
export const load = async ({ request }) => {
|
export const load = async ({ request }) => {
|
||||||
client.capture({
|
client.capture({
|
||||||
distinctId: request.headers.get('x-forwarded-for') || new Date().getTime().toString(),
|
distinctId: request.headers.get('x-forwarded-for') || new Date().getTime().toString(),
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
import { redirect } from '@sveltejs/kit';
|
import { redirect } from '@sveltejs/kit';
|
||||||
|
|
||||||
|
export const prerender = false;
|
||||||
|
|
||||||
export const load = async () => {
|
export const load = async () => {
|
||||||
redirect(307, 'https://t.me/thebestafricans');
|
redirect(307, 'https://t.me/thebestafricans');
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
import { dev } from '$app/environment';
|
import { dev } from '$app/environment';
|
||||||
import { redirect } from '@sveltejs/kit';
|
import { redirect } from '@sveltejs/kit';
|
||||||
|
|
||||||
|
export const prerender = false;
|
||||||
|
|
||||||
export const load = async () => {
|
export const load = async () => {
|
||||||
const url = dev ? 'http://localhost:5173' : 'https://app.classroomio.com';
|
const url = dev ? 'http://localhost:5173' : 'https://app.classroomio.com';
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
import { redirect } from '@sveltejs/kit';
|
import { redirect } from '@sveltejs/kit';
|
||||||
|
|
||||||
|
export const prerender = false;
|
||||||
|
|
||||||
export const load = async () => {
|
export const load = async () => {
|
||||||
redirect(307, 'https://www.producthunt.com/posts/classroomio-2');
|
redirect(307, 'https://www.producthunt.com/posts/classroomio-2');
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
import { redirect } from '@sveltejs/kit';
|
import { redirect } from '@sveltejs/kit';
|
||||||
import { client } from '$lib/utils/posthog';
|
import { client } from '$lib/utils/posthog';
|
||||||
|
|
||||||
|
export const prerender = false;
|
||||||
|
|
||||||
export const load = async ({ request }) => {
|
export const load = async ({ request }) => {
|
||||||
client.capture({
|
client.capture({
|
||||||
distinctId: request.headers.get('x-forwarded-for') || new Date().getTime().toString(),
|
distinctId: request.headers.get('x-forwarded-for') || new Date().getTime().toString(),
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
import { client } from '$lib/utils/posthog';
|
import { client } from '$lib/utils/posthog';
|
||||||
import { redirect } from '@sveltejs/kit';
|
import { redirect } from '@sveltejs/kit';
|
||||||
|
|
||||||
|
export const prerender = false;
|
||||||
|
|
||||||
export const load = ({ request, url }) => {
|
export const load = ({ request, url }) => {
|
||||||
client.capture({
|
client.capture({
|
||||||
distinctId: request.headers.get('x-forwarded-for') || new Date().getTime().toString(),
|
distinctId: request.headers.get('x-forwarded-for') || new Date().getTime().toString(),
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
import { redirect } from '@sveltejs/kit';
|
import { redirect } from '@sveltejs/kit';
|
||||||
import { client } from '$lib/utils/posthog';
|
import { client } from '$lib/utils/posthog';
|
||||||
|
|
||||||
|
export const prerender = false;
|
||||||
|
|
||||||
export const load = async ({ request }) => {
|
export const load = async ({ request }) => {
|
||||||
client.capture({
|
client.capture({
|
||||||
distinctId: request.headers.get('x-forwarded-for') || new Date().getTime().toString(),
|
distinctId: request.headers.get('x-forwarded-for') || new Date().getTime().toString(),
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
import { redirect } from '@sveltejs/kit';
|
import { redirect } from '@sveltejs/kit';
|
||||||
|
|
||||||
|
export const prerender = false;
|
||||||
|
|
||||||
export const load = async () => {
|
export const load = async () => {
|
||||||
redirect(307, 'https://form.classroomio.com/f/1v25DtmN');
|
redirect(307, 'https://form.classroomio.com/f/1v25DtmN');
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -27,9 +27,15 @@ async function getStars() {
|
|||||||
|
|
||||||
console.log('Fetching stars from GitHub');
|
console.log('Fetching stars from GitHub');
|
||||||
|
|
||||||
const response = await fetch('https://api.github.com/repos/classroomio/classroomio');
|
let stars = 0;
|
||||||
const data = await response.json();
|
|
||||||
const stars = data?.stargazers_count || 0;
|
try {
|
||||||
|
const response = await fetch('https://api.github.com/repos/classroomio/classroomio');
|
||||||
|
const data = await response.json();
|
||||||
|
stars = data?.stargazers_count || 0;
|
||||||
|
} catch (error) {
|
||||||
|
console.log('error fetching stars', error);
|
||||||
|
}
|
||||||
|
|
||||||
starsCache.set(CACHE_KEY, { stars, lastUpdated: now });
|
starsCache.set(CACHE_KEY, { stars, lastUpdated: now });
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
import { redirect } from '@sveltejs/kit';
|
import { redirect } from '@sveltejs/kit';
|
||||||
|
|
||||||
|
export const prerender = false;
|
||||||
|
|
||||||
export const load = ({ request }) => {
|
export const load = ({ request }) => {
|
||||||
redirect(307, 'https://heyform.net/f/1qkguGkN');
|
redirect(307, 'https://heyform.net/f/1qkguGkN');
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,16 +1,17 @@
|
|||||||
import adapterNode from '@sveltejs/adapter-auto';
|
import { escapeSvelte, mdsvex } from 'mdsvex';
|
||||||
import adapterVercel from '@sveltejs/adapter-vercel';
|
|
||||||
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
|
|
||||||
import { fileURLToPath } from 'node:url';
|
|
||||||
import { dirname } from 'node:path';
|
|
||||||
import { mdsvex, escapeSvelte } from 'mdsvex';
|
|
||||||
import path from 'path';
|
|
||||||
import shiki from 'shiki';
|
|
||||||
import remarkUnwrapImages from 'remark-unwrap-images';
|
|
||||||
import remarkToc from 'remark-toc';
|
|
||||||
import rehypeSlug from 'rehype-slug';
|
|
||||||
|
|
||||||
const useNodeAdapter = process.env.PUBLIC_IS_SELFHOSTED === 'true';
|
import adapterNode from '@sveltejs/adapter-node';
|
||||||
|
import adapterVercel from '@sveltejs/adapter-vercel';
|
||||||
|
import { dirname } from 'node:path';
|
||||||
|
import { fileURLToPath } from 'node:url';
|
||||||
|
import path from 'path';
|
||||||
|
import rehypeSlug from 'rehype-slug';
|
||||||
|
import remarkToc from 'remark-toc';
|
||||||
|
import remarkUnwrapImages from 'remark-unwrap-images';
|
||||||
|
import shiki from 'shiki';
|
||||||
|
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
|
||||||
|
|
||||||
|
const useNodeAdapter = process.env.VERCEL !== '1' && process.env.VERCEL !== 'true';
|
||||||
|
|
||||||
/** @type {import('@sveltejs/kit').Config}*/
|
/** @type {import('@sveltejs/kit').Config}*/
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user