From f243775ae6d362a6923f384196bf1ce8b9e884c4 Mon Sep 17 00:00:00 2001 From: Wayne <5291640+ringoinca@users.noreply.github.com> Date: Thu, 10 Jul 2025 13:32:54 +0300 Subject: [PATCH] scaffolding --- .env.example | 22 ++++ .gitignore | 20 ++++ CODE_OF_CONDUCT.md | 121 ++++++++++++++++++++ CONTRIBUTING.md | 49 ++++++++ README.md | 80 +++++++++++++ docker-compose.yml | 66 +++++++++++ package.json | 21 ++++ packages/backend/package.json | 24 ++++ packages/backend/src/index.ts | 15 +++ packages/backend/tsconfig.json | 10 ++ packages/frontend/.gitignore | 23 ++++ packages/frontend/.npmrc | 1 + packages/frontend/.prettierignore | 9 ++ packages/frontend/.prettierrc | 18 +++ packages/frontend/README.md | 38 ++++++ packages/frontend/package.json | 30 +++++ packages/frontend/src/app.css | 1 + packages/frontend/src/app.d.ts | 13 +++ packages/frontend/src/app.html | 12 ++ packages/frontend/src/lib/index.ts | 1 + packages/frontend/src/routes/+layout.svelte | 7 ++ packages/frontend/src/routes/+page.svelte | 2 + packages/frontend/static/favicon.svg | 1 + packages/frontend/svelte.config.js | 12 ++ packages/frontend/tsconfig.json | 19 +++ packages/frontend/vite.config.ts | 7 ++ packages/types/package.json | 14 +++ packages/types/src/index.ts | 7 ++ packages/types/tsconfig.json | 11 ++ pnpm-workspace.yaml | 2 + tsconfig.base.json | 13 +++ 31 files changed, 669 insertions(+) create mode 100644 .env.example create mode 100644 .gitignore create mode 100644 CODE_OF_CONDUCT.md create mode 100644 CONTRIBUTING.md create mode 100644 README.md create mode 100644 docker-compose.yml create mode 100644 package.json create mode 100644 packages/backend/package.json create mode 100644 packages/backend/src/index.ts create mode 100644 packages/backend/tsconfig.json create mode 100644 packages/frontend/.gitignore create mode 100644 packages/frontend/.npmrc create mode 100644 packages/frontend/.prettierignore create mode 100644 packages/frontend/.prettierrc create mode 100644 packages/frontend/README.md create mode 100644 packages/frontend/package.json create mode 100644 packages/frontend/src/app.css create mode 100644 packages/frontend/src/app.d.ts create mode 100644 packages/frontend/src/app.html create mode 100644 packages/frontend/src/lib/index.ts create mode 100644 packages/frontend/src/routes/+layout.svelte create mode 100644 packages/frontend/src/routes/+page.svelte create mode 100644 packages/frontend/static/favicon.svg create mode 100644 packages/frontend/svelte.config.js create mode 100644 packages/frontend/tsconfig.json create mode 100644 packages/frontend/vite.config.ts create mode 100644 packages/types/package.json create mode 100644 packages/types/src/index.ts create mode 100644 packages/types/tsconfig.json create mode 100644 pnpm-workspace.yaml create mode 100644 tsconfig.base.json diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..b79c2dd --- /dev/null +++ b/.env.example @@ -0,0 +1,22 @@ +# Application +NODE_ENV=development +PORT_BACKEND=4000 +PORT_FRONTEND=3000 + +# PostgreSQL +POSTGRES_DB=open_archive +POSTGRES_USER=admin +POSTGRES_PASSWORD=password +DATABASE_URL="postgresql://admin:password@postgres:5432/open_archive?schema=public" + +# Redis +REDIS_HOST=redis +REDIS_PORT=6379 + +# Meilisearch +MEILI_MASTER_KEY=aSampleMasterKey +MEILI_HOST=http://meilisearch:7700 + +# JWT +JWT_SECRET="a-very-secret-key" +JWT_EXPIRES_IN="7d" diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..fda06f7 --- /dev/null +++ b/.gitignore @@ -0,0 +1,20 @@ +# Node +node_modules +dist +.env +.env.* +!/.env.example + +# PNPM +pnpm-lock.yaml +pnpm-debug.log + +# IDE +.vscode +.idea + +# OS +.DS_Store + +# Dev +.dev \ No newline at end of file diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..9f388d1 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,121 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +We as members, contributors, and leaders pledge to make participation in our +community a harassment-free experience for everyone, regardless of age, body +size, visible or invisible disability, ethnicity, sex characteristics, gender +identity and expression, level of experience, education, socio-economic status, +nationality, personal appearance, race, religion, or sexual identity +and orientation. + +We pledge to act and interact in ways that are welcoming, open, and respectful. + +## Our Standards + +Examples of behavior that contributes to a positive environment for our +community include: + +- Demonstrating empathy and kindness toward other people +- Being respectful of differing opinions, viewpoints, and experiences +- Giving and gracefully accepting constructive feedback +- Accepting responsibility and apologizing to those affected by our mistakes, + and learning from the experience +- Focusing on what is best not just for us as individuals, but for the + overall community + +Examples of unacceptable behavior include: + +- The use of sexualized language or imagery, and sexual attention or + advances of any kind +- Trolling, insulting or derogatory comments, and personal or political attacks +- Public or private harassment +- Publishing others' private information, such as a physical or email + address, without their explicit permission +- Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Enforcement Responsibilities + +Community leaders are responsible for clarifying and enforcing our standards of +acceptable behavior and will take appropriate and fair corrective action in +response to any behavior that they deem inappropriate, threatening, offensive, +or harmful. + +Community leaders have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, and will communicate reasons for moderation +decisions when appropriate. + +## Scope + +This Code of Conduct applies within all community spaces, and also applies when +an individual is officially representing the community in public spaces. +Examples of representing our community include using an official e-mail address, +posting via an official social media account, or acting as an appointed +representative at an online or offline event. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported to the community leaders responsible for enforcement at +[INSERT CONTACT METHOD]. +All complaints will be reviewed and investigated promptly and fairly. + +All community leaders are obligated to respect the privacy and security of the +reporter of any incident. + +## Enforcement Guidelines + +Community leaders will follow these Community Impact Guidelines in determining +the consequences for any action they deem in violation of this Code of Conduct: + +### 1. Correction + +**Community Impact**: Use of inappropriate language or other behavior deemed +unprofessional or unwelcome in the community. + +**Consequence**: A private, written warning from community leaders, providing +clarity around the nature of the violation and an explanation of why the +behavior was inappropriate. A public apology may be requested. + +### 2. Warning + +**Community Impact**: A violation through a single incident or series +of actions. + +**Consequence**: A warning with consequences for continued behavior. No +interaction with the people involved, including unsolicited interaction with +those enforcing the Code of Conduct, for a specified period of time. This +includes avoiding interaction in community spaces as well as external channels +like social media. Violating these terms may lead to a temporary or +permanent ban. + +### 3. Temporary Ban + +**Community Impact**: A serious violation of community standards, including +sustained inappropriate behavior. + +**Consequence**: A temporary ban from any sort of interaction or public +communication with the community for a specified period of time. No public or +private interaction with the people involved, including unsolicited interaction +with those enforcing the Code of Conduct, is allowed during this period. +Violating these terms may lead to a permanent ban. + +### 4. Permanent Ban + +**Community Impact**: Demonstrating a pattern of violation of community +standards, including sustained inappropriate behavior, harassment of an +individual, or aggression toward or disparagement of classes of individuals. + +**Consequence**: A permanent ban from any sort of public interaction within +the community. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], +version 2.1, available at +[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1]. + +[homepage]: https://www.contributor-covenant.org +[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..44401a9 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,49 @@ +# Contributing to Open Archive + +First off, thank you for considering contributing to Open Archive! It's people like you that make open source such a great community. We welcome any and all contributions. + +## Where do I start? + +Not sure where to start? You can: + +- Look through the [open issues](https://github.com/your-username/open-archive/issues) for bugs or feature requests. +- Check the issues labeled `good first issue` for tasks that are a good entry point into the codebase. + +## How to Contribute + +### Reporting Bugs + +If you find a bug, please ensure the bug was not already reported by searching on GitHub under [Issues](https://github.com/your-username/open-archive/issues). If you're unable to find an open issue addressing the problem, open a new one. Be sure to include a **title and clear description**, as much relevant information as possible, and a **code sample** or an **executable test case** demonstrating the expected behavior that is not occurring. + +### Suggesting Enhancements + +If you have an idea for an enhancement, please open an issue to discuss it. This allows us to coordinate our efforts and prevent duplication of work. + +### Pull Requests + +1. **Fork the repository** and create your branch from `main`. +2. **Set up your development environment** by following the instructions in the `README.md`. +3. **Make your changes.** Ensure your code follows the project's coding style. +4. **Write tests** for any new functionality. +5. **Ensure all tests pass** before submitting your pull request. +6. **Update the documentation** if your changes require it. +7. **Submit a pull request** to the `main` branch of the main repository. Please provide a clear description of the problem and solution. Include the relevant issue number if applicable. + +## Code of Conduct + +This project and everyone participating in it is governed by the [Open Archive Code of Conduct](CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code. Please report unacceptable behavior. + +## Styleguides + +### Git Commit Messages + +- Use the present tense ("Add feature" not "Added feature"). +- Use the imperative mood ("Move cursor to..." not "Moves cursor to..."). +- Limit the first line to 72 characters or less. +- Reference issues and pull requests liberally after the first line. + +### TypeScript Styleguide + +- Follow the existing code style. +- Use TypeScript's strict mode. +- Avoid using `any` as a type. Define clear interfaces and types in the `packages/types` directory. diff --git a/README.md b/README.md new file mode 100644 index 0000000..b874052 --- /dev/null +++ b/README.md @@ -0,0 +1,80 @@ +# Open Archive + +**A secure, sovereign, and affordable open-source platform for email archiving and eDiscovery.** + +Open Archive empowers individuals and organizations to take control of their digital communication history. It provides a robust, self-hosted solution for ingesting, storing, and searching emails from major platforms, ensuring you have a permanent, tamper-proof record of your most critical data, free from vendor lock-in. + +## Vision + +To provide individuals and organizations with a secure, sovereign, and affordable platform to preserve and access their digital communication history, free from vendor lock-in. + +## Key Features + +- **Universal Ingestion**: Connect to Google Workspace, Microsoft 365, and standard IMAP servers to perform initial bulk imports and maintain continuous, real-time synchronization. +- **Secure & Efficient Storage**: Emails are stored in the standard `.eml` format. The system uses deduplication and compression to minimize storage costs. All data is encrypted at rest. +- **Pluggable Storage Backends**: Start with local filesystem storage and scale to S3-compatible object storage (like AWS S3 or MinIO) as your needs grow. +- **Powerful Search & eDiscovery**: A high-performance search engine indexes the full text of emails and attachments (PDF, DOCX, etc.). The intuitive UI supports advanced search operators, filtering, and case management. +- **Compliance & Retention**: Define granular retention policies to automatically manage the lifecycle of your data. Place legal holds on communications to prevent deletion during litigation. +- **Comprehensive Auditing**: An immutable audit trail logs all system activities, ensuring you have a clear record of who accessed what and when. +- **Role-Based Access Control (RBAC)**: Enforce the principle of least privilege with pre-defined roles for Administrators, Auditors, and End Users. + +## Tech Stack + +Open Archive is built on a modern, scalable, and maintainable technology stack: + +- **Frontend**: SvelteKit with Svelte 5 +- **Backend**: Node.js with Express.js & TypeScript +- **Job Queue**: BullMQ on Redis for robust, asynchronous processing +- **Search Engine**: Meilisearch for blazingly fast and resource-efficient search +- **Database**: PostgreSQL for metadata, user management, and audit logs +- **Deployment**: Docker Compose for easy, one-command deployment + +## Getting Started + +### Prerequisites + +- [Docker](https://docs.docker.com/get-docker/) and [Docker Compose](https://docs.docker.com/compose/install/) +- A server or local machine with at least 2GB of RAM. + +### Installation + +1. **Clone the repository:** + + ```bash + git clone https://github.com/your-username/open-archive.git + cd open-archive + ``` + +2. **Configure your environment:** + Copy the example environment file and customize it with your settings. + + ```bash + cp .env.example .env + ``` + + You will need to edit the `.env` file to set your database passwords, secret keys, and other essential configuration. + +3. **Run the application:** + + ```bash + docker-compose up -d + ``` + + This command will build the necessary Docker images and start all the services (frontend, backend, database, etc.) in the background. + +4. **Access the application:** + Once the services are running, you can access the Open Archive web interface by navigating to `http://localhost:5173` in your web browser. + +## Contributing + +We welcome contributions from the community! Whether you're a developer, a designer, or just an enthusiast, there are many ways to get involved. + +- **Reporting Bugs**: If you find a bug, please open an issue on our GitHub repository. +- **Suggesting Enhancements**: Have an idea for a new feature? We'd love to hear it. Open an issue to start the discussion. +- **Code Contributions**: If you'd like to contribute code, please fork the repository and submit a pull request. + +Please read our `CONTRIBUTING.md` file for more details on our code of conduct and the process for submitting pull requests. + +## License + +This project is licensed under the MIT License - see the `LICENSE` file for details. diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..094812b --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,66 @@ +version: '3.8' + +services: + frontend: + build: + context: ./packages/frontend + dockerfile: Dockerfile + ports: + - '3000:3000' + depends_on: + - backend-api + env_file: + - ./.env + + backend-api: + build: + context: ./packages/backend + dockerfile: Dockerfile + ports: + - '4000:4000' + depends_on: + - postgres + - redis + env_file: + - ./.env + + worker: + build: + context: ./packages/backend + dockerfile: Dockerfile + command: 'pnpm run start:worker' + depends_on: + - postgres + - redis + env_file: + - ./.env + + postgres: + image: postgres:15 + ports: + - '5432:5432' + volumes: + - postgres_data:/var/lib/postgresql/data + env_file: + - ./.env + + redis: + image: redis:7 + ports: + - '6379:6379' + volumes: + - redis_data:/data + + meilisearch: + image: getmeili/meilisearch:v1.3 + ports: + - '7700:7700' + volumes: + - meili_data:/meili_data + env_file: + - ./.env + +volumes: + postgres_data: + redis_data: + meili_data: diff --git a/package.json b/package.json new file mode 100644 index 0000000..ef3bcdf --- /dev/null +++ b/package.json @@ -0,0 +1,21 @@ +{ + "name": "open-archive", + "private": true, + "scripts": { + "dev": "pnpm --filter \"./packages/*\" --parallel dev", + "build": "pnpm --filter \"./packages/*\" --parallel build" + }, + "devDependencies": { + "typescript": "^5.0.0" + }, + "packageManager": "pnpm@10.13.1", + "engines": { + "node": ">=18.0.0", + "pnpm": ">=8.0.0" + }, + "pnpm": { + "onlyBuiltDependencies": [ + "esbuild" + ] + } +} \ No newline at end of file diff --git a/packages/backend/package.json b/packages/backend/package.json new file mode 100644 index 0000000..b020bb7 --- /dev/null +++ b/packages/backend/package.json @@ -0,0 +1,24 @@ +{ + "name": "@open-archive/backend", + "version": "0.1.0", + "private": true, + "main": "dist/index.js", + "scripts": { + "dev": "ts-node-dev --respawn --transpile-only src/index.ts ", + "build": "tsc", + "start": "node dist/index.js", + "start:worker": "ts-node-dev --respawn --transpile-only src/workers/ingestion.worker.ts" + }, + "dependencies": { + "@open-archive/types": "workspace:*", + "express": "^5.1.0", + "bullmq": "^5.56.3", + "dotenv": "^17.2.0" + }, + "devDependencies": { + "@types/express": "^5.0.3", + "@types/node": "^24.0.12", + "ts-node-dev": "^2.0.0", + "typescript": "^5.8.3" + } +} diff --git a/packages/backend/src/index.ts b/packages/backend/src/index.ts new file mode 100644 index 0000000..22868bc --- /dev/null +++ b/packages/backend/src/index.ts @@ -0,0 +1,15 @@ +import express from 'express'; +import dotenv from 'dotenv'; + +dotenv.config(); + +const app = express(); +const port = process.env.PORT_BACKEND || 8000; + +app.get('/', (req, res) => { + res.send('Backend is running!'); +}); + +app.listen(port, () => { + console.log(`Backend listening at http://localhost:${port}`); +}); diff --git a/packages/backend/tsconfig.json b/packages/backend/tsconfig.json new file mode 100644 index 0000000..c1be55f --- /dev/null +++ b/packages/backend/tsconfig.json @@ -0,0 +1,10 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "outDir": "./dist", + "rootDir": "./src", + "composite": true + }, + "include": ["src/**/*.ts"], + "exclude": ["node_modules", "dist"] +} diff --git a/packages/frontend/.gitignore b/packages/frontend/.gitignore new file mode 100644 index 0000000..3b462cb --- /dev/null +++ b/packages/frontend/.gitignore @@ -0,0 +1,23 @@ +node_modules + +# Output +.output +.vercel +.netlify +.wrangler +/.svelte-kit +/build + +# OS +.DS_Store +Thumbs.db + +# Env +.env +.env.* +!.env.example +!.env.test + +# Vite +vite.config.js.timestamp-* +vite.config.ts.timestamp-* diff --git a/packages/frontend/.npmrc b/packages/frontend/.npmrc new file mode 100644 index 0000000..b6f27f1 --- /dev/null +++ b/packages/frontend/.npmrc @@ -0,0 +1 @@ +engine-strict=true diff --git a/packages/frontend/.prettierignore b/packages/frontend/.prettierignore new file mode 100644 index 0000000..7d74fe2 --- /dev/null +++ b/packages/frontend/.prettierignore @@ -0,0 +1,9 @@ +# Package Managers +package-lock.json +pnpm-lock.yaml +yarn.lock +bun.lock +bun.lockb + +# Miscellaneous +/static/ diff --git a/packages/frontend/.prettierrc b/packages/frontend/.prettierrc new file mode 100644 index 0000000..b19073e --- /dev/null +++ b/packages/frontend/.prettierrc @@ -0,0 +1,18 @@ +{ + "useTabs": true, + "singleQuote": true, + "trailingComma": "none", + "printWidth": 100, + "plugins": [ + "prettier-plugin-svelte", + "prettier-plugin-tailwindcss" + ], + "overrides": [ + { + "files": "*.svelte", + "options": { + "parser": "svelte" + } + } + ] +} diff --git a/packages/frontend/README.md b/packages/frontend/README.md new file mode 100644 index 0000000..b5b2950 --- /dev/null +++ b/packages/frontend/README.md @@ -0,0 +1,38 @@ +# sv + +Everything you need to build a Svelte project, powered by [`sv`](https://github.com/sveltejs/cli). + +## Creating a project + +If you're seeing this, you've probably already done this step. Congrats! + +```bash +# create a new project in the current directory +npx sv create + +# create a new project in my-app +npx sv create my-app +``` + +## Developing + +Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server: + +```bash +npm run dev + +# or start the server and open the app in a new browser tab +npm run dev -- --open +``` + +## Building + +To create a production version of your app: + +```bash +npm run build +``` + +You can preview the production build with `npm run preview`. + +> To deploy your app, you may need to install an [adapter](https://svelte.dev/docs/kit/adapters) for your target environment. diff --git a/packages/frontend/package.json b/packages/frontend/package.json new file mode 100644 index 0000000..2034817 --- /dev/null +++ b/packages/frontend/package.json @@ -0,0 +1,30 @@ +{ + "name": "frontend", + "private": true, + "version": "0.0.1", + "type": "module", + "scripts": { + "dev": "vite dev", + "build": "vite build", + "preview": "vite preview", + "prepare": "svelte-kit sync || echo ''", + "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json", + "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch", + "format": "prettier --write .", + "lint": "prettier --check ." + }, + "devDependencies": { + "@sveltejs/adapter-auto": "^6.0.0", + "@sveltejs/kit": "^2.16.0", + "@sveltejs/vite-plugin-svelte": "^5.0.0", + "@tailwindcss/vite": "^4.0.0", + "prettier": "^3.4.2", + "prettier-plugin-svelte": "^3.3.3", + "prettier-plugin-tailwindcss": "^0.6.11", + "svelte": "^5.0.0", + "svelte-check": "^4.0.0", + "tailwindcss": "^4.0.0", + "typescript": "^5.0.0", + "vite": "^6.2.6" + } +} diff --git a/packages/frontend/src/app.css b/packages/frontend/src/app.css new file mode 100644 index 0000000..d4b5078 --- /dev/null +++ b/packages/frontend/src/app.css @@ -0,0 +1 @@ +@import 'tailwindcss'; diff --git a/packages/frontend/src/app.d.ts b/packages/frontend/src/app.d.ts new file mode 100644 index 0000000..da08e6d --- /dev/null +++ b/packages/frontend/src/app.d.ts @@ -0,0 +1,13 @@ +// See https://svelte.dev/docs/kit/types#app.d.ts +// for information about these interfaces +declare global { + namespace App { + // interface Error {} + // interface Locals {} + // interface PageData {} + // interface PageState {} + // interface Platform {} + } +} + +export {}; diff --git a/packages/frontend/src/app.html b/packages/frontend/src/app.html new file mode 100644 index 0000000..1391f88 --- /dev/null +++ b/packages/frontend/src/app.html @@ -0,0 +1,12 @@ + + + + + + + %sveltekit.head% + + +
%sveltekit.body%
+ + diff --git a/packages/frontend/src/lib/index.ts b/packages/frontend/src/lib/index.ts new file mode 100644 index 0000000..856f2b6 --- /dev/null +++ b/packages/frontend/src/lib/index.ts @@ -0,0 +1 @@ +// place files you want to import through the `$lib` alias in this folder. diff --git a/packages/frontend/src/routes/+layout.svelte b/packages/frontend/src/routes/+layout.svelte new file mode 100644 index 0000000..3153e95 --- /dev/null +++ b/packages/frontend/src/routes/+layout.svelte @@ -0,0 +1,7 @@ + + +{@render children()} diff --git a/packages/frontend/src/routes/+page.svelte b/packages/frontend/src/routes/+page.svelte new file mode 100644 index 0000000..cc88df0 --- /dev/null +++ b/packages/frontend/src/routes/+page.svelte @@ -0,0 +1,2 @@ +

Welcome to SvelteKit

+

Visit svelte.dev/docs/kit to read the documentation

diff --git a/packages/frontend/static/favicon.svg b/packages/frontend/static/favicon.svg new file mode 100644 index 0000000..cc5dc66 --- /dev/null +++ b/packages/frontend/static/favicon.svg @@ -0,0 +1 @@ +svelte-logo \ No newline at end of file diff --git a/packages/frontend/svelte.config.js b/packages/frontend/svelte.config.js new file mode 100644 index 0000000..6adee23 --- /dev/null +++ b/packages/frontend/svelte.config.js @@ -0,0 +1,12 @@ +import adapter from '@sveltejs/adapter-auto'; +import { vitePreprocess } from '@sveltejs/vite-plugin-svelte'; + +/** @type {import('@sveltejs/kit').Config} */ +const config = { + // Consult https://svelte.dev/docs/kit/integrations + // for more information about preprocessors + preprocess: vitePreprocess(), + kit: { adapter: adapter() } +}; + +export default config; diff --git a/packages/frontend/tsconfig.json b/packages/frontend/tsconfig.json new file mode 100644 index 0000000..0b2d886 --- /dev/null +++ b/packages/frontend/tsconfig.json @@ -0,0 +1,19 @@ +{ + "extends": "./.svelte-kit/tsconfig.json", + "compilerOptions": { + "allowJs": true, + "checkJs": true, + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "resolveJsonModule": true, + "skipLibCheck": true, + "sourceMap": true, + "strict": true, + "moduleResolution": "bundler" + } + // Path aliases are handled by https://svelte.dev/docs/kit/configuration#alias + // except $lib which is handled by https://svelte.dev/docs/kit/configuration#files + // + // If you want to overwrite includes/excludes, make sure to copy over the relevant includes/excludes + // from the referenced tsconfig.json - TypeScript does not merge them in +} diff --git a/packages/frontend/vite.config.ts b/packages/frontend/vite.config.ts new file mode 100644 index 0000000..2d35c4f --- /dev/null +++ b/packages/frontend/vite.config.ts @@ -0,0 +1,7 @@ +import tailwindcss from '@tailwindcss/vite'; +import { sveltekit } from '@sveltejs/kit/vite'; +import { defineConfig } from 'vite'; + +export default defineConfig({ + plugins: [tailwindcss(), sveltekit()] +}); diff --git a/packages/types/package.json b/packages/types/package.json new file mode 100644 index 0000000..d115ab0 --- /dev/null +++ b/packages/types/package.json @@ -0,0 +1,14 @@ +{ + "name": "@open-archive/types", + "version": "0.1.0", + "private": true, + "main": "dist/index.js", + "types": "dist/index.d.ts", + "scripts": { + "build": "tsc", + "dev": "tsc --watch" + }, + "devDependencies": { + "typescript": "^5.0.0" + } +} diff --git a/packages/types/src/index.ts b/packages/types/src/index.ts new file mode 100644 index 0000000..e9b0f21 --- /dev/null +++ b/packages/types/src/index.ts @@ -0,0 +1,7 @@ +export type UserRole = 'Admin' | 'Auditor' | 'EndUser'; + +export interface User { + id: string; + email: string; + role: UserRole; +} diff --git a/packages/types/tsconfig.json b/packages/types/tsconfig.json new file mode 100644 index 0000000..03428d6 --- /dev/null +++ b/packages/types/tsconfig.json @@ -0,0 +1,11 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "outDir": "./dist", + "rootDir": "./src", + "composite": true, + "declaration": true + }, + "include": ["src/**/*.ts"], + "exclude": ["node_modules", "dist"] +} diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml new file mode 100644 index 0000000..9a36b40 --- /dev/null +++ b/pnpm-workspace.yaml @@ -0,0 +1,2 @@ +packages: + - 'packages/*' diff --git a/tsconfig.base.json b/tsconfig.base.json new file mode 100644 index 0000000..372bacf --- /dev/null +++ b/tsconfig.base.json @@ -0,0 +1,13 @@ +{ + "compilerOptions": { + "target": "ESNext", + "module": "ESNext", + "moduleResolution": "node", + "strict": true, + "esModuleInterop": true, + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true, + "resolveJsonModule": true, + "isolatedModules": true + } +}