Skip to content

Commit

Permalink
v0.1.0 (#31)
Browse files Browse the repository at this point in the history
* [DEV-41] add auto migration to envs (#26)

* chore: updated .env.example

* chore: added vscode extensions recommendations

* chore: updated dependencies

* chore: updated README

* chore: updated dependencies

* chore: moved tailwind import to js

* chore: added tests to env variables

* chore: added env vault config

* chore: work on workflows

* chore: updated bun lock

* chore: updated dependencies

* chore: force build step to bundle env

* chore: force build step to bundle env

* chore: updated dotenv-vault

* feat: bumped vault version

* chore: I give up on dotenv-vault

* chore: removed vault from workflow

* chore: updated envs to work on both states

* [DEV-54] repository enhancements and utilities package (#29)

* chore: upgraded dependencies

* feat: added banner to readme

* feat: added code of conduct

* feat: added contributing guide

* test: move md files to github dir

* chore: renamed contributing to github standard

* feat: added screenshot to readme

* chore: updaded pr template

* feat: added bug report issue template

* feat: added base shared package

* chore: moved api to js export

* feat: finished api integration

* chore: updated dependencies

* chore: updated dependencies

* feat: moved service and api to shared lib

* chore: enhanced tests

* feat: added tests

* chore: added type tests to CICD

* feat: added api tests

* feat: added test type entry

* chore: removed prisma ads

* [DEV-12] Enhance profile creation page (#30)

* chore: removed prisma ads

* fix: 404 thrown on non localized pages

* fix: missing textures on cards

* feat: refactored profile form
  • Loading branch information
darklight9811 authored Sep 3, 2024
1 parent a304d46 commit 38d5004
Show file tree
Hide file tree
Showing 66 changed files with 1,398 additions and 673 deletions.
12 changes: 0 additions & 12 deletions .editorconfig

This file was deleted.

47 changes: 47 additions & 0 deletions .github/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Code of Conduct
## Introduction

Our open source project is committed to creating a welcoming and inclusive environment for everyone who participates. We value diversity and strive to ensure that our community remains respectful and supportive. By participating in this project, you agree to abide by this Code of Conduct.
Expected Behavior

## Everyone in our community is expected to:

- Be Respectful: Treat all individuals with respect, and be considerate of different viewpoints and experiences.
- Be Inclusive: Encourage participation from people of diverse backgrounds and experiences.
- Communicate Clearly: Use clear and professional language in all communications, whether they are in comments, issues, or discussions.
- Give Constructive Feedback: Provide feedback that is constructive and aimed at improving the project, rather than criticizing individuals personally.
- Acknowledge Contributions: Recognize and respect the contributions and ideas of others.

## Unacceptable Behavior

The following behaviors are not tolerated:

- Harassment: Engaging in discriminatory, harassing, or threatening behavior. This includes, but is not limited to, offensive comments related to gender, sexual orientation, disability, physical appearance, race, or religion.
- Personal Attacks: Making personal attacks or derogatory comments about others.
- Disruptive Behavior: Engaging in disruptive behavior that undermines the project or community, such as spamming or trolling.
- Abuse of Authority: Using a position of power or influence to coerce or intimidate others.

## Reporting Issues

If you encounter or witness behavior that violates this Code of Conduct, please report it to the project maintainers. You can do so by:

- Opening an Issue: File an issue on our GitHub repository with a description of the behavior and any relevant context.
- Contacting Maintainers Directly: Reach out via email or direct message to one of the project maintainers. Contact information can be found in the MAINTAINERS.md file.

All reports will be reviewed and investigated promptly and fairly. Confidentiality will be maintained to the extent possible.

## Enforcement

Violations of the Code of Conduct may result in a range of responses, from a warning to temporary or permanent removal from the project. The severity of the response will be proportional to the nature of the violation.

The project maintainers will handle enforcement with discretion and transparency. Our goal is to address issues fairly and ensure a positive experience for everyone involved.

## Acknowledgements

This Code of Conduct is inspired by the [Contributor Covenant](https://www.contributor-covenant.org/), version 2.1.

## Changes

This Code of Conduct may be updated periodically to reflect changes in the project or community needs. Please check this document regularly for any updates.

Thank you for helping to make our project a welcoming and inclusive space!
50 changes: 50 additions & 0 deletions .github/CONTRIBUTING
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Contributing to sharedway

Thank you for considering contributing to sharedway! We welcome contributions of all kinds, whether it's code, documentation, or simply feedback. This guide will help you get started.

## Table of Contents

- [Code of Conduct](#code-of-conduct)
- [Getting Started](#getting-started)
- [Reporting Issues](#reporting-issues)
- [Style Guide](#style-guide)
- [Questions?](#questions)

## Code of Conduct

Please read and follow our [Code of Conduct](CODE_OF_CONDUCT.md). We are committed to creating a welcoming and inclusive environment for all contributors.

## Getting Started

1. **Fork the Repository**: Click the "Fork" button at the top-right corner of this page.
2. **Clone Your Fork**: Clone your forked repository to your local machine.
```bash
git clone https://github.com/darklight9811/sharedway.git
```
3. **Create a Branch**: Create a new branch for your changes.
```bash
git checkout -b your-branch-name
```
4. **Install Dependencies**: Run `bun install` to install all required dependencies.
5. **Make Your Changes**: Implement your feature or fix.

## Reporting Issues
If you encounter a bug or have a feature request, please open an issue on GitHub. Provide as much detail as possible, including:
- A clear description of the problem or request
- Steps to reproduce the issue
- Expected and actual results
- Any relevant screenshots or logs

## Style Guide

Please follow our project's style guide to ensure consistency. Key points include:

- Use descriptive commit messages
- Run `biomejs` linter and formatter
- Write clear, concise documentation

## Questions?

If you have any questions, feel free to reach out via discussions or contact us directly at [email protected]

Thank you for contributing to sharedway!
85 changes: 85 additions & 0 deletions .github/ISSUE_TEMPLATE/1.bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: Report an issue
description: Report an issue.
labels: ['bug']
body:
- type: markdown
attributes:
value: |
This template is used for reporting a issue with sharedway.
Feature requests should be opened in [discussions](https://github.com/darklight9811/sharedway/discussions/new?category=ideas).
Before opening a new issue, please do a [search](https://github.com/darkligh9811/sharedway/issues) of existing issues and :+1: upvote the existing issue instead. This will result in a quicker resolution.
- type: textarea
attributes:
label: To Reproduce
description: A step-by-step description of how to reproduce the issue, based on the linked reproduction. Screenshots can be provided in the issue body below. If using code blocks, make sure that [syntax highlighting is correct](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/creating-and-highlighting-code-blocks#syntax-highlighting) and double check that the rendered preview is not broken.
placeholder: |
1. Start the application in development (bun dev --filter=app)
2. Click X
3. Y will happen
validations:
required: true
- type: textarea
attributes:
label: Current vs. Expected behavior
description: |
A clear and concise description of what the bug is (e.g., screenshots, logs, etc.), and what you expected to happen.
**Skipping this/failure to provide complete information of the bug will result in the issue being closed.**
placeholder: 'Following the steps from the previous section, I expected A to happen, but I observed B instead.'
validations:
required: true
- type: textarea
attributes:
label: Provide environment information
description: Please run `next info` in the app directory of the project and paste the results. You might need to use `npx --no-install next info` if next is not in the current PATH.
render: bash
placeholder: |
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 22.5.0
Binaries:
Node: 18.17.1
npm: 9.5.1
Yarn: 1.22.19
pnpm: N/A
Relevant Packages:
next: 13.4.20
eslint-config-next: 13.4.20
react: 18.2.0
react-dom: 18.2.0
typescript: 5.2.2
Next.js Config:
output: N/A
validations:
required: true
- type: dropdown
attributes:
label: Which area(s) are affected? (Select all that apply)
multiple: true
options:
- 'Not sure'
- 'Services'
- 'Frontend'
- 'Design System'
- 'API'
- 'Deployment'
- 'Development'

validations:
required: true
validations:
required: true
- type: markdown
attributes:
value: |
Another way you can help the maintainers' job is to pinpoint the commit that introduced the issue.
- type: textarea
attributes:
label: Additional context
description: |
Any extra information that might help us investigate. For example, is it only reproducible online, or locally too? Is the issue only happening in a specific browser? etc.
placeholder: |
I tested my reproduction against development branch.
8 changes: 8 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
blank_issues_enabled: false
contact_links:
- name: Ask a question or discuss a topic
url: https://github.com/darklight9811/sharedway/discussions
about: Ask questions or discuss with other contributors in discussions.
- name: Feature or documentation request
url: https://github.com/darklight9811/sharedway/discussions/new?category=ideas
about: Open a feature request in discussions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ Please include a summary of the change and/or which issue is fixed.
List any dependencies required for this change, if there are any.
📛📛 -->


---

### **Additional context**
Expand Down
File renamed without changes.
33 changes: 33 additions & 0 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,39 @@ jobs:
- name: Run tests
run: bun run test --filter=@repo/env

envs-production:
name: Check production env integrity
runs-on: ubuntu-latest
environment: Production
steps:
- name: Check out code
uses: actions/checkout@v4

- uses: oven-sh/setup-bun@v1
- name: Install dependencies
run: bun install

- name: Run tests
run: bun run test --filter=@repo/env

- name: Run type tests
run: bun run test:type

envs-preview:
name: Check preview env integrity
runs-on: ubuntu-latest
environment: Preview
steps:
- name: Check out code
uses: actions/checkout@v4

- uses: oven-sh/setup-bun@v1
- name: Install dependencies
run: bun install

- name: Run tests
run: bun run test --filter=@repo/env

envs-production:
name: Check production env integrity
runs-on: ubuntu-latest
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ node_modules
# testing
coverage
trace
tsconfig.vitest-temp.json

# next.js
.next/
Expand Down
6 changes: 6 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,11 @@
},
"[prisma]": {
"editor.defaultFormatter": "Prisma.prisma"
},
"[jsonc]": {
"editor.defaultFormatter": "biomejs.biome"
},
"[typescriptreact]": {
"editor.defaultFormatter": "biomejs.biome"
}
}
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
<img src="./public/banner.png" />

# <img src="./public/images/logo/favicon.svg" width="24" /> Sharedway

[![Production](https://img.shields.io/badge/deployment-prod-3a506b?&style=for-the-badge&labelColor=dbf0fd)](https://sharedway.org)
Expand All @@ -7,6 +9,8 @@

An application to help find missing people and animals. Serving as a central bank (or HUB) for institutions, the government and anyone can access the data. A difference is that it allows you to filter by region, so that you can see missing people or animals in the location with better distinction.

<img src="./public/screenshot.png" />

## Installation

> You will need to have API keys for: clerk, kv, uploadthing and a postgres database
Expand Down
25 changes: 13 additions & 12 deletions apps/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,34 +14,35 @@
"postinstall": "cd ../../ && bun run postinstall"
},
"dependencies": {
"@clerk/localizations": "^2.6.0",
"@clerk/nextjs": "^5.3.2",
"@clerk/localizations": "^2.7.1",
"@clerk/nextjs": "^5.3.7",
"@react-pdf/renderer": "^3.4.4",
"@repo/ds": "1.0.0",
"@repo/env": "1.0.0",
"@repo/schemas": "1.0.0",
"@repo/services": "1.0.0",
"@tanstack/react-query": "^5.52.0",
"@tanstack/react-query-devtools": "^5.52.0",
"@upstash/ratelimit": "^2.0.1",
"@tanstack/react-query": "^5.53.3",
"@tanstack/react-query-devtools": "^5.53.3",
"@upstash/ratelimit": "^2.0.2",
"@vercel/analytics": "^1.3.1",
"@vercel/functions": "^1.4.0",
"@vercel/functions": "^1.4.1",
"@vercel/kv": "^2.0.0",
"@vercel/speed-insights": "^1.0.12",
"lucide-react": "^0.428.0",
"next": "^14.2.5",
"next-intl": "^3.17.4",
"@yamiassu/shared": "*",
"lucide-react": "^0.438.0",
"next": "^14.2.7",
"next-intl": "^3.19.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"zod": "^3.23.8"
},
"devDependencies": {
"@repo/config": "0.0.0",
"@types/node": "^20.16.1",
"@types/react": "^18.3.4",
"@types/node": "^22.5.2",
"@types/react": "^18.3.5",
"@types/react-dom": "^18.3.0",
"autoprefixer": "^10.4.20",
"postcss": "^8.4.41",
"postcss": "^8.4.44",
"tailwindcss": "^3.4.10",
"typescript": "^5.5.4"
}
Expand Down
2 changes: 1 addition & 1 deletion apps/app/src/app/(app)/profiles/new/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export default function Page() {
{t("create-title")}
</h1>

<ProfileForm onSubmit={store} schema="store" require>
<ProfileForm onSubmit={store}>
<Link href="/" className={buttonVariants({ variant: "outline" })}>
{t("back")}
</Link>
Expand Down
4 changes: 3 additions & 1 deletion apps/app/src/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ export const localePrefix = "always";

export default getRequestConfig(async () => {
// Validate that the incoming `locale` parameter is valid
const locale = getLocaleContent(headers().get("Accept-Language"));
const locale = getLocaleContent(
headers().get("Accept-Language") || locales[0],
);

if (!locale) return notFound();

Expand Down
16 changes: 12 additions & 4 deletions apps/app/src/lib/api.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
import createApi from "@repo/services/api";
import type Metadata from "@repo/services/types/metadata";
import { createApi } from "@yamiassu/shared/js";
import type { Prettify } from "@yamiassu/shared/types";
import { buildMetadata } from "./parallel";

const api = createApi({
bind: {},
});
const api = createApi({});

export function apiService<Input, Output>(
cb: (input: Input) => (metadata: Metadata) => Output,
) {
return async (ctx: { input: Input }): Promise<Prettify<Output>> =>
cb(ctx.input)(await buildMetadata());
}

export default api;
Loading

0 comments on commit 38d5004

Please sign in to comment.